Chess MCP Server
This Chess MCP Server enables AI agents and LLMs to play chess interactively, providing game management, move execution, and real-time board visualization through the Model Context Protocol.
Create and manage chess games: Initialize games against computer AI (difficulty levels 1-10, from "Random Blunderer" to "Minimax Master") or other agents, specifying player color and UI preferences with automatic Game ID generation.
Join existing games: Connect to ongoing games using Game IDs to participate as a player.
Execute moves and turn-based gameplay: Submit moves in UCI format (e.g., e2e4), claim checkmate/win conditions, and use long-polling to wait for opponent moves (up to 30 seconds) with automatic timeout handling.
Real-time board visualization: View boards in Markdown format for text-based analysis or interactive HTML with drag-and-drop piece movement (when
showUiis enabled in supported MCP clients).Monitor via web dashboard: Access
http://localhost:8080to view all active games and spectator views.Flexible game modes: Support Human vs Computer, Agent vs Computer, Agent vs Agent, and Human vs Agent gameplay.
Tools API:
createGame(initialize sessions),joinGame(connect to existing games),finishTurn(submit moves), andwaitForNextTurn(receive opponent moves).Spatial understanding: Provide chess board context enabling LLMs to understand positions, legal moves, and strategic relationships between pieces.
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., "@Chess MCP Server Start a new chess game against you at level 5. You go first."
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.
โ๏ธ Chess MCP Server
Give your AI Agent eyes to see the board and hands to make the move.
This is not just a chess API. It's a Model Context Protocol (MCP) server designed to let Large Language Models (LLMs) like Claude play chess agentically.
Capable of visualizing the board in real-time HTML, understanding spatial relationships via Markdown, and challenging you with a hybrid difficulty engine (Levels 1-10)โor simply facilitating a game between you and your Agent.
๐ Features
MCP-UI Support: Interactive HTML board embedded directly in the chat (where supported).
Hybrid AI Engine: Adjustable difficulty from "Random Blunderer" (Level 1) to "Minimax Master" (Level 10).
Agent vs. Agent: Let two AI personalities battle it out.
Web Dashboard: Automatically launches a local sidecar dashboard (
http://localhost:8080) to monitor all active games.
Related MCP server: Chess MCP Server
๐งฐ Tools API
Tool | Description |
| Initializes a new chess game session against Computer or another Agent. |
| Joins an existing game using its Game ID. |
| Submits a move in UCI format and optionally claims a win. |
| Long-polling tool that waits for the opponent's move. |
For full specification, see docs/spec/tools.md.
๐ฆ Installation
Prerequisites
Python 3.10+
An MCP Client (e.g., Claude Desktop, Cursor)
1. Installation
You can install directly from PyPI:
pip install chess-mcp-server2. Configure MCP Client
Add the following to your MCP Client configuration file (e.g., ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"chess": {
"command": "uvx",
"args": ["chess-mcp-server"]
}
}
}Alternatively, using pip installation:
{
"mcpServers": {
"chess": {
"command": "python",
"args": ["-m", "src.mcp_server"]
}
}
}๐ ๏ธ Development
If you want to modify the code:
Clone & Setup
git clone https://github.com/fritzprix/chess-mcp-server.git cd chess-mcp-server python -m venv .venv source .venv/bin/activate pip install -e .
๐ฎ How to Play
Once the server is connected, you can ask your Agent to start a game.
Start a Game
Ask: "Start a new chess game against the computer at level 5."
The Agent calls
createGame.Pro Tip: You can also ask "I want to play against YOU. Create a game where you are White."
Join an Existing Game
If you have a Game ID (e.g., from another agent), you can ask: "Join game [Game_ID]".
The Agent calls
joinGame.
The Game Loop
Your Move:
Interact with the HTML Board if shown. Drag your piece and click Confirm.
Or tell the Agent: "Move pawn to e4."
Agent's Turn:
The Agent calls
waitForNextTurn.It sees the board (Markdown or HTML) and thinks about the move.
It calls
finishTurnto submit its move.
Checkmate:
If you deliver the final blow, you can check the "Claim Checkmate" box on the UI or tell the Agent "Checkmate!".
Dashboard
When the server starts, it will try to open http://localhost:8080. You can view the list of all active games and spectator views there.
Available Tools
4 toolscreateGameA
Initializes a new chess game session. Returns the Game ID and instructions.
Inputs: type (required), color, difficulty.
finishTurnA
Submits a move and returns the updated state or a precise failure.
Inputs: move (required), game_id (required), claim_win.
joinGameA
Joins an existing chess game. Returns the current board state and turn information.
Inputs: game_id (required).
waitForNextTurnA
Blocks until it is the Agent's turn (or User's turn via Agent proxy). Waits up to 30 seconds for the opponent to move.
Inputs: game_id (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 4 tools
Each tool has a distinct role: createGame starts a game, joinGame enters an existing game, waitForNextTurn blocks until the agent's turn, and finishTurn submits a move. There is no meaningful boundary overlap between these operations.
All tool names use the same imperative camelCase style and mostly follow a verb + object pattern: createGame, joinGame, waitForNextTurn, finishTurn. The naming is predictable and consistent across the set.
Four tools is well-scoped for a turn-based chess workflow: create, join, wait, and move. Each tool earns its place and there are no redundant tools.
The core chess lifecycle is covered: start or join a game, wait for a turn, submit a move, and get updated state. Minor optional gaps remain, such as resigning, listing active games, or an explicit get-board/status tool, but agents can work around these using the returned board state.
Maintenance
Related MCP Connectors
Play chess live against your own personal AI agent โ OpenClaw, Hermes, and similar.
Pedagogical chess intelligence for AI agents: explain positions and games for a target Elo.
Chess MCP for Claude: engine analysis, attack maps, game review. One URL, no install.
Open chess platform where AI agents register, get matched and play each other. Referee only.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server that enables users to play chess against any LLM, with features for visualizing the board, making moves in standard notation, and analyzing positions from PGN files.24Apache 2.0
- FlicenseBqualityDmaintenanceEnables AI assistants to play, analyze, and track chess games with full rule validation and support for standard algebraic notation. It provides tools for position evaluation and game state persistence during user sessions.2-
- FlicenseAqualityDmaintenanceEnables AI assistants to play chess against users, manage games, make moves, and visualize boards with Stockfish AI opponent.81-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to play and analyze chess, validate moves, and view a live synchronized visual board in the browser through MCP tools.MIT