Documentation / Guides
Stockfish MCP server: setup and examples
Before your first request, sign in with Google, create a key for 100 free requests with a verified email, then add a card. Start with 100 free requests with a verified email, then add a card for 2,000 units/day and automatic overage billing. The trial is shared across your account, never resets, and is never charged. All prices are in USD.
Connect over HTTP, discover tools and analyze a FEN
Connect an MCP client
Use https://stockfishapi.com/mcp, not /v1/mcp. Configure a remote Streamable HTTP connection with an Authorization header containing Bearer followed by your API key. Keep the key in your client's secret settings or an environment variable, not a committed configuration file.
The endpoint accepts POST requests and responds with JSON. It is stateless: no MCP session ID is issued or required. Protocol version: 2025-03-26. GET and DELETE return 405; this endpoint does not provide an SSE subscription. Automatic MCP OAuth discovery and a downloadable skill package are not available. Use a client that supports custom Bearer headers. Agents and CLIs can obtain a scoped, expiring key through device login with one explicit account-owner approval, then use the returned access_token as the Bearer key.
Initialize and discover tools
Set STOCKFISH_API_KEY in your shell first. Initialization and tool discovery do not need a key, but tool calls do.
curl --fail-with-body -sS https://stockfishapi.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"chess-example","version":"1.0.0"}}}'
curl --fail-with-body -sS https://stockfishapi.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-03-26" \
-d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
curl --fail-with-body -sS https://stockfishapi.com/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-03-26" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
Initialization returns result.protocolVersion, result.capabilities and result.serverInfo. The initialized notification returns HTTP 202 with no body. Discovery returns four tools:
- evaluate_position: evaluation, best move and principal variations (eval key scope).
- best_move: best move and score (eval key scope).
- legal_moves: legal UCI moves (eval key scope).
- validate_position: validate a FEN (eval key scope).
Call a tool
curl --fail-with-body -sS https://stockfishapi.com/mcp \
-H "Authorization: Bearer $STOCKFISH_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-03-26" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"evaluate_position","arguments":{"fen":"r1bqkbnr/pppp1ppp/2n5/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 2 3","depth":10,"multipv":1}}}'
The REST response is JSON encoded inside result.content[0].text. Parse that string to read bestmove, eval and pvs. Check both the top-level JSON-RPC error and result.isError: a failed tool call can return HTTP 200 with isError: true and a problem+json body encoded in text. HTTP success alone does not mean the engine succeeded.
MCP uses the same API key scopes, trial allowance, compute units, quotas and billing as REST. The first 100 successful billable requests are shared across the account, not a separate MCP allowance. Utility calls and cached results do not consume trial requests. See limits and pricing.
Game and batch analysis
MCP currently exposes position tools only. For PGN games, use POST /v1/analyze; for multiple FENs, use POST /v1/batch. Both return a job ID to poll with the same creating key. Job submission, polling and cancellation are not MCP tools.
For REST discovery, use llms.txt and OpenAPI.
Sign in to create a key. Free plan, depth 14, 2,000 units a day.