Skip to main content

A Model Context Protocol (MCP) server for playing Chess with AI Agents.

Project description

♟️ 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.

📦 Installation

Prerequisites

1. Installation

You can install directly from PyPI:

pip install chess-mcp-server

2. 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:

  1. 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 -r requirements.txt
    

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

The Game Loop

  1. Your Move:
    • Interact with the HTML Board if shown. Drag your piece and click Confirm.
    • Or tell the Agent: "Move pawn to e4."
  2. Agent's Turn:
    • The Agent calls waitForNextTurn.
    • It sees the board (Markdown or HTML) and thinks about the move.
    • It calls finishTurn to submit its move.
  3. 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.

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

chess_mcp_server-0.1.0.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

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

chess_mcp_server-0.1.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file chess_mcp_server-0.1.0.tar.gz.

File metadata

  • Download URL: chess_mcp_server-0.1.0.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for chess_mcp_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9578e78aef004f7fdf80af4e1e96f79dd78ec5d34d5770ec2ad9df265259e25d
MD5 222de0fb09fb239021bc59965a4a5346
BLAKE2b-256 d2fe61b876ef8c9a89d948756c192dd4e509f6dae5f1cbf99ed76b8c7def9168

See more details on using hashes here.

File details

Details for the file chess_mcp_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chess_mcp_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7116a04d77fb2f57e3de3cfd6fef7c0f355ca3c4bb3846953e991e85e26937e
MD5 272b55457786427447e926dc1df00c0b
BLAKE2b-256 b2084ad64fcd399a14a6ba93909ceee685d31cc185cde51d8ee12f3063467268

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