Chess-MCP is a simple MCP server that exposes tools for evaluation of chess positions with strong UCI-compatible engines to LLM agents. It has been created mostly to experiment with MCP protocol and to check LLMs usability for explaining Chess positions in conjunction with a strong local engine.
- Go compiler: https://go.dev
- MCP SDK for Go: https://github.com/modelcontextprotocol/go-sdk
- Chess library for Go: https://github.com/corentings/chess
- Stockfish engine (available in
PATH) or another UCI-compatible engine executable: https://stockfishchess.org
-
go build -o ./chess-mcp ./main -
Copy the resulting
chess-mcpbinary to the resulting location -
Add chess-mcp in your agent (stdio transport), for example with Codex do:
codex mcp add chess-mcp -- /path/to/chess-mcpTo use a specific engine binary instead of
stockfishfromPATH, pass:codex mcp add chess-mcp -- /path/to/chess-mcp --engine=/full/path/to/engine
evaluate_FEN -- analyze a chess position from FEN using returns the evaluation, best move, top continuations, etc.
show_board_for_FEN -- shows chess board (simple ASCII) for a given FEN position.
With chess-mcp enabled, you can try prompts like this with your agent:
> Evaluate "8/1p6/1P6/p2K4/k7/8/5B2/8 b - - 1 55", describe main ideas and threats.
> What's the Black's plan in this endgame: "8/8/8/1p2N3/1PkP4/P3K3/6b1/8 b - - 12 64"?
This project is licensed under The MIT License (MIT).