MCP Server
Connect any MCP-compatible AI client to Surf's market intelligence API — 17 tools, 123 commands, zero code
MCP Server
The Surf MCP server gives any MCP-compatible AI client (Claude Code, Claude Desktop, Cursor, Windsurf, etc.) direct access to crypto and US equity data. It dynamically generates tools from the OpenAPI spec — no code to write, no endpoints to memorize.
There are two ways to run it:
| Hosted | Local (stdio) | |
|---|---|---|
| Endpoint | https://mcp.asksurf.ai/mcp | npx @surf-ai/surf-mcp |
| Setup | A URL, nothing to install | Node.js 20+ or Bun |
| Sign in with your Surf account | Yes — OAuth, if your client supports it | No — API key only |
| Best for | Most clients | Air-gapped setups, or pinning a version |
The hosted endpoint is the recommended path.
Connect
Pick whichever your client supports. All three work against the same hosted endpoint.
Sign in with your Surf account (OAuth)
Clients that implement MCP authorization can log you in through the browser — no key to copy, and usage bills to your own account.
In Claude Code:
claude mcp add --transport http --scope user surf https://mcp.asksurf.ai/mcpThen start a new session, run /mcp, select surf, and choose Authenticate. Your browser opens the Surf authorization page; sign in, approve the request, and the client is connected. The grant is read-only (data:read) — it can query data but cannot manage your API keys, billing, or account settings, and you can revoke it at any time.
--scope user makes the server available in every project. Without it the server is only registered for the current directory.
Clients without OAuth support fall back to an API key, below.
API key
Works everywhere, including clients that only accept static headers. Create a key in the console under API keys → New API key — it is shown once, so store it immediately.
{
"mcpServers": {
"surf": {
"type": "http",
"url": "https://mcp.asksurf.ai/mcp",
"headers": {
"Authorization": "Bearer sk-surf-your-key"
}
}
}
}In Claude Code:
claude mcp add --transport http --scope user surf https://mcp.asksurf.ai/mcp \
--header "Authorization: Bearer sk-surf-your-key"No credentials
Connecting with just the URL also works. Requests draw on a small daily allowance shared per IP address, which is enough to try things out. Add a key or sign in when you need your account's own credits and rate limits.
{
"mcpServers": {
"surf": {
"type": "http",
"url": "https://mcp.asksurf.ai/mcp"
}
}
}Local (stdio)
Runs the server on your own machine and talks to the data API directly.
{
"mcpServers": {
"surf": {
"command": "npx",
"args": ["-y", "@surf-ai/surf-mcp"],
"env": {
"SURF_API_KEY": "sk-surf-your-key"
}
}
}
}Swap npx for bunx (and drop -y) for a faster start. Omitting SURF_API_KEY falls back to the anonymous allowance.
Config file locations
| Client | Path |
|---|---|
| Claude Code | claude mcp add, or ~/.claude.json |
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) |
| Cursor | MCP settings in the IDE |
Tools
One tool per API domain. Each tool takes a command and optional params; the exact commands track the OpenAPI spec automatically, so new endpoints show up without an upgrade.
| Tool | Commands |
|---|---|
surf_market | price, ranking, listing, etf, futures, options, fear-greed, liquidation-chart, liquidation-order, liquidation-exchange-list, exchange-flow-exchanges, onchain-indicator, price-indicator, public-sale, tge |
surf_exchange | price, depth, klines, candles, markets, coverage, perp, funding-history, long-short-ratio |
surf_hyperliquid | leaderboard, account, positions, orders, fills, trades, trades-aggregate, trade-context, candles, performance |
surf_prediction_market | polymarket-* (markets, prices, trades, positions, orderbooks, leaderboard, smart-money, volumes, open-interest, events, price-ohlcv, volume-split), kalshi-* (markets, prices, trades, orderbooks, volumes, open-interest, events), analytics, correlations, matching-market-pairs, matching-market-daily |
surf_equity | overview, meta, company-profile, candles, financial-metrics, income-statement, balance-sheet, cash-flow, latest-financials, filings, latest-filings, listings, etf-holdings |
surf_onchain | sql, sql-preflight, sql-job-create, sql-job-get, sql-job-results, structured-query, schema, tx, gas-price, dex-activity, bridge-ranking, yield-ranking |
surf_wallet | detail, net-worth, transfers, history, protocols, labels-batch |
surf_token | holders, dex-trades, transfers, transfer-stats, transfer-counterparties, tokenomics |
surf_search | project, token, wallet, news, web, fund, fundraising, events, airdrop, airdrop-activities, prediction-market |
surf_project | detail, pulse, ai-news, defi-metrics, defi-ranking |
surf_signal | detail, projects, token-of-the-day, token-of-week |
surf_fund | detail, portfolio, ranking |
surf_news | feed, detail |
surf_dex | token-price |
surf_portfolio | wallets |
surf_web | fetch |
Usage examples
Once connected, your AI assistant uses the tools directly:
"What's the BTC price?" → surf_market({ command: "price", params: { symbol: "BTC" } })
"Check this wallet" → surf_wallet({ command: "detail", params: { address: "0xd8dA..." } })
"Search for DeFi projects" → surf_search({ command: "project", params: { q: "defi lending" } })
"Run an on-chain SQL query" → surf_onchain({ command: "sql", params: { sql: "SELECT ..." } })
"AAPL fundamentals" → surf_equity({ command: "overview", params: { symbol: "AAPL" } })
How it works
On startup the server:
- Fetches the OpenAPI spec from
https://api.asksurf.ai/gateway/openapi.json(cached for 24h) - Groups operations by API tag
- Registers one MCP tool per tag, with command enums and parameter hints generated from the spec
- Forwards each call to the data API, passing through your credentials
New API endpoints appear automatically when the spec updates — no upgrade needed.
Troubleshooting
| What you see | What it means |
|---|---|
claude mcp list reports Failed to connect | Expected for servers that use OAuth — the health check does not run the authorization flow. Check the real state with /mcp inside a session. |
The server is missing from /mcp | Either it was added without --scope user (so it only exists in one directory), or the session started before it was added. Run claude mcp get surf to check the scope, then start a new session. |
| 401 or "needs a credential" | The endpoint requires authentication. Sign in through your client, or connect an API key. |
| 402 insufficient credit | Authentication worked; the account is out of credits. Top up under Billing in the console. |
| 406 Not Acceptable | The client did not send Accept: application/json, text/event-stream, which the Streamable HTTP transport requires. Add it as a header if your client lets you. |
| 403 on account endpoints | OAuth grants are read-only by design. Manage keys and billing in the console instead. |
Surf Skill vs MCP Server
| Surf Skill | MCP Server | |
|---|---|---|
| Install | npx skills add asksurf-ai/surf-skills | A URL, or JSON config |
| Works with | Claude Code, Codex | Any MCP client |
| Auth | SURF_API_KEY env var | Browser sign-in, API key, or anonymous |
| How it works | Teaches the agent to use the CLI | Exposes tools over the MCP protocol |
| Best for | Coding agents | General-purpose AI assistants |
Resources
- Console: agents.asksurf.ai — API keys, credits, usage
- npm: @surf-ai/surf-mcp
- GitHub: asksurf-ai/surf-mcp
- API Docs: docs.asksurf.ai