Agents
Connect over MCP
The Mortise MCP server lets an AI agent work inside one vault. Every action goes through the vault's Gate, which enforces the owner's limits on chain. The server adds no permissions of its own and can do nothing the Gate would refuse.
1. Add the agent to the vault
In the app, open Agents and plug in the agent's address. Choose its expiry, the adapters and markets it may use, and a cap per token. A token without a cap cannot be spent.
2. Store the agent's key
Create a file only you can read, then write the agent's private key into it with an editor. Never paste the key into a chat or a command line. Give the agent's address a little ETH for gas: it pays for its own transactions.
install -m 600 /dev/null ~/.mortise-agent.keyThe server refuses to start if the file is readable or writable by other users, or if the key is one of the vault's root keys or guardians.
3. Add the server to your MCP client
Use the absolute path of the key file. MCP clients pass the value as it is written, so ~ is not expanded.
{
"mcpServers": {
"mortise": {
"command": "npx",
"args": ["-y", "@mortiseagentvault/mcp"],
"env": {
"MORTISE_VAULT": "0xYourVault",
"MORTISE_AGENT_KEY_FILE": "/home/you/.mortise-agent.key"
}
}
}
}The server needs Node.js 20 or later. It is one bundled file with no runtime dependencies.
Settings
| Variable | What it is |
|---|---|
| MORTISE_VAULT | The vault's address. Required. |
| MORTISE_AGENT_KEY_FILE | File with the agent's private key, mode 600. Required. |
| MORTISE_RPC_URL_FILE | File with an RPC URL that carries an API key, mode 600. Optional. |
| MORTISE_RPC_URL | RPC URL. Optional; defaults to the public Robinhood Chain RPC. |
Neither the key nor the RPC URL ever appears in the server's output or errors. The server also refuses to start if the vault does not exist or the RPC serves another chain.
Tools
| Tool | What it does |
|---|---|
| mortise_permissions | Whether the agent is live and until when, the adapters it may use, the cap left per token. |
| mortise_vault | Gate and pause state, timelock delay, family, ETH balance. |
| mortise_balances | The vault's balances of ETH and the tokens given. |
| mortise_min_rate | The owner's price floor for selling one token for another. |
| mortise_simulate | Runs actions without sending them; returns the markets used or the reason for a refusal. |
| mortise_execute | Sends actions to the Gate in one transaction, after simulating them. |
| mortise_trigger | Runs a due step of the DCA, automation or rebalance module, as its keeper. |
Actions cover WETH, Uniswap v3 and v4 swaps and positions, Morpho Blue, ERC-4626, Pons, Flap, Across, listed transfers and family transfers. Amounts are integer strings in the token's smallest unit.