chesscom-mcp
Provides read-only access to public Chess.com data, including player profiles, statistics, online status, current daily games, game archives, monthly games and PGNs, titled player lists, and club profiles and members.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@chesscom-mcpWhat are the current stats for Magnus Carlsen?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Chess.com Personal MCP Server
A stateless, read-only MCP gateway for the public Chess.com Published Data API. It gives Codex or another trusted agent a small typed tool surface without storing Chess.com credentials, cookies, sessions, API keys, games, or query history.
Agent -> authenticated HTTP on localhost -> MCP container -> HTTPS -> api.chess.com/pubThe primary transport is stateless Streamable HTTP with JSON responses. Local stdio is the default CLI transport. Remote Chess.com strings are returned as untrusted external data and are never treated as instructions or followed as URLs.
Tools
Tool | Purpose |
| Public player profile |
| Public player statistics |
| Current online status |
| Paginated current Daily games |
| Validated |
| Paginated monthly games without embedded PGN |
| Segmented monthly PGN text |
| Paginated titled-player names |
| Public club profile |
| Paginated club members |
All endpoints and the upstream hostname are constructed internally. There is no tool accepting a URL, host, endpoint, filesystem path, or command.
Related MCP server: agentforge
Native installation
Python packages must be installed only in a virtual environment. Python 3.12 or newer is required.
python3.12 -m venv .venv
.venv/bin/python -m pip install --require-hashes -r requirements.txt
.venv/bin/python -m pip install --require-hashes -r requirements-build.txt
.venv/bin/python -m pip install --no-deps --no-build-isolation -e .Run the local stdio server:
.venv/bin/chess-com-mcpFor direct HTTP on loopback, generate a token and set the required exact Host value:
MCP_TOKEN="$(.venv/bin/python -c 'import secrets; print(secrets.token_urlsafe(32))')"
export MCP_TOKEN
export CHESS_COM_MCP_AUTH_TOKENS="$(.venv/bin/python -c 'import json,os; print(json.dumps({"codex-local": os.environ["MCP_TOKEN"]}))')"
export CHESS_COM_MCP_ALLOWED_HOSTS=127.0.0.1:8765
.venv/bin/chess-com-mcp --transport httpThe raw HTTP listener has no TLS. Keep it on loopback unless a trusted TLS reverse proxy protects it.
Configuration
Variable | Default | Rules |
|
|
|
|
| IPv4 or IPv6 literal only; hostnames and interface names are rejected |
|
|
|
| unset | HTTP requires a nonempty JSON map; each unpadded base64url token must decode to at least 32 bytes |
| unset | HTTP requires comma-separated exact Host header values; no wildcard |
| unset | Optional comma-separated exact |
|
|
|
|
| Decoded upstream response ceiling, |
|
|
|
Agent names may contain ASCII letters, digits, _, and -, with length 1..50. Tokens must be unique. Every
configured agent has the same read-only permissions. Tokens are accepted only in the Authorization: Bearer ... header
and every /mcp request is authenticated. /healthz is intentionally unauthenticated and always returns
{"status":"ok"}.
Binding to 0.0.0.0, ::, or any other non-loopback address emits a warning because the internal listener is plaintext
HTTP. HTTP startup fails closed when either authentication tokens or the Host allowlist is absent.
Docker image
Build the digest-pinned, multi-stage image locally:
docker build -t chess-com-mcp:local .The final image runs as UID/GID 10001, contains only runtime dependencies, removes Python and operating-system package
managers, and defaults to chess-com-mcp --transport http. Override the command to use stdio or other supported CLI
arguments.
Docker Compose on localhost
Generate a bearer token and supply its agent map from the invoking shell; do not commit it to a file:
MCP_TOKEN="$(.venv/bin/python -c 'import secrets; print(secrets.token_urlsafe(32))')"
export MCP_TOKEN
export CHESS_COM_MCP_AUTH_TOKENS="$(.venv/bin/python -c 'import json,os; print(json.dumps({"codex-local": os.environ["MCP_TOKEN"]}))')"
docker compose up --build -dThe supplied docker-compose.yml starts only chess-com-mcp. The process binds 0.0.0.0:8765 inside the container,
while Docker publishes it only to 127.0.0.1:8765 on the host. The MCP endpoint is therefore
http://127.0.0.1:8765/mcp; it is not reachable from other LAN devices. Bearer authentication remains mandatory because
the connection is unencrypted HTTP. Reverse proxies and TLS termination are infrastructure concerns and can be supplied
separately according to the user's environment.
The application constructs requests only below https://api.chess.com/pub, uses GET, verifies TLS, ignores proxy
environment variables, refuses redirects, and bounds concurrency, retries, time, and decoded bytes. If the Docker host
needs a network-level outbound allowlist in addition to this application boundary, enforce TCP 443 access to Chess.com's
API at the host firewall or egress gateway.
Codex configuration
Export the token on the Codex device under a dedicated environment variable, then add the server to
~/.codex/config.toml:
export CHESS_COM_MCP_TOKEN='the-token-for-this-agent'[mcp_servers.chess_com]
url = "http://127.0.0.1:8765/mcp"
bearer_token_env_var = "CHESS_COM_MCP_TOKEN"
required = trueRestart Codex after changing its environment or MCP configuration. This follows the official Codex MCP configuration. Never put the token in the URL, TOML file, command-line arguments, cookies, or source control.
For local stdio instead:
[mcp_servers.chess_com_local]
command = "/absolute/path/to/chesscom-mcp/.venv/bin/chess-com-mcp"Rotation and revocation
Generate a different random token for each agent. To rotate one agent, replace only that map entry in the host environment and recreate the MCP container. To revoke an agent, remove its entry and recreate the container:
docker compose up -d --force-recreate chess-com-mcpTreat the environment of the Docker host and Codex process as secret-bearing. Avoid .env files, shell history, logs,
screenshots, and process arguments that disclose tokens.
Development and verification
Install development tooling in the same project virtual environment:
.venv/bin/python -m pip install --require-hashes -r requirements-dev.txt
.venv/bin/python -m pip install --no-deps --no-build-isolation -e .Run the offline checks:
.venv/bin/ruff format --check src tests # Verifies source and test files follow Ruff formatting without modifying them.
.venv/bin/ruff check src tests # Checks source and test files for linting errors and unsafe patterns.
.venv/bin/mypy src # Statically checks type annotations in the source code.
PYTHONPATH=src .venv/bin/pytest --cov=chess_com_mcp --cov-report=term-missing # Runs tests and reports coverage, including untested lines.
.venv/bin/pip-audit -r requirements.txt # Checks production dependencies for known security vulnerabilities.The live Chess.com smoke test is opt-in and performs a real public API request:
CHESS_COM_MCP_RUN_INTEGRATION=1 PYTHONPATH=src .venv/bin/pytest -m live tests/test_integration.pyContinuous integration
GitHub Actions runs workflow validation, formatting, linting, strict type checking, package building, dependency
auditing, unit tests, offline integration tests, a native HTTP end-to-end test, and a Docker Compose HTTP smoke test for
every pull request and push to main. It also enforces the 90% coverage threshold, writes a coverage table to the
workflow summary, and uploads XML, HTML, and JUnit reports for 14 days. The live Chess.com test runs after pushes to
main, every Monday, or manually.
In the GitHub branch-protection rules for main, mark the CI quality, unit, integration, coverage, end-to-end, and
smoke jobs as required before merging. Keep the live integration workflow post-merge because it intentionally depends on
an external service.
Regenerate lock files only from the virtual environment after intentionally updating the corresponding .in file:
.venv/bin/pip-compile --generate-hashes --resolver=backtracking --output-file=requirements.txt requirements.in
.venv/bin/pip-compile --generate-hashes --allow-unsafe --resolver=backtracking --output-file=requirements-build.txt requirements-build.in
.venv/bin/pip-compile --generate-hashes --allow-unsafe --resolver=backtracking --output-file=requirements-dev.txt requirements-dev.inExpected upstream failures become safe structured MCP errors. Successful results use a stable ok, source,
untrusted_external_data, data, and optional pagination envelope. The server does not cache, persist, or log returned
Chess.com content.
License
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for AgentFolio — the identity and reputation layer for AI agents. Query agent profiles, trust scores, verification status, and marketplace listings through 8 MCP tools.9971MIT
- FlicenseAqualityFmaintenanceMCP server that exposes 300+ AI agents as tools via a single API key. Supports listing agents, invoking any agent with chat-completion style messages, checking agent health, and retrieving platform statistics.53
- Flicense-qualityCmaintenanceRead-only MCP server for the GitHub REST API that enables agents to query repositories, issues, files, and users without any write access.
- Alicense-qualityCmaintenanceA read-only MCP server for AI agents to access Nostr profiles, notes, search, and relay lists through user-chosen relays, without requiring an account or keys.MIT
Related MCP Connectors
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
BGG MCP provides access to the BoardGameGeek API through the Model Context Protocol, enabling retr…
Free public MCP for AI agents — 193 tools, 44 workflows. No API key.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/arVahedi/chesscom-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server