@routemesh/mcp is a local MCP server that lets AI coding agents query blockchain data through RouteMesh. Configure it once and your agent gets cross-chain RPC tools — blocks, transactions, logs, balances, fees — plus optional tools to view usage and manage your API keys.
- Query 1000+ EVM chains from one server — no per-chain endpoint config.
- Read-only on-chain tools, plus a generic
rpc_callescape hatch for any JSON-RPC method. - Automatic failover: requests retry against
lb2.routeme.shwhenlb.routeme.shreturns retryable errors. - Every result carries the
X-Batch-Idcorrelation id, so you can trace requests in the Logs page.
How it works
The server runs locally as a stdio process spawned by your MCP client (Cursor, Claude Desktop, VS Code, or any other stdio MCP client). It keeps no state and runs no background services:- RPC tools send JSON-RPC to
POST /rpc/{chain_id}/{api_key}, using yourROUTEMESH_API_KEYin the URL path. - Customer tools (usage and API keys) call
https://api.routeme.shwith a customer management token in theX-Api-Keyheader. They are only exposed when theROUTEMESH_MGMT_TOKENenv var is set. - On retryable failures (HTTP 429 or 5xx, timeouts, network errors), the server retries with exponential backoff, alternating between the primary and backup load balancers.
Prerequisites
- Node.js 20 or later
- A RouteMesh API key — see Quick Start
- A customer management token — optional, only needed for the customer tools
Setup
Configure your MCP client
In Cursor, add the following to~/.cursor/mcp.json:
npx, args -y @routemesh/mcp, and the environment variables below. In Claude Desktop, this goes in claude_desktop_config.json.
Environment variables
The defaults work for all RouteMesh customers — in most setups you only need
ROUTEMESH_API_KEY.
Tools
RPC tools
Always available.chainId is the numeric EVM chain ID (e.g. 1 for Ethereum mainnet, 8453 for Base). Use rpc_list_chains to discover chains by name or ID.
Customer tools
Exposed only whenROUTEMESH_MGMT_TOKEN is set.
get_usage parameters
from/to— RFC3339 window (e.g.2026-06-01T00:00:00Z). Defaults: last 30 days up to now; max span 90 days.include— sections to return:summary,balance,by_chain,by_api_key,by_api_key_chain,top_methods,time_series,by_scenario. Default:summary,balance.groupBy— flat grouped rows instead of sections:chain,api_key,api_key,chain,method,day. Overridesinclude.chainId/apiKeyId— filter to one chain or one API key.granularity—dayorhourfortime_series(defaultday).limit— max rows fortop_methodsandgroupBy(default 20, max 100).
Management tokens
Customer tools authenticate with a customer management token. Create one in the dashboard:- Open Mgmt Tokens.
- Click New Token and give it a label (e.g.
mcp-cursor). - Copy the secret — it is shown only once.
GET /usage, GET /api-keys, POST /api-keys, PUT /api-keys/:id) and nothing else. Use a dedicated token for the MCP server so you can revoke it independently if it leaks.
Example prompts
- “List chains that match
baseand show me their chain IDs.” - “Get the latest block on BSC and summarize the timestamp and transaction count.”
- “Fetch the receipt for tx
0x...on Ethereum and tell me if it succeeded.” - “Get logs for contract
0x...on Arbitrum between blocks 1000000 and 1050000.” - “Estimate gas for calling this method on Base with these parameters.”
- “Run
eth_getCodefor address0x...on Base (chain 8453).” - “Show my RouteMesh usage for the last 7 days broken down by chain.”
- “What is my current RouteMesh balance and request count this month?”
Errors and debugging
- Tools return structured JSON. RPC errors from the router are passed through unchanged — interpret
error.codewith RPC error codes. - Retryable HTTP failures (429, 5xx, timeouts) are retried automatically up to
ROUTEMESH_RETRY_ATTEMPTS. - Every RPC result includes the
batchIdfrom theX-Batch-Idresponse header. Use it in the Logs page exactly as you would for direct RPC calls — see Debugging. - eth_getLogs limits apply to
rpc_get_logsexactly as they do to direct requests.
Next steps
- Quick Start — Get an API key and make your first request.
- Request behavior — Cooldowns, 429s, and batch requests.
- Debugging — Use
X-Batch-Idand the Logs page when something goes wrong.

