Stockfish MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Stockfish MCP Server Analyze: r1bqkb1r/pppp1ppp/2n2n2/4p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Stockfish MCP Server
A local Model Context Protocol (MCP) server that exposes the Stockfish chess engine to any MCP client (Claude Desktop, Claude Code, Cline, Continue, your own client, …).
It speaks MCP over stdio. All tools are stateless — every call takes a FEN string, so the server holds no game state.
Tools
Tool | Purpose |
| Evaluate a position; returns score (White POV), best move, and principal variation(s). Supports |
| Pick a move for the side to move. Optional |
| Lighter/faster single-line evaluation. |
| Play a sequence of SAN/UCI moves and return the resulting FEN. |
| List all legal moves (SAN + UCI). |
| Render a position as a Unicode/ASCII board. |
| Engine name/version and default options. |
Every tool defaults to the standard starting position when fen is omitted.
Scores are from White's point of view; mate is reported as #±N.
Related MCP server: Chess MCP Server
Dependencies
Dependency | Version | Why |
Python | ≥ 3.14 | Runtime (see |
python-chess ( | ≥ 1.11.2 | Board logic + UCI engine driver. |
FastMCP ( | ≥ 3.4.2 | MCP server framework. |
Stockfish binary | 17/18+ | The engine itself. Not bundled (it is >100 MB); download it — see below. |
Python deps are declared in pyproject.toml and pinned in uv.lock.
uv is the recommended installer/runner, but plain
pip/venv works too.
Install
# 1. Get the code
git clone <this-repo-url>
cd stockfish-mcp-server
# 2. Get the Stockfish engine binary (NOT in git — too large).
# This downloads it to engine/stockfish:
./engine/download-stockfish.sh
# ...or set SF_ASSET to match your CPU/OS, e.g.:
# SF_ASSET=stockfish-ubuntu-x86-64-avx512 ./engine/download-stockfish.sh
# Browse builds: https://github.com/official-stockfish/Stockfish/releases/latest
# Already have Stockfish? Skip this and set STOCKFISH_PATH (see Configuration).
# 3a. Install dependencies with uv (recommended)
uv sync
# 3b. ...or with pip
python -m venv .venv && . .venv/bin/activate
pip install "chess>=1.11.2" "fastmcp>=3.4.2"Optional: install as a command
The project is packaged with a stockfish-mcp console-script entry point:
uv tool install . # puts `stockfish-mcp` on your PATH (~/.local/bin)
# or: pip install .Run
uv run python server.py # run the stdio server (uv)
# or, if installed as a command:
stockfish-mcpThe server communicates over stdio and is normally launched by your MCP client (below), not by hand. Stop it with Ctrl-C / SIGTERM.
Use it with an MCP client
MCP stdio clients launch the server as a subprocess. Point your client at either
uv run python /abs/path/to/server.py or the installed stockfish-mcp command,
and set STOCKFISH_PATH if the binary isn't at engine/stockfish.
A ready-to-edit example is in examples/mcp-config.json.
Generic MCP config (the shape most clients accept — e.g. a mcpServers map in
Claude Desktop's claude_desktop_config.json, or .mcp.json):
{
"mcpServers": {
"stockfish": {
"command": "uv",
"args": ["run", "python", "/abs/path/to/stockfish-mcp-server/server.py"],
"env": {
"STOCKFISH_PATH": "/abs/path/to/stockfish-mcp-server/engine/stockfish"
}
}
}
}If you installed the command (uv tool install .), use it directly:
{
"mcpServers": {
"stockfish": {
"command": "stockfish-mcp",
"env": { "STOCKFISH_PATH": "/abs/path/to/engine/stockfish" }
}
}
}Claude Code (CLI) — register in user scope so it's available everywhere:
claude mcp add stockfish -s user \
-e STOCKFISH_PATH=/abs/path/to/engine/stockfish \
-- stockfish-mcp
claude mcp list # should show: stockfish … ✔ ConnectedThen ask the model things like "analyze this FEN at depth 20" or "play a move against me at 1500 Elo."
Tip: launching the executable directly (the installed
stockfish-mcp, or the venv'spython) rather than via a wrapper makes the server the client's direct child process, so its shutdown signal handling works cleanly.
Configuration (environment variables)
Variable | Default | Meaning |
|
| Path to the Stockfish binary. |
|
| Search threads. |
|
| Transposition-table size (MB). |
Per-call search cost is capped (depth ≤ 30, movetime ≤ 60 s, multipv ≤ 10) so a single request can't stall the stdio loop.
Test
uv run python test_server.py # end-to-end smoke test via an in-memory MCP clientIt lists the tools and exercises analysis, mate detection, reduced-strength play, move application, and error handling — no external MCP client needed.
Files
server.py The MCP server (FastMCP + python-chess)
test_server.py End-to-end smoke test
pyproject.toml Package metadata + dependencies (entry point: stockfish-mcp)
uv.lock Pinned dependency versions
.python-version Python version (3.14)
engine/
download-stockfish.sh Fetches the engine binary (binary itself is gitignored)
LICENSE-stockfish.txt Stockfish license (GPLv3)References
Model Context Protocol — https://modelcontextprotocol.io
FastMCP — https://gofastmcp.com/
python-chess — https://python-chess.readthedocs.io/
Stockfish — https://stockfishchess.org/ · releases: https://github.com/official-stockfish/Stockfish/releases/latest
License
This server's code is provided as-is. Stockfish is licensed under GPLv3 — see
engine/LICENSE-stockfish.txt. If you redistribute the Stockfish binary, you must
comply with the GPLv3 (including providing source).
Available Tools
7 toolsanalyze_positionB
Analyze a chess position with Stockfish and return the evaluation and best lines.
Inputs: fen, depth, multipv, movetime_ms. Returns: object
apply_movesA
Apply a sequence of moves to a position and return the resulting FEN.
Useful for playing out a line without the server holding game state.
Inputs: moves (required), fen. Returns: object
engine_infoA
Return the Stockfish engine's name, author, and a few configurable options.
Inputs: no named parameters. Returns: object
evaluate_positionA
Quickly evaluate a position and return the score and best move.
A lighter, faster version of analyze_position (single line, shallower default depth). Score is from White's point of view.
Inputs: fen, depth. Returns: object
get_best_moveA
Pick a move for the side to move, optionally at reduced strength.
Inputs: elo, fen, depth, movetime_ms, +1 more. Returns: object
get_legal_movesA
List all legal moves in a position (SAN and UCI).
Inputs: fen. Returns: object
visualize_boardA
Render a position as a text board for human reading.
Inputs: fen, unicode. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
There is overlap between analyze_position, evaluate_position, and get_best_move, as all provide position evaluation or move suggestions. The descriptions attempt to differentiate them, but an agent may struggle to select the appropriate tool.
All tool names use snake_case and generally follow a verb_noun pattern, with verbs like get_, analyze_, evaluate_, and apply_. However, the mix of get_ with other verbs like analyze_ and evaluate_ introduces minor inconsistency.
With 7 tools, the server covers core chess analysis and interaction functions without unnecessary bloat. Each tool contributes to a clear purpose, and the count is ideal for the domain.
The tool set covers essential operations: analysis, move generation, board visualization, and applying moves. Minor gaps include lacking explicit start_position loading or customizable depth options, but the surface is sufficient for typical stateless analysis use cases.
Maintenance
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides an interactive chess game experience through MCP tools with a web-based chessboard interface. Enables users to play chess games, make moves using standard algebraic notation, and manage persistent game state across sessions.62 npm5Apache 2.0
- FlicenseAqualityDmaintenanceEnables chess gameplay and interaction through MCP protocol. Allows users to play chess games, make moves, and manage chess sessions through natural language commands.2-
- AlicenseNot gradedqualityBmaintenanceAn MCP bridge that provides an interface to UCI-compatible chess engines like Stockfish for analyzing positions and retrieving best moves. It enables users to interact with chess engines through commands for position management, engine information, and move calculation.3MIT
- FlicenseNot gradedqualityDmaintenanceEnables local Stockfish-powered chess game analysis, mistake classification, puzzle finding and generation, and study-resource recommendations through MCP tools.-