What is the Compass MCP server?
The Compass API hosts a Model Context Protocol server at:The server speaks MCP’s Streamable HTTP transport;
https://api.compasslabs.ai/mcp and .../mcp/ both work. Authentication is your regular Compass API key sent as an X-API-Key header — get a free key here.Connect a client
- Claude Code
- Cursor
- Claude Desktop
- Any client / cURL
What you get
48 tools spanning the Compass products. Names mirror the API operation ids, and descriptions and parameter schemas come from the same OpenAPI source as the API reference —tools/list is always in sync with the deployed API.
On connect, the server also returns usage instructions to the client (the flow below, amount conventions, chain coverage per product), so well-behaved agents follow the rules without extra prompting.
The non-custodial flow
- Read — markets, positions, and balances tools return data directly.
-
Account — Earn, Credit, and Tokenized Equities act through a per-owner product account: call that product’s
*_create_accounttool first. It is idempotent and returnstransaction: nullif the account already exists. -
Build — action tools return an unsigned transaction
{to, data, value, ...}. -
Sign & broadcast — with your own key, for example with Foundry’s
cast:
- Global Markets perps (Hyperliquid): build the order with
v2_global_markets_perps_market_order(orlimit_order,withdraw, …) → sign the returned typed data → submit viav2_global_markets_perps_execute. Fund first withv2_global_markets_perps_deposit; perps need no product account. - Tokenized Assets:
v2_tokenized_assets_order→ sign →v2_tokenized_assets_order_submit. RWA yield assets (e.g. mTBILL) can also be bought or sold directly withv2_tokenized_assets_transact_buy/_sell, which return a regular unsigned transaction. - Gas sponsorship: call an action with
gas_sponsorship: true→ sign the returned EIP-712 → submit signature and typed data tov2_gas_sponsorship_prepare→ a sponsor broadcasts, and the owner pays no gas. See Gas Sponsorship. - On-ramp (browser handoff): a fiat card + KYC flow can only render in a browser, so an agent cannot complete it inline. Call
v2_onramp_create→ present the returnedcheckout_urlanduser_instructionsto the user so they can pay by card → then pollv2_onramp_status(with thepayment_id) untildelivered. USDC lands in the user’s own wallet (non-custodial); continue with the tokenized buy. See On-Ramp.
Good to know
- Amounts are decimal token units (
"1.5"means 1.5 USDC), never wei."ALL"is not supported — pass an explicit amount. - Tokens go by symbol (
USDC,WETH) or0xaddress; pass the address when a symbol isn’t recognized. - Chains vary by product: Earn and Credit cover Ethereum, Base, Arbitrum, HyperEVM, and Tempo; CCTP bridges Ethereum, Arbitrum, and Base; Tokenized Assets settle on Ethereum (RWA buy/sell swaps also on Base); perps run on Hyperliquid.
- The server is stateless: every request is self-contained — no sessions to manage, and a 5xx is safe to retry once.
- Errors: 4xx bodies are actionable (for example
Unknown token symbol) — surface them as-is. A 401 means theX-API-Keyheader is missing or invalid.
Looking for the docs-search MCP server?
Looking for the docs-search MCP server?
https://docs.compasslabs.ai/mcp is a different server: it searches this documentation site and needs no API key. The server documented on this page — api.compasslabs.ai/mcp — is the one that reads on-chain state and builds transactions.Prefer a shell?
The
compass CLI wraps the same API as subcommands — for terminals, scripts, and CI.Agent Skill
A packaged skill that teaches Claude Code, Cursor, or Codex the Compass workflow end to end.