chess-coach-mcp

chess-coach-mcp

A hybrid AI chess coach MCP server that uses Stockfish for grounded evaluation and LLM for natural-language coaching, enabling game analysis, weakness diagnosis, and personalized drills from your own games.

Category
访问服务器

README

chess-coach-mcp

PyPI CI Python 3.11+ License: MIT

A hybrid AI chess coach exposed as an MCP server. A local Stockfish engine supplies grounded evaluations, mistake classifications and tactical motifs; your MCP host model (e.g. Claude) turns those facts into natural-language — Korean or English — coaching.

The engine knows what the best move is. The model explains why. This project wires the two together and adds the piece neither does alone: "here is your recurring mistake, drilled from your own games."

pip install chess-coach-mcp      # or: uvx chess-coach-mcp   (needs a local Stockfish)

See it in action

<p align="center"> <img src="https://raw.githubusercontent.com/parkseokjune/chess-coach-mcp/main/docs/demo.gif" alt="Demo: a blunder, the engine's preferred move, and the recurring pattern" width="420"> </p>

diagnose_weaknesses turns your recent games into a weakness report — recurring tactical blind spots and where you lose the most (by phase):

<p align="center"> <img src="https://raw.githubusercontent.com/parkseokjune/chess-coach-mcp/main/docs/weakness_report.png" alt="Weakness heatmap: tactical blind spots and average centipawn loss by phase" width="820"> </p>

…then recommend_drills hands back the exact positions you went wrong in — your move in red, the engine's in green — so you re-solve your own mistakes:

<p align="center"> <img src="https://raw.githubusercontent.com/parkseokjune/chess-coach-mcp/main/docs/board_example.png" alt="Annotated drill board: your move in red, the engine's move in green" width="340"> </p>

Numbers above are real Stockfish output; the weakness report uses an example dataset. Regenerate everything with uv run --with matplotlib --with pillow python docs/generate_assets.py.

Why this exists

Engines (Stockfish) tell you the best move but not the reason. Raw LLMs explain fluently but play/evaluate chess poorly and hallucinate lines. Existing trainers are fragmented (one app for stats, one for explanations, one for courses) and rarely give a personalised, guided path. chess-coach-mcp is the grounding layer: every claim the coach makes is backed by Stockfish, and the weakness diagnosis is computed from the player's actual games.

What it does

  • Fetch recent games from Lichess or Chess.com (public APIs, no key).
  • Analyse a game: per-move classification (best / good / inaccuracy / mistake / blunder, with Korean labels), win% before/after, centipawn loss, the engine's preferred move, tactical-motif tags, and per-phase summary.
  • Analyse a position (FEN): top engine lines in SAN, win%, material, and fork/pin flags — so the model can explain the why.
  • Diagnose weaknesses across many games: phase weaknesses (opening/middlegame/endgame), recurring tactical blind spots with example positions, leaky openings, a time-trouble proxy, and a ranked top-weakness list.
  • Recommend drills: re-solvable positions taken from the player's own blunders, ordered to target their top weaknesses, plus a Lichess daily puzzle warm-up.

What makes it different (차별점)

Most chess tools do one thing well, so you end up stitching several together. chess-coach-mcp is the missing grounding + personalisation layer, delivered right where you already work — inside your AI assistant.

chess-coach-mcp Stockfish alone DecodeChess Aimchess Chessable
Best move (what) ✅ ✅ ✅ ◐ –
Explains the why in prose ✅ ❌ ✅ ❌ –
Personal weakness diagnosis across your games ✅ ❌ ❌ ✅ ❌
Drills from your own blunders ✅ ❌ ❌ ◐ ❌
Korean (bilingual) coaching ✅ ❌ ❌ ❌ ❌
Local / private (your engine, no account) ✅ ✅ ❌ cloud ❌ cloud ❌ cloud
Lives inside your AI assistant (MCP) ✅ ❌ ❌ ❌ ❌
Cost free, OSS free subscription subscription paid courses

The five things that set it apart:

  1. Hybrid & grounded — Stockfish is the judge, the LLM is the explainer. Every coaching claim is backed by the engine, so there are no hallucinated evaluations or made-up lines (the failure mode of asking a raw LLM about chess).
  2. Personal, not generic — diagnose_weaknesses aggregates your games into phase weaknesses, recurring tactical blind spots and leaky openings; recommend_drills quizzes you on your own blunder positions — not random puzzles at your rating.
  3. Bilingual EN/KO — every structured fact carries a Korean label, so the coaching reads naturally in Korean (한국어 코칭).
  4. Local-first & private — your own Stockfish binary + public read-only APIs. No account, no API key, nothing about your games is uploaded anywhere.
  5. Inside your assistant — it's an MCP server, so coaching happens in the same chat you already use, composable with everything else your assistant can do.

Tools

Tool Purpose
engine_status Check the local Stockfish binary is available.
render_board(fen, orientation) Show a position as a text board + Lichess link (no engine).
fetch_recent_games(username, source, max_games, speed) List recent games (no analysis).
analyze_position(fen, depth, multipv) Evaluate one position; top lines + flags.
analyze_game(pgn, depth, user_color, max_plies) Full per-move game review.
diagnose_weaknesses(username, source, max_games, depth, speed) Cross-game weakness report.
recommend_drills(username, source, max_games, depth, num_drills, include_daily_puzzle) Personalised drill set.

source is lichess (default) or chesscom. Every numeric/categorical fact ships with a *_ko Korean label for natural Korean coaching. Positions in tool output also carry a board_ascii text board and a lichess_url, so the coach can draw the board right in the chat or link you to an interactive one.

Does a board show up in chat?

This is an MCP server: it returns data (FENs, evaluations, a board_ascii text board, a lichess_url), and your assistant turns that into coaching. So a graphical board doesn't pop up by itself — but the model can print the board_ascii board in any client, you can click the lichess_url for a real interactive board, and on claude.ai the model can draw an SVG board from the FEN. (The demo GIF above is a generated README asset, not the live chat UI.)

Requirements

  • Python ≥ 3.11
  • Stockfish on your PATH (or set STOCKFISH_PATH):
    • macOS: brew install stockfish
    • Debian/Ubuntu: apt install stockfish

Install & run

From PyPI:

pip install chess-coach-mcp
chess-coach-mcp               # run the MCP server over stdio
# …or run without installing:
uvx chess-coach-mcp

From source:

uv sync                      # install dependencies
uv run chess-coach-mcp       # run the MCP server over stdio

Register with Claude Code

claude mcp add chess-coach -- uv --directory /ABS/PATH/TO/chess-coach-mcp run chess-coach-mcp

Or add to an MCP client config:

{
  "mcpServers": {
    "chess-coach": {
      "command": "uv",
      "args": ["--directory", "/ABS/PATH/TO/chess-coach-mcp", "run", "chess-coach-mcp"],
      "env": { "STOCKFISH_PATH": "/opt/homebrew/bin/stockfish" }
    }
  }
}

Example coaching flow

"내 리체스 약점 좀 진단해줘. 아이디 myname."

The host calls diagnose_weaknesses("myname"), gets back per-phase ACPL, recurring motifs (e.g. hanging_piece ×4, missed_tactic ×3) with example FENs, then explains in Korean why those positions went wrong and calls recommend_drills("myname") to quiz the user on their own blunders.

Configuration (environment variables)

Variable Default Meaning
STOCKFISH_PATH autodetect Path to the Stockfish binary.
CHESS_COACH_ENGINE_THREADS 1 Engine threads.
CHESS_COACH_ENGINE_HASH_MB 128 Engine hash size (MB).
CHESS_COACH_POSITION_DEPTH 16 Default depth for analyze_position.
CHESS_COACH_GAME_DEPTH 14 Default depth for analyze_game.
CHESS_COACH_DIAGNOSE_DEPTH 12 Default depth for diagnosis (lower = faster).

How move classification works

Moves are classified by the drop in win percentage, not raw centipawns, using Lichess' logistic model — far more meaningful in already-winning or already-losing positions. A move is a blunder if it loses ≥20% win probability, a mistake at ≥10%, an inaccuracy at ≥5%. Mate-aware: a move that throws away a forced mate or walks into one is flagged accordingly.

Tactical motifs are heuristic labels (depth-1 static exchange for hanging pieces, geometric detection for forks/pins/back-rank). They exist to group engine-found mistakes into human themes, not to replace the engine's judgement.

Development

uv run pytest                       # unit + engine tests (skips engine tests if no Stockfish)
uv run python examples/mcp_smoke.py # boot the server over MCP and call tools
uv run python examples/live_check.py <lichess_username>  # live network E2E

Tests marked engine require a Stockfish binary; live tests (none by default) hit the network and are deselected unless you pass -m live.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选