> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI agents

> Use a coding agent to write, compile and simulate Sauce programs, then review how transactions are signed.

You can ask a coding agent to turn a task into a Sauce program, compile it and test it against chain state. The SDK provides two parts of that workflow:

* **The MCP server**, `sauce mcp`, gives the agent tools to compile, simulate and build transactions.
* **The agent skills** explain SauceScript, each chain's names and common integration patterns.

You review the program, simulation and transaction before sending funds. Transaction-building tools return unsigned transactions. A local server also exposes wallet tools by default; [Signing](#signing) explains the available signing paths and how to disable local wallet access.

## Prerequisites

* Node.js 24 or newer and a coding agent that supports MCP.
* The Sauce MCP server configured as described in [Installation](https://docs.eco.com/sauce-sdk/installation.md#add-the-mcp-server-to-your-agent).
* A chain and a task to test. You do not need a funded wallet to compile a program or simulate it with an assumed balance.

To check the connection, ask the agent to list its `sauce_` tools. The server provides the skills directly, so installing skill files in your project is optional.

## What the agent gets

| What | Names | Notes |
| - | - | - |
| Building tools | `sauce_chains`, `sauce_globals`, `sauce_price`, `sauce_pools`, `sauce_compile`, `sauce_actions`, `sauce_simulate`, `sauce_pot`, `sauce_tx`, `sauce_signed_cook`, `sauce_reclaim`, `sauce_inspect`, `sauce_verify` | Each calls the function its `sauce` command calls and returns that command's `--json` result |
| Sending signed transactions | `sauce_send` | Broadcasts transactions a wallet has already signed |
| Skills | `sauce_skills`, `sauce_skill`, `sauce_dev`, `sauce_install_skills`, and resources under `sauce://skills/` | The same skills `sauce skills install` copies |
| Prompt | `sauce_write_program` | The workflow below, as one prompt |
| Wallets and Pots, stdio only | `sauce_wallet_*`, `sauce_sign`, `sauce_pot_list`, `sauce_pot_import` | See [Wallets over stdio](#wallets-over-stdio) |

A server started with `--no-wallets --no-stores` lists 18 tools. The default stdio server lists 27. [MCP tools](https://docs.eco.com/sauce-sdk/mcp/tools.md) documents each tool's inputs and outputs. No tool takes a private key or a password.

### The skills

| Skill | What it teaches |
| - | - |
| `sauce-overview` | Start here: the Pot, the cook and the Kitchen, the rules, the supported chains, and the map of the other skills |
| `sauce-script` | The language: program forms, values, contract calls, failures, compile errors, every builtin |
| `sauce-globals` | The names a program uses with no import: token symbols, tokenized stocks, `Token(address)`, protocol namespaces |
| `sauce-chains` | Each chain's tokens and protocol deployments, and the Sauce deployment |
| `sauce-protocols` | Every protocol by category, its names in a program, its ABI and its pitfalls |
| `sauce-swaps` | Swaps with `@sauce/router` on EVM chains and Solana |
| `sauce-distributed-swap` | One exact-input order over several price-limited pools on an EVM chain |
| `sauce-solana-distributed-swap` | The same order over Solana's pools |
| `sauce-solana` | Accounts, derived accounts, SPL Token and Token-2022, transaction size |
| `sauce-actions` | A program as a JSON actions document |
| `sauce-cli` | The `sauce` command and each command's MCP tool |
| `sauce-typescript` | The same tasks from application code |
| `sauce-examples` | Complete programs, and an index of every example |

The skills follow the [Agent Skills](https://agentskills.io/specification) format. `sauce skills install` writes them to:

* `.claude/skills/`, for Claude Code;
* `.agents/skills/`, for Codex, Cursor, Copilot and Gemini CLI.

Through the server, an agent reads them with `sauce_skills` and `sauce_skill`, or as `sauce://skills/<path>` resources, with nothing installed in the project.

## From a request to an unsigned transaction

The `sauce_write_program` prompt takes two arguments:

* `task` (required): what the program should do, in plain words;
* `chain` (optional): `base`, `solana` or a chain id.

The prompt tells the agent to read three skills: `sauce-overview`, `sauce-script` and `sauce-cli`, or `sauce-solana` in place of `sauce-script` for Solana. The agent then writes the program itself and follows these steps:

**1. Look up names**

`sauce_globals` for the chain returns the token symbols and protocol namespaces a program may use. Use registered names such as `USDC` and `UniswapV3.Factory` where available.

**2. Compile**

The agent calls `sauce_compile` and resolves any errors, which name the line and column. The result's `entryParams` describes the inputs that `main` takes, passed later as `args`.

**3. Simulate**

`sauce_simulate` runs the cook from the Pot's owner against the chain's current state. Its result lists what moved, or why the cook reverts. `assumeBalance` gives the Pot a balance for that simulation only.

**4. Check the Pot**

`sauce_pot` returns the owner's Pot address, whether it is deployed, the Kitchen's fee and what the Pot holds.

**5. Build the transaction**

`sauce_tx` returns the unsigned cook. If the Pot has no code yet, it returns the Kitchen's `deployPot` first. Review the transaction plan before choosing a signing method.

On a preview chain, the first two steps work, and the third wherever the release's engine and Kitchen are deployed. `sauce_pot` still returns the Pot's address and balances, with a `refused` object in place of its deployment transaction. `sauce_tx` returns only `refused`, an error result naming the supported chains: Ethereum, Base, Arc and Solana, and the testnets Arc Testnet, Base Sepolia, Ethereum Sepolia, Solana Devnet and Solana Testnet.

A request to an agent can be as short as this:

```text theme={null}
Using the Sauce tools, write a program for Base that pays USDC from the Pot. Take the recipient
and the amount as main's arguments, and first require that the Pot holds at least the amount, with
the message "not enough USDC". Compile it, then simulate paying 1 USDC to
0xb3614CaCb467102B28114E8aA8f76349d19454f0 with 5 USDC in the Pot.
Only compile and simulate; do not sign or send transactions.
```

The agent calls `sauce_simulate` with the two values in `args` and `assumeBalance: ["USDC:5"]`. A cook that reverts comes back as an error result, with `reverted: true` and the revert reason. The program the agent writes is an ordinary `.sauce.ts` file, and `sauce simulate` with the same arguments prints the same outcome.

## Signing

To disable local wallet tools, configure the server to start with `sauce mcp --no-wallets`. The server can still build unsigned transactions for an external wallet. This flag controls the MCP server's tools; [Agents, wallets and keys](https://docs.eco.com/sauce/security-considerations.md#agents-wallets-and-keys) explains the access an agent may have outside those tools.

There are three ways to sign what the server builds:

* **Your own wallet.** `sauce_tx` returns the unsigned transactions. Sign them in the wallet you already use, and broadcast them there or with `sauce_send`.
* **A wallet's own MCP server.** An agent can pass the unsigned transactions to a wallet's own MCP server, which keeps its key away from the agent. See [Sign with a wallet's MCP server](https://docs.eco.com/sauce-sdk/mcp/external-wallets.md).
* **The server's own wallets, over stdio only.** See the next section.

### Wallets over stdio

A server your agent starts over stdio serves the wallets in `~/.sauce/wallets`, the same directory the `sauce wallet` command uses:

* `sauce_wallet_list` and `sauce_wallet_address` read them with no password.
* `sauce_wallet_create`, `sauce_wallet_import`, `sauce_wallet_send` and `sauce_sign` work once the wallets are enabled. A password source given when the server starts enables them, for example `sauce mcp --password-env SAUCE_WALLET_PASSWORD`. Without one, the agent calls `sauce_wallet_enable`, naming where the password comes from (a variable of the server's environment, a password file, a `.env` file, or a new generated password file), never the password itself.
* `sauce_wallet_send` simulates what it is given and holds it to the wallet's spending policy before it sends.

The HTTP server never signs and has no wallet tools. See [Wallets over stdio](https://docs.eco.com/sauce-sdk/mcp/wallets.md) and [Wallets, passwords and spending policy](https://docs.eco.com/sauce-sdk/cli/wallets-and-policy.md).

## Next steps

* [MCP tools](https://docs.eco.com/sauce-sdk/mcp/tools.md): every tool, its inputs and outputs.
* [Local server storage](https://docs.eco.com/sauce-sdk/mcp/local-server.md): the Pot store and the wallet directory.
* [Self-hosting over HTTP](https://docs.eco.com/sauce-sdk/mcp/self-hosting.md): one server for a team.
* [sauce skills](https://docs.eco.com/sauce-sdk/cli/skills.md): install, update and check the skills.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.