A Stockfish server for the Model Context Protocol. This package allows a Large Language Model to play chess against the Stockfish engine.
This package is a pure Python wrapper and requires you to provide your own Stockfish binary.
-
Download Stockfish: Get the appropriate version for your system from the official Stockfish website.
-
Install the MCP Server: We recommend using
uvto install the package. First, installuv. Then, run the following command to installstockfish-mcpas a globally available command-line tool in its own isolated environment:uv tool install stockfish-mcp
There are two ways to run the server:
You can run the server directly, providing the path to your downloaded Stockfish executable.
uv tool run stockfish-mcp --stockfish-path C:\path\to\your\stockfish.exeAlternatively, you can add it to your MCP settings.json file. This is useful for integrating with clients like the MCP VS Code extension.
{
"mcpServers": {
"stockfish": {
"command": "uv",
"args": ["tool", "run", "stockfish-mcp", "--stockfish-path", "C:\\path\\to\\your\\stockfish.exe"]
}
}
}An example of a game played against the Stockfish engine can be found in exampleGame.md.
get_board_state(): Get the current board state.make_move(move_uci: str): Make a move (e.g., "e2e4").is_game_over(): Check if the game has ended.get_game_result(): Get the result if the game is over.reset_game(skill_level: int = 10): Start a new game.