All articles

MCP server

sympy.ai exposes its SymPy tools and the full verified agent over the Model Context Protocol (MCP), using the streamable HTTP transport.

Endpointhttps://api.sympy.ai/mcp/
Transportstreamable HTTP
Local devhttp://localhost:8000/mcp/

Keep the trailing slash. https://api.sympy.ai/mcp answers with a 307 redirect to /mcp/, and MCP clients that don't follow redirects on POST will fail against the slashless form. Use the host api.sympy.ai — the server's DNS-rebinding guard only admits that hostname (and localhost), so the underlying *.up.railway.app address is not a supported endpoint.

Authentication

Every request needs a sympy.ai API key. Create one on your account page or dashboard — it is shown once, and starts with mv_. See Account & settings.

Send it as either header:

X-API-Key: mv_xxxxxxxx... # or Authorization: Bearer mv_xxxxxxxx...

Each tool call is billed to the key's subscription and logged with source=mcp, visible in your usage history.

Browser sign-in (not yet available)

Signing in from the client — adding the server with no credential and clicking Authenticate — is not enabled yet. OAuth discovery is currently switched off in production: /.well-known/oauth-protected-resource/mcp returns 404, and an unauthenticated request gets a bare WWW-Authenticate: Bearer challenge with nothing to discover, so clients cannot offer a sign-in option. Until this ships, an API key is the only way in. This page will be updated when it goes live.

Responses to a rejected request

HTTPMeaning
401Missing, invalid, revoked, or expired credential
402Credential is valid, but the account has no subscription to bill
429Rate limit for your plan exceeded (Retry-After: 60)

Tools

ToolArgsBilling
simplifyexpressionflat 50 tokens
solveexpression, variableflat 50 tokens
integrateexpression, variableflat 50 tokens
differentiateexpression, variableflat 50 tokens
limitexpression, variable, pointflat 50 tokens
seriesexpression, variable, point="0", n=6flat 50 tokens
matrix_opoperation, matrix_dataflat 50 tokens
math_verifyproblem, model_tier="flash"full agent; actual LLM token usage

Every SymPy tool runs inside a subprocess sandbox. math_verify runs the whole plan → reason → sympy → verify pipeline and accepts model_tier of "flash" (default) or "pro". If your balance can't cover a call, the tool returns the error insufficient tokens: need N, have M.

Claude Code

bash
claude mcp add --transport http sympy https://api.sympy.ai/mcp/ \
  --header "X-API-Key: mv_xxxxxxxx..."

Then run /mcp inside Claude Code to confirm the server is connected.

Claude Desktop

Claude Desktop speaks stdio MCP, so bridge to the HTTP endpoint with mcp-remote. Edit claude_desktop_config.json:

json
{
  "mcpServers": {
    "sympy": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://api.sympy.ai/mcp/",
        "--header",
        "X-API-Key: mv_xxxxxxxx..."
      ]
    }
  }
}

Restart Claude Desktop; the sympy.ai tools appear in the tools menu.

Cursor

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (project). Cursor supports HTTP MCP servers with headers directly:

json
{
  "mcpServers": {
    "sympy": {
      "url": "https://api.sympy.ai/mcp/",
      "headers": {
        "X-API-Key": "mv_xxxxxxxx..."
      }
    }
  }
}

If your Cursor version only supports stdio servers, use the mcp-remote bridge shown in the Claude Desktop section instead.

Quick verification

A raw handshake, no client required — 401 without a key, 200 with one:

bash
curl -si -X POST https://api.sympy.ai/mcp/ \
  -H "X-API-Key: $SYMPY_API_KEY" \
  -H 'Accept: application/json, text/event-stream' \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'

After a successful math_verify call, confirm your usage history shows a new row with source = mcp and the balance decremented.

Connect Claude Code, Claude Desktop, Cursor, and other MCP clients to sympy.ai's tools.