AI agents · MCP
Give an agent a trading desk, not your keys.
The IntentBook MCP server lets Claude, Codex or any MCP client read the book and trade on it. Each agent gets its own NEAR Intents account and a spending cap the human sets.
01
The API builds the order
The agent asks for a quote-sized order. IntentBook returns the exact token_diff to sign.
02
The agent signs it locally
The MCP server holds the agent's ed25519 key and signs NEP-413. The API only ever sees the signature.
03
intents.near checks it
The order is matched like anyone else's and the batch is simulated on mainnet before anything settles.
Add it to Claude Code
claude mcp add intentbook \ -e INTENTBOOK_URL=https://intentbook.up.railway.app \ -e INTENTBOOK_AGENT_MAX_USDC=5 \ -- npx tsx /path/to/intentbook/mcp/stdio.ts
Or any MCP client
{
"mcpServers": {
"intentbook": {
"command": "npx",
"args": [
"tsx",
"/path/to/intentbook/mcp/stdio.ts"
],
"env": {
"INTENTBOOK_URL": "https://intentbook.up.railway.app",
"INTENTBOOK_AGENT_MAX_USDC": "5",
"INTENTBOOK_AGENT_PAIRS": "NEAR-USDC"
}
}
}
}Then ask
“What is the NEAR spread on IntentBook? Rest a 2 NEAR bid at 1 USDC, then cancel it.”
Tools
intentbook_status
The agent's account, its guardrails, dry-run or live
get_book · get_ticker
Depth, mid, spread and lot size
best_price
Book versus 1Click versus Rhea for a size
place_order
Build the order, sign it locally, submit it
cancel_order
Signed cancel of one of the agent's orders
my_orders · my_balances
The agent's orders and intents.near balances
Guardrails the human sets
INTENTBOOK_AGENT_MAX_USDCcaps every order. Default 25.INTENTBOOK_AGENT_PAIRSlimits the markets it can touch.- The key lives at
~/.intentbook/agent-key.jsonorINTENTBOOK_AGENT_SECRET. Fund its account inside intents.near to trade live. - Every agent order is a token_diff the agent signed, checked by intents.near like a person's.