Skip to main content

chess-esca-mcp

An MCP server over esca: the rules of chess as JSON an agent can read.

FEN and moves go in; enums and the squares behind them come out. Whether a move is legal and why not, what a position's status is and what either side may claim, the named facts of the position, the ending the material makes and what theory says it is, the opening's ECO code, the moves an opening book holds, and PGN read and written. Every categorical answer also carries prose: the same thing in one plain English sentence, beside the enum rather than instead of it.

There is no engine here and no search. Nothing this server answers says how good a move is. For a number and a line, use chess-uci-mcp, which drives Stockfish or Leela; the two answer different questions and sit well side by side.

Dependencies

Python 3.12 or newer, and uv/uvx.

Usage

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

For Claude Desktop that is claude_desktop_config.json, under SettingsDeveloperEdit Config:

  • macOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

For Claude Code, the plugin does the wiring:

/plugin marketplace add AnglerfishChess/plugins
/plugin install chess-esca-mcp@anglerfish-chess

The server takes no arguments. It reads nothing but the position you hand it and, for book_moves, the book file you name.

Tools

Every tool takes the position the same way: fen (the start position when omitted), moves played from it — each written as SAN (Nf3) or as UCI (g1f3) — or a whole game as pgn instead. variant is classic or chess960. Repetition and fifty-move claims are only visible when the moves that led to the position are given, since a FEN does not carry them.

Tool Answers
position The whole state: side to move, check and its checkers, game status, automatic and claimable draws with their evidence, legal-move count, opening, material, both castlings of both colours with every obstacle, the en-passant offer, pins and skewers, and the ending where the material makes one.
legal_moves Every legal move in SAN and UCI, each with its role, victim, promotion, check and static exchange, and grouped as captures, checks, castling, promotions, en passant and quiet.
explain_move Whether one move is legal. If not, every reason at once, each with the squares it was read off. If so, what it changes, the position after it, and the draws it would open.
facts The named facts of the position, group by group, every value labelled by name and, where it differs between the sides, by colour. groups selects; placement and maps are left out unless asked for.
ending The ending the material makes: its signature, its class, what theory says the result is, the technique that gets it, and the pawn race, bishops and opposition it was read off.
opening The ECO code and name of the position, and the deepest named position the line reached.
book_moves The moves a Polyglot opening book holds for the position, with their weights.
pgn A PGN game read into headers, moves, comments, final position, opening and result.
to_pgn A list of moves written out as a PGN game.

An input that names no position, no move or no game comes back as {"error": {"kind": ..., "message": ..., "hint": ...}} — never a traceback.

One resource, esca://facts-catalogue, lists every fact group and every field it holds, with the type each carries and one sentence of what it means; esca generates it from the fact definitions themselves. One prompt, analyse-position, walks an agent through reading a position with these tools.

Opening books

No book is bundled. book_moves takes the path to a Polyglot .bin file of your own; the format is the common one, so a book written for any engine that reads Polyglot works. esca.polyglot has download(url, path) for fetching one, and a Builder that writes a book from PGN.

Development

The server is a second distribution inside the esca repository: the library at the root, this directory beside it. It takes esca from the crate next door while you work on it, and from PyPI once installed.

git clone https://github.com/AnglerfishChess/esca.git
cd esca/mcp

uv sync --all-groups     # builds the esca extension from ../ and installs it here
uv run --no-sync pytest
uvx ruff check . && uvx ruff format --check . && uvx pyrefly check

Run it from the checkout with uv run chess-esca-mcp.

The version is esca's own: one tag releases the library and this server together, and the esca== pin names that same version.

The MCP registry

registry.modelcontextprotocol.io is the index of public MCP servers. The listing is described by server.json, under the name io.github.AnglerfishChess/chess-esca-mcp; ownership of the PyPI package is proven by the mcp-name: marker near the top of this file, which becomes the package description PyPI serves. The registry reads it from the published artifact, so it counts only once a release carrying it reaches PyPI.

Related projects

  • esca — the library this serves.
  • chess-uci-mcp — the engine side: analysis and best moves from Stockfish or Leela.

License

MIT — see LICENSE.

Download files

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

Source Distribution

chess_esca_mcp-0.4.0.tar.gz (32.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_esca_mcp-0.4.0-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file chess_esca_mcp-0.4.0.tar.gz.

File metadata

  • Download URL: chess_esca_mcp-0.4.0.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chess_esca_mcp-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3a016883c954a9c4c6c7d9f256b2c9178344ddf1bb76d9ec485ca978f2aee936
MD5 cf61230610e5396df198a3463217e037
BLAKE2b-256 a5c23ce6927d9a4e8d462d3dd77347d544e60d4cd3f35a908639d1e54c49f1af

See more details on using hashes here.

Provenance

The following attestation bundles were made for chess_esca_mcp-0.4.0.tar.gz:

Publisher: publish.yml on AnglerfishChess/esca

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chess_esca_mcp-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: chess_esca_mcp-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chess_esca_mcp-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2cc78944519e75568803b3256e9c2b25c7fe38458da22a414fdc24b31eb2017
MD5 620168eed3ce14bfd9117f7320cea0ee
BLAKE2b-256 adb43cf68171257de5df59039bbe943401b612d93e2bd8f235d27a74c60e0057

See more details on using hashes here.

Provenance

The following attestation bundles were made for chess_esca_mcp-0.4.0-py3-none-any.whl:

Publisher: publish.yml on AnglerfishChess/esca

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page