Server data from the Official MCP Registry
Local chess web app and MCP server for humans vs LLMs and LLM vs LLM play.
About
Local chess web app and MCP server for humans vs LLMs and LLM vs LLM play.
Security Report
Valid MCP server (4 strong, 2 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry. Trust signals: 3 highly-trusted packages.
4 files analyzed · 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
Permissions Required
This plugin requests these system permissions. Most are normal for its category.
What You'll Need
Set these up before or after installing:
Environment variable: CHESS_MCP_DATA_DIR
Environment variable: CHESS_MCP_NO_ENGINE_DOWNLOAD
How to Install
Add this to your MCP configuration file:
{
"mcpServers": {
"chess-mcp": {
"command": "npx",
"args": [
"-y",
"@t145/chess-mcp@1.0.1"
],
"env": {
"CHESS_MCP_DATA_DIR": "your-chess-mcp-data-dir-here",
"CHESS_MCP_NO_ENGINE_DOWNLOAD": "your-chess-mcp-no-engine-download-here"
}
}
}
}Some servers take additional arguments. See the repository for details.
Documentation
View on GitHubFrom the project's GitHub README.
chess-mcp
A local chess web app and MCP server for humans vs LLMs and LLM vs LLM games.
- One command, no checkout:
npx -y @t145/chess-mcp --stdiostarts the web app and the MCP server in one process and opens the lobby in your browser. - Open a board in the browser, play moves, watch games update live.
- Create a local account with a username and password so your identity follows you across games.
- Invite any MCP-capable agent (Cline, Claude Code, etc.) into the other seat with one copy-paste prompt.
- Agents reach the same game state over Streamable HTTP (
/mcp) or stdio (--stdio); both transports share one store with the browser. - Two agents can play each other while you spectate in real time.
- Seat two local bots against each other and watch the game unfold, then review it like any other.
- Finished games get a Stockfish review: accuracy, move labels, and an eval bar.
- Everything runs on
127.0.0.1; there is no cloud dependency and no remote account service.
Requirements
- Node.js 22+ (Node 24 recommended; required by
better-sqlite313). This is the only requirement for thenpxquick start below. - pnpm 11+ — only when running from a checkout.
Quick start
One command, no checkout
npx -y @t145/chess-mcp@1.0.0 --stdio
That single process starts the web app, serves the game MCP tools on
stdin/stdout, and opens the lobby at http://127.0.0.1:6464/. Logs go to
stderr so stdout stays a clean MCP channel, and --no-open keeps the browser
closed. Any stdio-capable host can use the same command as its server definition:
{
"mcpServers": {
"chess": {
"command": "npx",
"args": ["-y", "@t145/chess-mcp@1.0.0", "--stdio"]
}
}
}
Drop --stdio and the package is just the web app
(npx -y @t145/chess-mcp), with agents connecting over Streamable HTTP at
/mcp — see MCP client configuration.
@t145/chess-mcpis published from this repository; the release and registry steps are in the release section.
From a checkout
pnpm install
pnpm dev
Open http://127.0.0.1:6464.
For a production-style run:
pnpm build
pnpm start
pnpm start serves the built React app, the REST API, the WebSocket, the MCP
endpoints, and — with --stdio — stdin/stdout, all from one process.
How the pieces fit
One chess-mcp process owns every game. The React app in web/ talks to it over
REST and WebSocket, agents talk to the same store over /mcp (Streamable HTTP)
or stdin/stdout (--stdio), and everyone sees the same boards and moves. The
Architecture section has the full picture.
CLI options
chess-mcp [options]
--port <number> Port to listen on (default: 6464, env: PORT)
--data-dir <dir> Directory for saved games, courses, the engine, and runtime assets (env: CHESS_MCP_DATA_DIR)
--engine <path> Use a local Stockfish binary (env: CHESS_MCP_ENGINE)
--engine-depth <n> Analysis depth per position (default: 14)
--no-engine-download Never download Stockfish, piece themes, or opening data automatically
--no-courses Disable the course-authoring MCP endpoint and course storage
--no-bots Do not seat bots or answer their moves
--stdio Also serve the game MCP tools on stdin/stdout (logs move to stderr)
--open Open the lobby in your browser on start (default with --stdio)
--no-open Never open a browser
--dev Serve the React app with Vite middleware (HMR, no build)
-h, --help Show help
The server always binds to 127.0.0.1. With --open — automatic under
--stdio — it opens the lobby in your default browser; otherwise open the
printed URL.
Saved games
Games are written after every change (create, join, move, draw, resign), so the
lobby is restored the next time the server starts. All application state lives
in one SQLite database at <data-dir>/chess-mcp.db:
gamesstores each game snapshot as a JSON document pluscreated_at/updated_at;reviewsstores review summaries, cascading when their game is deleted;accountsstores usernames, scrypt password parameters, and name/timestamps;sessionsstores SHA-256 session-token hashes with an expiry index;coursesstores validated course snapshots and status;course_progressstores per-learner step/quiz progress.
The database runs in WAL mode with foreign keys enabled. Downloaded assets live
beside it under engine/ (the managed Stockfish build and engine/bots/ for bot
engines and the Maia ONNX model), themes/, and openings/.
Default locations:
| Platform | Directory |
|---|---|
| Windows | %USERPROFILE%\Saved Games\chess-mcp |
| macOS | ~/Library/Application Support/chess-mcp |
| Linux | $XDG_DATA_HOME/chess-mcp (default ~/.local/share/chess-mcp) |
Override the location with --data-dir <path> or the CHESS_MCP_DATA_DIR
environment variable. Seat ownership survives restarts: only the SHA-256 hash
of each seat token is saved, and the original token keeps working. Deleting a
game removes its row (and its review). Accounts work the same way: only the
salted scrypt password hash is saved, and saved seats remember their profileId.
Accounts and sign-in
Accounts are local and password-protected. Create one from the sidebar profile
card (Sign in → Create account) or with the signup MCP tool. The same
card signs you out and opens the profile editor.
- Passwords are salted and hashed with scrypt on the server. The password itself is never stored, logged, or sent back to the browser.
- A successful signup/signin creates a 30-day session. The browser receives it
as an
HttpOnlycookie (chess_mcp_session); only the session token hash is stored in thesessionstable, so sessions survive a server restart and a browser restart. - Games created or joined while signed in store the account id on the seat. The browser does not need a per-game seat token: the session cookie is accepted by move/draw/resign/swap, and the same account is recognized in every game it plays.
- Usernames are unique and case-insensitive (3–24 characters: lowercase
letters, digits,
.,_,-). Passwords must be at least 8 characters. - Signing out deletes the server session and clears the cookie. Renaming the display name changes future seats; seats already claimed keep the name they were created with.
- The profile card in the sidebar shows an avatar: upload an image (up to
256 KB, stored inline as a data URL in the
accountsrow) or paste anhttp(s)URL. Accounts without a picture show the first letter of the display name.
MCP clients have no cookies, so signup/signin return a session token. Pass
it as profile_token to create_game/join_game, or directly as seat_token
in any game that account plays. The token is stored hashed and works until it
expires or signout ends it.
Piece themes
The sidebar Themes page switches the piece set on every board and remembers the
choice in localStorage. Default uses react-chessboard's built-in Cburnett pieces
(CC BY-SA 3.0, via Wikimedia Commons).
Theme management is centralized in src/shared/themes.ts, which defines the
built-in theme plus 51 runtime sets: 10 permissively licensed Lichess sets, 40
Chess.com sets, and Neo Angle. The picker loads /api/themes and polls while
the page is open, so server-managed sets appear as they become available.
All non-default sets are downloaded at runtime into
<data-dir>/themes/<theme-id>/ and served from /theme-assets/.... The download
starts with the server when automatic downloads are enabled and runs alongside
the Stockfish install hook. Passing --no-engine-download disables Stockfish,
theme, and opening-book downloads.
The Lichess sets use Apache-2.0, CC0-1.0, CC BY 4.0, CC BY-SA 4.0, or MIT; the
Chess.com and Neo Angle sets are local-only and labelled “All rights reserved”.
Each catalog entry carries its author, license, and source URL, which the picker
displays. Classic is excluded because it duplicates Default; Icy Sea is
excluded because its CDN files are white silhouette/mask images.
Play against an LLM
- Click New game.
- Sign in first from the sidebar profile card if you want the game linked to your account; otherwise enter a guest name. Pick White (or Black) and choose a time control (or No clock).
- On the game page, open Invite a player and copy the Agent prompt for the open seat.
- Give that prompt to an MCP-enabled agent that has the
chessserver configured. - Play in the browser. The agent blocks on
wait_for_move, receives your move, and replies. - The board, move list, draw offers, and result update over WebSocket for every spectator.
Joined the wrong colour? Click Swap colors on the game page (or on the lobby card) before the first move: both seats exchange, each player keeps their own seat token, and the PGN tags/board orientation follow automatically. Nothing needs recreating.
Time controls
Games can carry a clock, using the usual ranked presets:
| Category | Presets |
|---|---|
| Bullet | 1+0, 1+1, 2+1 |
| Blitz | 3+0, 3+2, 5+0 |
| Rapid | 10+0, 10+5, 15+10 |
| Daily | 1d, 3d, 7d |
Pass timeControl (REST) or time_control (MCP) with the preset id; omit it for an
untimed game. The clock is enforced on the server: the side to move is charged for its
thinking time, the increment is added after each move, and when a bank reaches zero the
game ends immediately with phase: "timeout", the opponent as winner, and a
1-0/0-1 PGN result. Both clocks are shown next to each player and printed in MCP
tool output. Daily presets behave as "N days per move": the bank is capped at the preset
so time never accumulates between moves. Clocks are saved with the game and resume with
the saved banks after a restart (downtime is not charged).
MCP client configuration
{
"mcpServers": {
"chess": {
"type": "streamableHttp",
"url": "http://127.0.0.1:6464/mcp"
},
"chess-courses": {
"type": "streamableHttp",
"url": "http://127.0.0.1:6464/mcp/courses"
}
}
}
The two servers share the same in-process state but expose disjoint tool
lists. /mcp contains only game tools; /mcp/courses contains only course
authoring/discovery tools. An agent that should play on its own merit can be
configured with /mcp alone, so it cannot discover or consult local lesson
material during a game. Only enable chess-courses for the agent that writes
courses.
For a strict game-only server, start with --no-courses (or
CHESS_MCP_NO_COURSES=1): /mcp/courses then returns 503, no course files are
read or written, and the process cannot serve lesson material at all.
The endpoint uses MCP Streamable HTTP (the current transport). MCP's old
standalone HTTP+SSE transport is not used. The browser's live updates use a
separate WebSocket at /ws.
The type field is required. Clients treat a URL-only entry ({"url": ...})
as the legacy SSE transport, open GET /mcp expecting an event stream, get
405 Method Not Allowed, and report the server as unavailable. Cline accepts
"type": "streamableHttp" (equivalently "http"); Claude Code and VS Code
call the same transport "http". Clients that default to a ~60s tool timeout
should raise it (for example "timeout": 150) because wait_for_move can
long-poll for up to 120 seconds.
One command: --stdio
Most hosts launch an MCP server as a child process and speak stdio to it. Adding
--stdio makes the same process serve the game MCP tools on stdin/stdout and
the web app on http://127.0.0.1:<port>, sharing one GameStore:
{
"mcpServers": {
"chess": {
"command": "npx",
"args": ["-y", "@t145/chess-mcp@1.0.0", "--stdio"]
}
}
}
In this mode every log line goes to stderr (stdout carries MCP frames), and
the lobby opens in your default browser as soon as the port is listening, so the
player never has to find the URL. --no-open (or CHESS_MCP_OPEN=0) suppresses
that; --open forces it for a normal --port run too.
The port must be free. Stdio mode owns the web app and the MCP tools in one
process, so a second process would mean a second copy of the state; start it with
--port <number> when 6464 is taken. The course-authoring server on
/mcp/courses stays HTTP-only.
Agent loop
Use the chess MCP server at http://127.0.0.1:6464/mcp.
Join game <id> as <seat> with a name of your choice, and keep the seat_token
returned by join_game. Then loop:
1. wait_for_move(game_id="<id>", seat_token="<token>")
2. if it is your turn, make_move(game_id="<id>", move="<SAN or UCI>",
seat_token="<token>", note="<your board check>")
Repeat until the game ends.
To keep one identity across several games, call signup once (or signin
later) and pass the returned session token as profile_token to every
create_game/join_game call, or directly as seat_token in any game that
account plays. The server keeps the session until it expires or signout ends it.
Move notes
make_move takes an optional note (up to 500 characters). It is stored with the move and
written into the PGN as a {comment}:
1. e4 {FEN rnbqkbnr/...; e4 is defended by nothing but no black piece attacks it yet; opens
d1-h5 and f1-b5} e5 2. Nf3 {develops, covers d4/e5}
Notes are private while the game is running. An agent only receives its own notes —
make_move echoes the note back, and get_game with your seat_token returns your notes as
Last move note: … and as PGN comments. The opponent's notes are withheld from
wait_for_move/get_game, and the web interface shows none at all. A hotseat game (both
seats open) has a single operator, so that operator reads all of its own notes. Once the game
ends every note becomes public, in the web move list and in the PGN.
Writing the check down before moving is the cheap part: it forces the FEN, the defenders and the lines the move opens into the sentence, which is exactly where hasty moves go wrong. Quote the FEN you are moving from, name the defender behind every "this is safe" claim, and when the move is a capture or a pawn move, name the squares it vacates plus any enemy slider that now sees through them. A note written from the board rather than from the previous plan is the point — if you cannot fill those in, re-read the board before moving. Agents should send a note on every move, even a short one.
Seat tokens are returned once by create_game/join_game. Keep them in the
conversation and pass them on every mutating tool call. In a hotseat game
(both seats open) tokens are not required.
Local bots (Maia-3 and engines)
Two ways to play a bot, both against the same GameStore the browser and MCP
agents use:
- Seat a bot when you create a game. The server owns the engine process and answers the bot's moves, so the game keeps going even if the tab is closed.
- Run an external bot.
pnpm bots playjoins a seat over the REST API like any other client.
The catalog ships one human-like model and four engines:
| Preset | Style | Strength | License |
|---|---|---|---|
maia3 | Human-like (Maia-3 79M ONNX) | relative 600–2600 | AGPL-3.0 |
4ku | Minimalist 4 KB engine | intermediate | MIT |
koivisto | Sharp, tactical NNUE | superhuman | GPL-3.0 |
stockfish | Universal reference engine | superhuman | GPL-3.0 |
lc0 | AlphaZero-style MCTS (Leela Chess Zero, BT4) | full strength; GPU when available | GPL-3.0 |
Seating a bot in the app
New game → Opponent: Bot shows the bot picker and, for Maia-3, the same rating ladder the Maia site offers (600, 800, 1000 … 2600). The seat is created with the game:
POST /api/games
{ "name": "Alice", "color": "white",
"bot": { "presetId": "maia3", "rating": 1600 } }
rating must be one of the preset's levels, seat defaults to the side you did
not take, and seed is optional. GET /api/bots lists the catalog with an
installed flag, and a bot that is not installed is rejected with the command
that installs it. --no-bots disables the driver and the API field entirely.
Watching a bot-vs-bot game
New game → Opponent: Bot vs bot gives each side its own engine picker (and,
for Maia-3, its own rating). The creator holds no seat: the response has
seat: null and token: null, so the game page opens in spectator mode with
live updates and no move controls. The server plays both sides, so the game
keeps moving even if the tab is closed. Use the same creation shape over REST:
POST /api/games
{ "name": "Spectator", "color": "none",
"bots": [
{ "presetId": "maia3", "rating": 1200, "seat": "white" },
{ "presetId": "stockfish", "seat": "black" }
] }
bots accepts one or two entries; each needs a seat, the seats must differ,
and color must be none. bots and the single bot field cannot be combined.
Each entry may also carry a seed, so any seat of a bot-vs-bot game can be
replayed exactly. Every seat gets its own engine session (for Maia, the loaded
ONNX model is still shared), so two different presets never share a process.
The ratings are relative, not official. Maia-3 is trained to predict the
moves of people near a rating; "Maia-3 1600" is a style and strength target, not
a measured Elo, and it never rates you. The picker says so, and the API returns
the same note in ratingNote.
Leela Chess Zero is the AlphaZero-style full-strength option. It always uses
the current BT4 policytune network (382 MB) with 5-second searches, the same
network the Lc0 project sends to engine competitions. The binary is chosen per
platform and installed by the same pnpm bots install command as the other bots:
- Windows + NVIDIA: the CUDA 12 build, with its CUDA libraries included
(about 555 MB). This is used automatically when
nvidia-smiis present. - Windows without NVIDIA: the Intel DNNL CPU build (about 23 MB), still running the full BT4 network.
- macOS: the official universal (Intel + Apple Silicon) v0.32.0 binary; the launcher prefers Metal when that build reports it and falls back to BLAS. v0.32.1 shipped no macOS asset, so this pins the last stable one.
- Linux: the
lc0already onPATH(use your package manager or build it from source).pnpm bots install lc0fetches the network and the launcher chooses CUDA, HIP, Metal, oneDNN, or BLAS from the backends that binary actually reports.
The selected variant is pinned by byte size and SHA-256 just like Stockfish, and the installer skips variants this host cannot run. Expect about 940 MB for the Windows NVIDIA install (CUDA build + network) and about 405 MB for the Windows CPU fallback. The CPU fallback runs the same BT4 network and is correspondingly slow; it exists so the preset still works without a supported GPU. A bot-vs-bot game loads the network once per seat, so leave GPU memory for that mode.
Seeds: no two bot games are scripted
Every bot seat stores a 31-bit seed with the game. It drives the opening-book
choice (which theory line the bot follows), Maia's move sampling (we sample the
masked policy with the seat's own RNG), and a small think-time jitter. Same seed
and position give the same move, so a game can be reproduced; a fresh seat gets a
fresh seed, so two games do not replay the same twelve moves. The seed stays
server-side: PublicGame exposes only the bot's name and relative rating.
Engine cache
Bots are engines, so their files live under the same cache root as the managed
Stockfish download, <data-dir>/engine/, and follow the same rules: pinned byte
size and SHA-256, verified before use, never bundled with the package.
<data-dir>/engine/
sf_19/stockfish.exe managed Stockfish
bots/4ku.exe pinned engine binaries
bots/koivisto.exe
bots/lc0-v0.32.1-windows-gpu-nvidia-cuda12/ Leela CUDA build (NVIDIA)
bots/lc0-v0.32.1-windows-cpu-dnnl/ Leela CPU build (no NVIDIA)
bots/lc0-v0.32.0-macos_12.6.1 Leela macOS universal binary
bots/BT4-1024x15x32h-swa-6147500-policytune-332.pb.gz full-strength network
bots/maia3_79m.onnx pinned ONNX model (299 MB)
bots/install.json
Maia-3 runs through ONNX Runtime, not Python. pnpm bots install maia3
downloads the pinned maia3_79m.onnx (a format conversion of the official
checkpoint), and the server drives it with maia3-js (MIT) on top of
onnxruntime-node, which is an optional dependency so a platform without a
prebuilt binary still runs everything else. There is no venv, no torch, and no
Python at install or play time. The 79M variant is the most accurate of the
family; expect it to take a few hundred milliseconds per move on a CPU. It
conditions on the last eight positions, taken from the game's own move list, and
the loaded ONNX model is shared by every bot seat instead of one copy per engine.
CLI
pnpm bots list
pnpm bots install # binaries + the pinned Maia ONNX model
pnpm bots play --bot maia3 --rating 1500 --create black
pnpm bots play --bot 4ku --game <id> --seat white --seed 42
pnpm bots play --bot lc0 --create black
pnpm bots match --white maia3 --rating-white 1100 --black maia3 --rating-black 1900 --games 10
play needs the app running and joins the same store as the browser and MCP
agents; match plays two bots in-process with chess.js and alternates colours.
Both accept --seed / --seed-white / --seed-black, so a ladder test is
reproducible:
Maia-3 1100 vs Maia-3 1900 (random seeds) -> 0-1, checkmate in 25 moves
the same two seeds twice -> identical 32-move game
--book-plies <n> overrides how long a bot follows the opening dataset, and
--engine <path> points a preset at a local build (for Maia, an alternate ONNX
file). The bots' UCI layer is separate from the review engine on purpose: it
supports arbitrary go commands (4ku rejects movetime), while Maia is an ONNX
graph rather than a UCI process, and a bot must never share a process with the
review, whose strength has to stay unaltered.
The ONNX pipeline was checked against the official PyTorch engine on sampled positions (opening, middlegame, tactical, endgame): 6/6 identical best moves at the same Elo, so the JavaScript tokenizer and policy decoding match upstream.
Opening courses (authoring)
Courses live beside games but are a separate aggregate: no seats, clock, or
result. The opening dataset is now exposed in two shapes: the existing
position-keyed book (for live/review book labels) and a catalog of named
lines (ECO, name, SAN moves) used to seed a course from real theory. Both come
from the same pinned download; the catalog is cached as
<data-dir>/openings/<tag>/catalog.tsv.
Courses are authored over the separate /mcp/courses endpoint:
| Tool | Purpose |
|---|---|
list_openings | Search the catalog by ECO code or name; each result shows the colour the opening is normally learned as. |
get_opening_line | Resolve an ECO/name to its SAN line and main perspective. |
analyze_position | Run Stockfish on a FEN (optionally after a SAN continuation) and return the evaluation from White's side, the best move in SAN, and the principal variation (1–3 lines, depth 6–24). Read-only; no game tools. |
create_course | Create a draft (optional opening, learner colour, title). The learner colour defaults to the opening's perspective (Black for the Caro-Kann) and can be overridden. Returns a course id and author token. |
add_lesson | Append a lesson: startFen, mainline moves, prompts per ply (steps), optional variations, optional side, and history. Every move is validated with chess.js. |
add_quiz | Append a move quiz (accepted SAN in a FEN) or choice quiz (2–8 options, one answer). Use wrongFeedback and per-option feedback to explain incorrect answers; feedbackByMove explains the specific moves a learner may try. |
update_quiz | Replace a quiz that already exists (same id) — for example to add feedbackByMove after a learner reported a confusing question. |
publish_course | Mark the course ready; requires at least one lesson. |
set_course_history | Replace the course-level historical context shown in the History tab. |
get_course / list_courses | Read the summary and full JSON. |
validate_course | Non-fatal gaps: no lessons/quizzes, missing explanations, steps asking about the opponent’s move, custom start positions. |
Authoring loop for an agent:
Use the chess course MCP server at http://127.0.0.1:6464/mcp/courses.
Read the course context first: it lists the complete game line and, per key
moment, the move played, what it cost, and the engine best move. The point of a
game-seeded course is to learn what should have been played, so replay that
literal line in the lesson mainlines (every ply, mistakes included) and branch
variations from the positions the game actually reached — played move, engine
best, or a named theory line — with a comment saying who gains what.
Then teach the opening itself: list_openings/get_opening_line and add the catalog
main line plus the sidelines the game never tested. Use analyze_position to check
a claim before you write it (what a move was worth, what the best move was, how a
branch evaluates) instead of asserting an evaluation from memory. Use
lesson.history and set_course_history, and set lesson.side or variation.side when
a line is best studied from the other colour. A mid-game lesson may start from a
game FEN; validate_course reports that as a custom position, which is expected.
Add move and choice quizzes with add_quiz: accept every move you would mark
correct, and explain plausible-but-inferior tries in `feedbackByMove` (SAN ->
text) instead of a `wrongFeedback` that guesses the learner's move. Give each
wrong choice option its own `feedback`. Call validate_course, then publish_course
with the author token. update_quiz repairs a published question in place.
A course created from a finished game stores the complete SAN move list in its description (not the annotated PGN, whose per-move notes used to push the last plies past the 4,000-character cap). The key moments list the engine's best move alongside the one played, so the author can branch at the real decision points rather than guessing where the game went wrong.
Algebraic notation
Every move an author writes is parsed as SAN and stored in canonical SAN:
lesson moves, variation moves, step expected moves, quiz accepted moves,
and feedbackByMove keys. Castling may be written 0-0/0-0-0, and annotation
marks (e4!, Nf3?!) are dropped; chess.js supplies the check/mate suffix, so a
move that gives check is stored as Qb3+ and mate as Rxc1#. Coordinate input
(e2e4) is rejected on authoring calls with a pointer to SAN, since the stored
course text has to read as algebraic notation.
Learners and live play are the deliberate exception: step attempts, quiz
answers, and make_move accept SAN, UCI, or a from/to object, and every
result is graded and stored in SAN. Game PGN, reviews, move lists, and
analyze_position output are all SAN as well.
The web picker and create_course both default side to the opening's main
perspective: named defenses and Black gambits (Caro-Kann, Sicilian, Benko) are
learned as Black, while openings such as the Ruy Lopez or Italian Game are
learned as White. That inference looks at the family name before any variation
colon, so "Ruy Lopez: Morphy Defense" stays a White course. Black gambits that
live inside a White family are listed by name instead, because their family
keyword cannot see them: the Rousseau Gambit is an "Italian Game" line, but
Black offers the f-pawn with 3...f5, so it is learned as Black. Pass side
explicitly to learn the other colour.
The picker opens in Main openings mode, which searches only family-level names such as "Queen's Gambit" or "Caro-Kann Defense" and hides named sidelines. Switching to All variations restores the advanced ECO/name search over the complete catalog. When the opening field is left empty, the dialog shows its "Learn as" selector so a free-form course can still be authored for either colour; selecting a catalog opening hides the selector and infers the side.
Courses are stored in the SQLite courses table as validated JSON snapshots and
reloaded at startup. Only the SHA-256 hash of the author token is stored.
Agent-authored content is bounded and validated: illegal SAN, bad FENs,
duplicate ids, unknown lesson references, and oversized collections are
rejected; text is sanitised and capped.
The course-authoring endpoint intentionally has no game tools (make_move,
wait_for_move, get_game, etc.), and the game endpoint has no course tools.
A playing agent therefore cannot read local lesson material mid-game.
Learning a course in the browser
- Open Classroom in the retractable sidebar and click New course (or use the sidebar's New menu).
- Enter your name, choose White or Black, and search the opening catalog by name or ECO code. Leaving the opening empty creates a free-form course.
- Create course opens
/course/<id>. While the course is a draft, the page shows a copyable author prompt and stores the author token in this browser. - Give the prompt to an agent configured with
chess-courses. Itsadd_lessonandadd_quizcalls appear live on the page through the WebSocket; no reload. - When the course is ready, the agent calls
publish_course(or the creator can press Publish in the draft banner, which uses the stored token).
On the course page:
- The board shows the current lesson position. When a step is prompted, play the move on the board. Accepted moves advance the mainline and the coach replies automatically; rejected moves snap back with feedback (and an optional hint arrow). The hint button sits under the side panel with previous/next lesson controls; its tooltip explains that it shows the move on the board.
- Lessons may set their own
side, so a Black course can default to Black's perspective and switch to White for an aggressive line. Without an override the board uses the course's learner colour; Flip is still there. - Steps lists every prompt with a checkmark when completed; click one to replay from that ply.
- Questions appear inline at the end of a lesson and unlock only after every
step is complete; quizzes without a
lessonIdappear after the final lesson as a course review. Move quizzes are answered on the board, multiple-choice answers are graded in the panel, and the result (the correct explanation, or the author's feedback for a wrong option) appears inside the answered question. The correct option/answer is highlighted, and a move answer stays on the board with its from/to squares lit so you can see exactly which move was graded. Try another move returns the board to the question position. - History shows per-lesson historical context and the course-level history.
The author provides lesson history in
add_lessonand course history withset_course_history.
Progress is stored per learner in the SQLite course_progress table.
A stable learner id lives in localStorage, so the same browser resumes where it
left off; the selected lesson and ply are also remembered locally. Attempts are
idempotent for steps and counted for quizzes. Classroom cards show Start
course, then Continue once the course has any completed step or quiz
attempt. Deleting a course (the trash icon on the course page) removes its
progress as well.
Game review
When a game ends, the server analyses every position with Stockfish and stores a
review alongside the game. Open the Review tab on the game page (or call the
review_game MCP tool) to see:
- accuracy for both players, plus counts of book / brilliant / great / best / excellent / good / inaccuracy / mistake / miss / blunder moves;
- the opening name and ECO code when the game followed known theory;
- an evaluation graph and a vertical eval bar to the left of the board;
- move badges plus the complete annotated move list; click any move (or use the navigation buttons) to step through the game on the board, with the clock as it stood after that move. The board highlights the played move in the badge's colour, pins the badge to the destination square's top-right corner, and draws a Chess.com-style green arrow for the engine's recommended move.
Engine setup
The server looks for Stockfish in this order:
--engine <path>orCHESS_MCP_ENGINE;stockfishonPATH;- common install folders (
/usr/games,/usr/bin,/usr/local/bin,/opt/homebrew/bin,%LOCALAPPDATA%\Stockfish,Program Files\Stockfish); - a previously downloaded binary in
<data-dir>/engine/sf_19/.
If nothing is found, the server automatically downloads the official
Stockfish 19 release from GitHub on first boot (about 80 MB, universal binary
that detects AVX2/AVX-512 etc. itself). Downloads are pinned to the release asset
name, byte size, and SHA-256 digest, verified before the binary is extracted and
run. The install is background work: the web app and MCP endpoint start
immediately, and review jobs queue until the engine is ready. Pass
--no-engine-download to disable Stockfish, theme, and opening-book downloads,
and use --engine for a local build.
The engine is GPL-3.0 software and is not bundled in the npm package: it is fetched from the official release (or supplied by you) into your data directory. The project itself stays Apache-2.0.
Analysis uses depth 14 and MultiPV 2 by default, one review at a time. Labels are heuristic (win-probability loss, only-move detection, and a material-sacrifice check for brilliant moves) rather than a clone of Chess.com's proprietary algorithm. A miss is a non-best move that lets a winning advantage slip while the mover stays clearly better, or that loses a forced mate / delays a quick mate by several plies without giving up the win.
Opening book
Moves that follow known opening theory are labelled Book (the brown book badge), and the game shows the opening name and ECO code while it is still in theory. Detection runs without the engine, so the Moves tab shows it during play and the Review tab repeats it for finished games.
The data is a pinned snapshot of
lichess-org/chess-openings
(CC0-1.0): 3,865 lines folded into 7,982 position-keyed entries. It is
downloaded on first boot into <data-dir>/openings/<tag>/ as five TSV files,
each pinned by byte size and SHA-256 in src/openings/release.ts and verified
before use. The derived position index (book.tsv) is cached beside them, so
later boots read one file instead of replaying the lines. pnpm openings:check
re-downloads the dataset into a temporary directory and spot-checks the Ruy
Lopez.
A game is "in book" only while every ply so far is in the dataset, starting from the standard initial position. Positions are matched by FEN (move counters ignored), so transpositions work, and the name shown is the deepest named position reached. Games started from a custom FEN are never labelled. Like the move labels, this is a dataset lookup rather than Chess.com's proprietary opening book.
Book moves are displayed like any other classified move: the from/to squares are tinted in the book colour and the brown badge sits on the destination square. When a move leaves theory, the board draws a brown "book move" arrow at the continuation the dataset considers main (it prefers a named continuation, then the branch with the most follow-up theory, since ECO data has no move frequencies). That arrow replaces the green engine arrow on that ply.
The ECO code next to the opening name is a discreet link (dotted underline) to the Lichess analysis board at the last book position. Its opening explorer is built from the same dataset, so it lists the position's continuations, results, and games; nothing is requested until you click it.
Reviews are cached, so a review saved before the dataset existed would keep its
old labels. Opening labels are therefore refreshed lazily when a cached review is
opened — book moves keep the engine's verdict in baseQuality, so re-labelling
never needs another Stockfish run. pnpm reviews:relabel does the same for every
saved review at once.
The move labels in the web app use Chess.com's published 18×18 classification
badge SVGs, mirrored from
https://www.chess.com/bundles/web/images/color-icons/ into
web/public/badges/ so reviews render without a network connection. All 12
classification assets are included — the eleven used by the app (book, brilliant,
great find, best, excellent, good, inaccuracy, mistake, miss, blunder, forced) plus
the unused missed-win. The UI falls back to its own glyph if an asset is
missing. Badge artwork remains Chess.com's, is not covered by this project's
Apache-2.0 license, and is bundled for local use only.
MCP tools
The game endpoint is /mcp; course authoring tools live separately on
/mcp/courses (see Opening courses).
| Tool | Purpose |
|---|---|
signup | Create an account (username, password, optional name). Returns a profile id and a session token. |
signin | Sign in with username/password and return a session token. |
signout | End a session token. |
get_profile | Read a profile by profile_id or session token, with every game where it holds a seat. |
create_game | Create a game and claim white, black, or no seat (none), with an optional time_control preset and optional session profile_token. Returns a game id and seat token. |
join_game | Claim an open seat, optionally as an account via profile_token. Returns a seat token. |
list_games | List active games with players, turn, status, and last move. |
get_game | Full state: ASCII board, FEN, PGN, seats, turn/check/result, legal moves. Pass seat_token to include your own move notes. |
make_move | Play SAN (Nf3, O-O, e8=Q) or UCI (e2e4, e7e8q). Optional note records your board check privately until the game ends. Enforces turn and seat token. |
wait_for_move | Pass your seat token: returns immediately when it is your turn, otherwise long-polls until the opponent moves, the game ends, or a timeout (1–120s) expires. |
draw | offer, accept, or decline a draw. |
resign | Resign. |
review_game | Analyze a finished game with Stockfish and return accuracy, move labels, and key moments. Waits briefly for the engine download/analysis. |
Game state includes a text board, so an agent can play without extra round trips:
Game 3f9c2a1b
White: Alice (human)
Black: Claude (llm)
Status: Black to move.
Last move: e4 (e2e4)
+------------------------+
8 | r n b q k b n r |
7 | p p p p . p p p |
...
a b c d e f g h
FEN: ...
Legal moves (20): a6, a5, ...
HTTP API (used by the web app)
Mutating game routes accept the account session cookie in place of token.
Guest games still use the per-game seat token returned by create/join.
Documentation truncated — see the full README on GitHub.
Reviews
No reviews yet
Be the first to review this server!
More Developer Tools MCP Servers
Rea
Freeby Morluto · Developer Tools
Reverse engineer anything from your terminal or agent with one CLI and MCP server.
Paperclip
Freeby Paperclipai · Developer Tools
Trending hip-hop artist momentum scores across four cultural dimensions.
Scrapling
Freeby D4Vinci · Developer Tools
Web scraping with stealth HTTP, real browsers, and Cloudflare bypass. CSS selectors supported.
Server Time
Freeby Modelcontextprotocol · Developer Tools
Current time lookup and conversion between IANA timezones
Toleno
Freeby Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
MCP Marketplace
Freeby mcp-marketplace · Developer Tools
Search and install MCP servers from inside your AI client.
