Skip to main content
@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_call escape hatch for any JSON-RPC method.
  • Automatic failover: requests retry against lb2.routeme.sh when lb.routeme.sh returns retryable errors.
  • Every result carries the X-Batch-Id correlation 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 your ROUTEMESH_API_KEY in the URL path.
  • Customer tools (usage and API keys) call https://api.routeme.sh with a customer management token in the X-Api-Key header. They are only exposed when the ROUTEMESH_MGMT_TOKEN env 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.
All on-chain tools are read-only. The customer tools can create and update API keys, so use a dedicated management token for them.

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:
Any stdio MCP client uses the same shape: command 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 when ROUTEMESH_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. Overrides include.
  • chainId / apiKeyId — filter to one chain or one API key.
  • granularityday or hour for time_series (default day).
  • limit — max rows for top_methods and groupBy (default 20, max 100).

Management tokens

Customer tools authenticate with a customer management token. Create one in the dashboard:
  1. Open Mgmt Tokens.
  2. Click New Token and give it a label (e.g. mcp-cursor).
  3. Copy the secret — it is shown only once.
Customer management tokens are scoped automatically to your account’s management routes (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 base and 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_getCode for address 0x... 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.code with RPC error codes.
  • Retryable HTTP failures (429, 5xx, timeouts) are retried automatically up to ROUTEMESH_RETRY_ATTEMPTS.
  • Every RPC result includes the batchId from the X-Batch-Id response header. Use it in the Logs page exactly as you would for direct RPC calls — see Debugging.
  • eth_getLogs limits apply to rpc_get_logs exactly 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-Id and the Logs page when something goes wrong.