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:

HostedLocal (stdio)
Endpointhttps://mcp.asksurf.ai/mcpnpx @surf-ai/surf-mcp
SetupA URL, nothing to installNode.js 20+ or Bun
Sign in with your Surf accountYes — OAuth, if your client supports itNo — API key only
Best forMost clientsAir-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/mcp

Then 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.

ℹ️ Info

--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

ClientPath
Claude Codeclaude mcp add, or ~/.claude.json
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
CursorMCP 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.

ToolCommands
surf_marketprice, 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_exchangeprice, depth, klines, candles, markets, coverage, perp, funding-history, long-short-ratio
surf_hyperliquidleaderboard, account, positions, orders, fills, trades, trades-aggregate, trade-context, candles, performance
surf_prediction_marketpolymarket-* (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_equityoverview, meta, company-profile, candles, financial-metrics, income-statement, balance-sheet, cash-flow, latest-financials, filings, latest-filings, listings, etf-holdings
surf_onchainsql, sql-preflight, sql-job-create, sql-job-get, sql-job-results, structured-query, schema, tx, gas-price, dex-activity, bridge-ranking, yield-ranking
surf_walletdetail, net-worth, transfers, history, protocols, labels-batch
surf_tokenholders, dex-trades, transfers, transfer-stats, transfer-counterparties, tokenomics
surf_searchproject, token, wallet, news, web, fund, fundraising, events, airdrop, airdrop-activities, prediction-market
surf_projectdetail, pulse, ai-news, defi-metrics, defi-ranking
surf_signaldetail, projects, token-of-the-day, token-of-week
surf_funddetail, portfolio, ranking
surf_newsfeed, detail
surf_dextoken-price
surf_portfoliowallets
surf_webfetch

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:

  1. Fetches the OpenAPI spec from https://api.asksurf.ai/gateway/openapi.json (cached for 24h)
  2. Groups operations by API tag
  3. Registers one MCP tool per tag, with command enums and parameter hints generated from the spec
  4. 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 seeWhat it means
claude mcp list reports Failed to connectExpected 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 /mcpEither 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 creditAuthentication worked; the account is out of credits. Top up under Billing in the console.
406 Not AcceptableThe 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 endpointsOAuth grants are read-only by design. Manage keys and billing in the console instead.

Surf Skill vs MCP Server

Surf SkillMCP Server
Installnpx skills add asksurf-ai/surf-skillsA URL, or JSON config
Works withClaude Code, CodexAny MCP client
AuthSURF_API_KEY env varBrowser sign-in, API key, or anonymous
How it worksTeaches the agent to use the CLIExposes tools over the MCP protocol
Best forCoding agentsGeneral-purpose AI assistants

Resources

AskSurf (Surf AI) — Market Intelligence for AI Agents