MCP Chess Server is a tool that lets you play chess against any Large Language Model (LLM). It provides an interactive chess experience with visualization, move validation, and game analysis features.
To set up the chess server, add the following configuration to your MCP config file:
{
"mcpServers": {
"chess": {
"command": "uvx",
"args": [
"mcp-chess"
]
}
}
}
You can play chess games against an LLM using the available tools. The server automatically handles board visualization, turn management, and move validation.
The server also supports analyzing chess games by finding specific positions in PGN (Portable Game Notation) format.
get_board_visualization()
Returns the current state of the chessboard as an image. The board orientation automatically adjusts based on your assigned color (white or black).
get_turn()
Returns whose turn it is to move ('white' or 'black').
get_valid_moves()
Returns a list of all legal moves for the current player in UCI notation (e.g., 'e2e4', 'g1f3'). If the game is over, it returns an empty list.
make_move(move_san: str)
Makes a move on the board using Standard Algebraic Notation (SAN). Examples include 'e4', 'Nf3', or 'Bxe5'.
Returns:
new_game(user_plays_white: bool = True)
Starts a new chess game and resets the board. By default, you play as white. This function also sets your color for board orientation purposes and returns a confirmation message.
find_position_in_pgn(pgn_string: str, condition: str)
Searches through a PGN game record to find the first board position matching your specified condition. Returns an image of that board state.
The condition format is "piece_type on square_name". Valid piece types are "pawn", "knight", "bishop", "rook", "queen", and "king". For example: "bishop on a3" or "knight on c6".
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "chess" '{"command":"uvx","args":["mcp-chess"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"chess": {
"command": "uvx",
"args": [
"mcp-chess"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"chess": {
"command": "uvx",
"args": [
"mcp-chess"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect