home / mcp / mcp chess server

MCP Chess Server

MCP server for playing chess against AI

Installation
Add the following to your MCP client configuration file.

Configuration

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

You can play chess against any large language model through an MCP server that exposes a chess board, legal moves, and move execution. This setup lets you start a game, request board states, review positions from PGN, and analyze moves with your preferred LLM integrations.

How to use

Launch an MCP client and connect to the chess MCP server you configured. You can start a new game so you play white by default, or choose to let the server assign colors. Use the available tools to inspect the board, check whose turn it is, list legal moves, and make moves using SAN notation. You can also search a PGN for a specific position to analyze a board state.

How to install

Prerequisites: Ensure you have the MCP runtime available and the uvx command is accessible on your system. You will also need access to your MCP configuration workflow where you can add or modify MCP server connections.

Add the following MCP server configuration to your MCP setup to enable the chess server.

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

Additional notes

The chess MCP server provides a set of tools to interact with the game state. Use get_board_visualization() to see the current board as an image, get_turn() to know whose move it is, get_valid_moves() to list legal moves in UCI notation, make_move(move_san) to play a move, new_game(user_plays_white) to reset and start a new game, and find_position_in_pgn(pgn_string, condition) to locate a board position within a PGN string.

Usage examples

Start a new game with you playing white, then request the current board image and legal moves, and finally make a move by SAN, for example: SAN move like e4.

Security and reliability

Keep the MCP configuration secure and restrict access to the MCP client that can issue game commands. Do not expose SAN moves or PGN data to untrusted clients. Regularly restart the chess server during maintenance windows to ensure clean state and correct board rendering.

Available tools

get_board_visualization

Provides the current state of the chessboard as an image. The board orientation flips based on your assigned color.

get_turn

Indicates whose turn it is, either 'white' or 'black'.

get_valid_moves

Lists all legal moves for the current player in UCI notation (e.g., 'e2e4', 'g1f3'). Returns an empty list if the game is over.

make_move

Executes a move on the board using Standard Algebraic Notation (SAN) and returns the move in SAN and UCI, the new board FEN, and game status.

new_game

Starts a new game, resetting the board. By default, you play white and can set your color preference. Returns a confirmation message.

find_position_in_pgn

Finds the first board position in a PGN string matching a condition like 'bishop on a3' and returns an image of that board state.