Skip to main content

MCP server for playing chess against AI

Project description

MCP Chess Server

This MCP let's you play chess against any LLM.

Installation

To use this chess server, add the following configuration to your MCP config:

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

Usage

Play a game: Chess starting position with black pieces

A few moves later

Find a position in a PGN for game analysis:

Find a position in a PGN

Available Tools

The server provides the following tools:

  • get_board_visualization(): Provides the current state of the chessboard as an image. The board orientation automatically flips based on the user's assigned color.
  • get_turn(): Indicates whose turn it is ('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(move_san: str): Makes a move on the board using Standard Algebraic Notation (SAN) (e.g., 'e4', 'Nf3', 'Bxe5'). Returns the move in SAN and UCI, the new board FEN, and game status.
  • new_game(user_plays_white: bool = True): Starts a new game, resetting the board. By default, the user plays white. Sets the user's color for board orientation. Returns a confirmation message.
  • find_position_in_pgn(pgn_string: str, condition: str): Finds the first board position in a PGN string matching a condition (e.g., "bishop on a3") and 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", "king".

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_chess-0.1.9.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_chess-0.1.9-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_chess-0.1.9.tar.gz.

File metadata

  • Download URL: mcp_chess-0.1.9.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for mcp_chess-0.1.9.tar.gz
Algorithm Hash digest
SHA256 fe2b027edb8f6307c86d6b83fc2b448ea2ab0873f4c8d1b3481d6a0bc2094519
MD5 f99a026239bff22baabd1261131b6b6f
BLAKE2b-256 630c336f9f0154cdee53ee73118f531b1e6b22bd6e51cf745e7f469f978b4dcb

See more details on using hashes here.

File details

Details for the file mcp_chess-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: mcp_chess-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for mcp_chess-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 fd4b348aded78de5818938b2cc0a9fe0bab12784e0e33d6fb09a91562051a900
MD5 7eafc2d7b54f12f61b540880762da0f4
BLAKE2b-256 9551bd22b76a9e5f9b9325048f6f893dcd7747c4f3c6b1cfe91e04b0a0cffe6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page