Chess Coach MCP
Summary: This server gives an AI assistant tools to fetch chess games, analyze them with Stockfish, find mistakes, study openings, and troubleshoot the engine.
Fetch recent Lichess or Chess.com games for a username, including opponent, result, opening, and date.
Run full engine analysis of a game: per-move evaluations, labels, best lines, accuracy, error counts, and critical positions with FEN.
Find blunders/mistakes above a centipawn threshold, optionally limited to the coached player.
Get win/draw/loss opening statistics by player, platform, color, and opening family.
Check which chess engine is running, its location, and cache statistics.
Per the README, it also exposes recent-game/PGN resources and coaching prompts for last-game analysis and weekly reviews.
Fetches recent games and raw PGNs from Chess.com, enabling Stockfish analysis, blunder detection, opening statistics, and coaching reports for a userβs games.
Fetches recent games and raw PGNs from Lichess, enabling chess coaching workflows such as Stockfish analysis, blunder detection, opening statistics, and review of critical moments. Supports optional Lichess API token configuration for higher rate limits.
Click on "Deploy 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., "@Chess Coach MCP Coach me through my last game and explain my biggest mistake."
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 Coach MCP
An MCP server that turns any AI assistant into a chess coach
It fetches your games from Lichess or Chess.com, analyzes every move with Stockfish, and gives the AI the ground truth it needs to explain why you lost, in plain language.
Built by Deven Kalathiya
The coach's verdict: "The game was decided by one move: 18. Bf4. It hung the bishop and ignored the pawn on f3. 18. gxf3 was the safe move. Lesson: when a pawn lands next to your king, deal with it before anything else."
π The problem
Today's option | What's wrong |
β Chess.com Game Review | Limited free uses per day; the full version is paid |
β Lichess analysis | Free, but only shows numbers ( |
β Human coach | Explains properly, but expensive and needs scheduling |
Engines tell you what was wrong. Coaches tell you why. Only the expensive option explains it in words you can learn from.
Related MCP server: MCP Chess Server
π‘ The idea
Explaining chess in natural language is exactly what an LLM is good at. What it lacks is ground truth: it cannot calculate variations reliably. So the work is split:
Who | What | |
π Stockfish | runs locally, auto-downloaded | evaluates every position, finds the best move and line |
π This MCP server | Python, no hosting, no API keys | fetches the games, runs the engine, labels every move, returns clean JSON |
π€ The AI client | Claude Desktop, Cursor, Claude Code | reads the JSON and coaches: names the motif, says what to play, gives one lesson |
Users add one line to their client's config. No website, no account, no paid API: Lichess, Chess.com and Stockfish are all free.
π How it flows
flowchart LR
U([You]) -->|"coach my last game"| C[AI client<br/>Claude Desktop / Cursor]
C <-->|MCP over stdio| S
subgraph S[chess-coach-mcp]
direction TB
T[Tools<br/>get_recent_games Β· analyze_game<br/>find_blunders Β· get_opening_stats]
R[Resources<br/>chess://games/β¦ Β· chess://game/β¦/pgn]
P[Prompts<br/>coach_my_last_game Β· weekly_review]
CORE[Analysis core<br/>evaluate β centipawn loss β classify β cache]
T --> CORE
R --> CORE
P --> CORE
end
CORE -->|games| L[(Lichess API)]
CORE -->|archives| CC[(Chess.com API)]
CORE -->|UCI| SF[Stockfish]
CORE --> DB[(SQLite cache)]You pick Coach my last game in the client and type your username.
The AI calls
get_recent_games, thenanalyze_game. You see a progress bar while Stockfish works (about 10 to 40 seconds for a full game).The server returns every move's evaluation, a label (best / good / inaccuracy / mistake / blunder), the engine's best line, per-player accuracy, and the critical moments with their exact position (FEN).
The AI explains the three biggest mistakes and gives you one lesson. Follow-up questions ("what should I have played instead?") are instant because the report is cached.
π Read the complete worked example, start to finish, with the real tool calls and the real coaching answer. Read the idea, flow and UI write-up for the design.
π§° What the AI gets to use
All three MCP primitives, not just tool calling.
Tools
Tool | Input | Returns |
| username, platform (lichess / chesscom), count | game ids, opponent, your result, opening, date |
| game id or URL, username | per-move evals, labels, best lines, accuracy, critical moments with FEN |
| game id, username, threshold | only the moves that lost material, worst first |
| username, colour | win / draw / loss per opening, your weakest openings |
| which engine is running and cache statistics |
Resources
URI | Content |
| JSON list of recent games |
| raw PGN (platform guessed from the id) |
Prompts
Prompt | What it does |
| fetch + analyze your last game, explain the 3 biggest mistakes, one lesson |
| analyze the last 7 days, find the recurring patterns behind your losses |
π¬ How the analysis works
Centipawn loss | Label |
more than 300 | blunder |
100 to 300 | mistake |
50 to 100 | inaccuracy |
less than 50 | good / best |
Every position goes through Stockfish at depth 14, capped at half a second each.
Evaluations are clamped to Β±10 pawns, so "winning more slowly" in a crushed position is not a blunder.
Suspicious moves are re-checked at depth 18, so shallow false positives disappear.
Accuracy uses the Lichess formula. Games and reports are cached in SQLite, keyed by game, depth and engine.
If Stockfish cannot be downloaded, the server falls back to Lichess cloud evaluations and says so in the report.
π¬ Example conversations
You type | What happens |
"Coach me through my last game" | Fetches it, analyzes it, explains the 3 worst moves and gives one lesson |
"What should I have played on move 18?" | Answers from the cached report, with the engine's line |
"Which openings do I lose most with as Black?" |
|
"Give me a weekly review" | Analyzes every loss from the last 7 days and names the recurring motif |
"Show me another game where I hung a piece" | Scans recent games' blunders for the same pattern |
π Source code
This repository is a showcase of the project. The source code is kept private. If you'd like a live demo or a walkthrough of the code, feel free to reach out.
π§© Design decisions
The chess core has zero MCP imports. Tools, resources and prompts are thin wrappers over it, so the analysis is testable without an MCP client and reusable from a CLI or a web app.
Pluggable engine. Local Stockfish and the Lichess cloud fallback implement the same two-method protocol; tests use a deterministic fake, so the whole MCP surface is tested in-process in under 3 seconds.
Ground truth, not opinions. The server never explains anything. It returns numbers, labels and positions; the explaining is left to the model, which is what it is good at.
Errors the model can act on. Anticipated failures (unknown user, rate limit, missing engine) reach the AI as readable messages instead of a generic "tool failed".
Bounded time. Per-position time caps keep a 90-move game to about a minute instead of several.
π Roadmap
Motif tagging across games (hanging piece, fork, back-rank, time pressure), puzzle suggestions from the Lichess puzzle database matched to your weak motifs, and opening repertoire advice from the Lichess opening explorer.
π οΈ Tech
Python 3.11+ Β· official mcp SDK 2.x Β· python-chess Β· httpx Β· SQLite Β· Stockfish 19 Β· pytest + ruff Β·
GitHub Actions on Linux, Windows and macOS
Available Tools
5 toolsanalyze_gameARead-only
Run a full engine analysis of one game and classify every move.
Returns evaluation before/after each move, centipawn loss, a label (best/good/inaccuracy/mistake/blunder), the engine's best move and line, per-player accuracy and error counts, and the five most critical moments with their FEN so you can explain why a move was bad. Results are cached, so repeat calls are instant.
Args: game_id: Game id or URL from Lichess or Chess.com (as returned by get_recent_games). platform: "lichess" or "chesscom". Guessed from the id when omitted. username: The player to coach. Required for Chess.com games that were not fetched via get_recent_games; otherwise optional (adds user_color/user_result). depth: Engine search depth (default 14; 18+ is slower but more precise).
Inputs: game_id (required), depth, platform, username. Returns: object
engine_statusARead-only
Report which chess engine the server is using (local Stockfish or Lichess cloud fallback), where it lives, and cache statistics. Useful for troubleshooting.
Inputs: no named parameters. Returns: object
find_blundersARead-only
Return only the moves that lost at least threshold centipawns, with the position
(FEN), the engine's best move and the best line, sorted from worst to least bad.
Cheaper to read than analyze_game when you only need the mistakes.
Args:
game_id: Game id or URL from Lichess or Chess.com.
platform: "lichess" or "chesscom". Guessed from the id when omitted.
username: The player to coach; required for uncached Chess.com games.
threshold: Minimum centipawn loss to include (100 = mistakes and blunders).
only_user: If true, return only the mistakes made by username.
Inputs: game_id (required), platform, username, only_user, +1 more. Returns: object
get_opening_statsARead-only
Win/draw/loss record per opening over a player's recent games.
Helps spot openings the player struggles with. Each row carries the game ids so you can dig into a specific loss with find_blunders.
Args: username: The player's username. platform: "lichess" (default) or "chesscom". color: "white", "black" or "both" (default). count: How many recent games to look at (1-300). group_by_family: Group variations under their opening family (default true).
Inputs: username (required), color, count, platform, +1 more. Returns: object
get_recent_gamesARead-only
List a player's most recent games from Lichess or Chess.com.
Returns one entry per game with the game_id (use it with analyze_game / find_blunders), the opponent, the result from the player's point of view, the opening and the date. Games are cached locally so later tools can find them by id.
Args: username: The player's username on the chosen platform. platform: "lichess" (default) or "chesscom". count: How many games to return (1-100).
Inputs: username (required), count, platform. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 5 tools
Each tool has a clearly distinct role: fetching games, full game analysis, blunder-only extraction, engine diagnostics, and opening statistics. The overlap between analyze_game and find_blunders is explicitly framed as a cheaper subset, so selection is unambiguous.
Most tools follow a predictable verb_noun pattern (get_recent_games, analyze_game, find_blunders, get_opening_stats), but engine_status is a noun phrase without a verb. The deviation is minor and still readable.
Five tools is well-scoped for a chess coaching server, and each tool covers a distinct part of the workflow: game discovery, analysis, mistake extraction, opening review, and engine diagnostics.
The surface covers the core coaching workflow from fetching games through analysis and opening review. Minor gaps exist, such as no player profile/rating lookup or explicit opening recommendation tool, but agents can work around these.
Maintenance
Related MCP Connectors
Review your Chess.com and Lichess games with Stockfish on an interactive board, in plain words.
Chess MCP for Claude: engine analysis, attack maps, game review. One URL, no install.
Pedagogical chess intelligence for AI agents: explain positions and games for a target Elo.
Chess ratings explained, an Elo calculator, and any Chess.com or Lichess player's recent games.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables comprehensive chess analysis through Stockfish engine integration, positional evaluation, puzzle training, game review, and access to extensive chess databases. Provides visual board rendering, interactive game viewers, and tactical puzzle training with 3+ million problems from Lichess.34AGPL 3.0
- AlicenseBqualityDmaintenanceProvides Chess.com player data integration, enabling AI assistants to fetch real-time chess player profiles and comprehensive statistics including ratings, game counts, and performance metrics from Chess.com's public API.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to explore player profiles, ratings, game archives, leaderboards, clubs, and puzzles via the Chess.com API.2MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to perform professional-grade chess analysis using Stockfish and optionally Leela Chess Zero, including position analysis, full game review, opening lookup, and puzzle generation.9 npm2MIT