home / mcp / chess mcp server

Chess MCP Server

Provides a chess environment with legal-move validation and Stockfish-driven AI moves via MCP over stdio.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "11hritik11-chess-mcp": {
      "command": "python",
      "args": [
        "-m",
        "chess_mcp"
      ],
      "env": {
        "STOCKFISH_PATH": "YOUR_STOCKFISH_PATH"
      }
    }
  }
}

You run a Chess MCP Server that exposes a chess-playing environment backed by the Stockfish engine. It validates every move according to chess rules, uses Stockfish to compute AI moves, and communicates with your MCP clients via JSON-RPC over stdio while maintaining multiple active games in memory.

How to use

Start a new game from the initial position and obtain a unique game identifier along with the current board and all legal moves. You can then apply human moves in UCI format (for example, e2e4) to that game, or request Stockfish to play the next move for the side to move. The server ensures every move is legal and updates the board state for you and your client.

How to install

Prerequisites: Python 3.x and a working Python environment.

Install the Chess MCP package.

pip install chess-mcp

Install Stockfish for your platform.

# Windows
# Download from Stockfish official sources and place the executable in a known path

# macOS
brew install stockfish

# Linux
sudo apt install stockfish

Configure the environment to point to the Stockfish executable and start the server.

export STOCKFISH_PATH=/path/to/stockfish

python -m chess_mcp

Additional notes

The server runs as a local, in-memory MCP server that can handle multiple concurrent games. It exposes three main tools to your MCP clients: creating a new game, applying a human move, and requesting an engine move.

Available tools

new_game

Starts a new chess game from the standard initial position. Returns a unique game_id, the current FEN, and the list of legal moves in UCI format.

make_move

Applies a human move to the specified game using a UCI-formatted move. Returns whether the move was accepted, the updated FEN, and the updated list of legal moves.

engine_move

Asks Stockfish to compute and play one move for the side to move. Returns the engine's move in UCI format, the new FEN, and the updated list of legal moves.

Chess MCP Server - 11hritik11/chess-mcp