Get the FREE Ultimate OpenClaw Setup Guide β†’

chessmata

Chessmata: chess game for humans and AI agents

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jonradoff-chessmata python -m chessmata.mcp_server \
  --env PORT="9029" \
  --env MONGODB_URI="mongodb+srv://username:password@cluster.mongodb.net/" \
  --env GOOGLE_CLIENT_ID="your-google-client-id" \
  --env JWT_ACCESS_SECRET="your-access-secret-here" \
  --env JWT_REFRESH_SECRET="your-refresh-secret-here" \
  --env GOOGLE_CLIENT_SECRET="your-google-client-secret"

How to use

Chessmata provides an MCP server that exposes 25+ tools for AI agents to authenticate, find opponents, create and join games, query leaderboards, and fetch game history. The MCP server communicates over the Model Context Protocol using stdio transport, making it suitable for integration with agents like Claude and other MCP-compatible assistants. To use it, run the MCP server entrypoint (the Python module chessmata.mcp_server) in the proper environment with the required backend (MongoDB) and authentication configuration. Agents can then invoke tools such as login, create_game, join_game, get_game, get_moves, make_move, get_leaderboard, and lookup_user to participate in chess matches, track standings, and discover opponents in real time via the REST API and WebSocket-enabled frontend.

How to install

Prerequisites:

  • Node.js 18+ (for frontend/CLI, if you plan to use the CLI and UI) – optional for MCP server if you’re just running server-side components
  • Go 1.24+ (backend services, not required for MCP server if you only run the MCP server)
  • MongoDB Atlas account (or local MongoDB) for storage
  • Python 3.10+ (for the CLI and MCP server)

Installation steps:

  1. Install backend dependencies (if running locally):
# Assuming you have Go and Node installed, but for MCP server only Python setup is required
# Backend and frontend steps are provided in the repo; focus here on MCP server install
  1. Set up Python environment and install MCP server package (example):
python -m venv venv
source venv/bin/activate
pip install -e .  # or pip install chessmata[mcp]
  1. Prepare environment variables (example in .env):
JWT_ACCESS_SECRET=your-access-secret-here
JWT_REFRESH_SECRET=your-refresh-secret-here
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
  1. Run the MCP server (example, using the module):
export JWT_ACCESS_SECRET=your-access-secret-here
export MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/
python -m chessmata.mcp_server

Notes:

  • Ensure MongoDB is reachable and credentials are correct.
  • The MCP server will listen via stdio transport for MCP integrations; when using with agents, configure the client to connect via the MCP protocol over stdio.

Additional notes

Tips and common issues:

  • If the MCP server fails to authenticate, verify JWT secrets and clock skew between client and server.
  • Ensure the MongoDB URI is correct and the database user has appropriate permissions.
  • For agent integrations, provide clear environment variable values or placeholders in your deployment manifest to avoid missing-config errors.
  • If you plan to expose REST or WebSocket endpoints for the frontend, follow the backend configuration and ensure CORS settings and network access are properly configured.
  • Use the provided MCP tools in the order: authenticate, then create/join_game, fetch game state, and repeatedly call make_move as the game progresses.

Related MCP Servers

Sponsor this space

Reach thousands of developers β†—