Chess MCP server

Enables playing chess against language models through a visual interface with tools for board visualization, move execution, game initialization, and position analysis from PGN notation.
Back to servers
Setup instructions
Provider
Jiayao Li
Release date
May 04, 2025
Stats
13 stars

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.

Installation

To set up the chess server, add the following configuration to your MCP config file:

{
  "mcpServers": {
    "chess": {
      "command": "uvx",
      "args": [
        "mcp-chess"
      ]
    }
  }
}

Usage

Playing a Game

You can play chess games against an LLM using the available tools. The server automatically handles board visualization, turn management, and move validation.

Game Analysis

The server also supports analyzing chess games by finding specific positions in PGN (Portable Game Notation) format.

Available Tools

Board Visualization

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).

Check Current Turn

get_turn()

Returns whose turn it is to move ('white' or 'black').

Get Valid Moves

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 a Move

make_move(move_san: str)

Makes a move on the board using Standard Algebraic Notation (SAN). Examples include 'e4', 'Nf3', or 'Bxe5'.

Returns:

  • The move in both SAN and UCI notation
  • The new board position in FEN format
  • The current game status

Start a New Game

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

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".

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later