Borrowing it
Nothing to install: this file belongs to alegerber/stockfish-lc0-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/alegerber/stockfish-lc0-mcp/main/AGENTS.mdgit clone --depth 1 https://github.com/alegerber/stockfish-lc0-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/alegerber/stockfish-lc0-mcp/agents-md)<a href="https://agentmods.dev/instructions/alegerber/stockfish-lc0-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/alegerber/stockfish-lc0-mcp/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/alegerber/stockfish-lc0-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/alegerber/stockfish-lc0-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.03296 | $0.03296 |
| Opus 5 | $0.01648 | $0.01648 |
| Sonnet 5 | $0.00659 | $0.00659 |
| Haiku 4.5 | $0.00330 | $0.00330 |
Grade A, and why
stockfish-lc0-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 205 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — Chess Engine MCP Server (Stockfish + Lc0)
Project Overview
MCP server wrapping UCI chess engines (Stockfish and Leela Chess Zero). Provides 8 tools for chess analysis over the Model Context Protocol stdio transport. Written in TypeScript (strict mode), runs on Node.js 22+ (CI-tested on LTS 22/24/26), deployed via Docker.
Both engines are enabled by default in Docker. Lc0 ships with the Maia-1900 neural network and uses the OpenBLAS CPU backend. Stockfish tools (sf_*) are always available. Lc0 tools (lc0_*) are conditionally registered when LC0_WEIGHTS_PATH is set (enabled by default in Docker).
Architecture
src/
├── index.ts # Entry point: MCP server setup, tool registration, lifecycle
├── types.ts # UciEngine interface, all TypeScript types, centipawns() helper
├── constants.ts # Thresholds, defaults, starting FEN, Lc0 depth-to-nodes map
├── schemas/
│ └── index.ts # Zod input schemas for all tools
├── services/
│ ├── engine.ts # BaseUciEngine, StockfishEngine, Lc0Engine (spawn, send, parse)
│ ├── chess-utils.ts # chess.js utilities: PGN parsing, FEN validation, opening book
│ └── formatting.ts # Markdown formatting for analysis output
└── tools/
├── analyse-position.ts # sf/lc0_analyse_position — single FEN analysis
├── analyse-game.ts # sf/lc0_analyse_game — full PGN move-by-move analysis
├── openings.ts # sf_lookup_opening, sf_identify_opening
└── puzzle.ts # sf/lc0_generate_puzzle — tactic puzzle generation
tests/
├── chess-utils.test.ts
├── formatting.test.ts
├── schemas.test.ts
├── constants.test.ts
├── types.test.ts
├── tools-openings.test.ts
├── tools-analyse-position.test.ts
├── tools-analyse-game.test.ts
└── tools-puzzle.test.ts
Key design decisions
- UciEngine interface: All tools accept a
UciEngineinterface, not a concrete engine class. This allows Stockfish and Lc0 tools to share the same tool implementations. - BaseUciEngine abstract class: Shared UCI protocol logic (process spawn,
sendAndWait, info line parsing) lives inBaseUciEngine. Subclasses (StockfishEngine,Lc0Engine) overrideconfigureOptions()andbuildGoCommand(). - Side-by-side tools: Stockfish (
sf_*) and Lc0 (lc0_*) tools are registered in parallel. Opening tools (sf_lookup_opening,sf_identify_opening) are engine-agnostic and shared. - Lc0 depth-to-nodes mapping: Lc0 uses MCTS, where "depth" means something fundamentally different from alpha-beta depth. The
depthparameter is mapped to node counts viaLC0_DEPTH_TO_NODESin constants.ts for consistent UX. - WDL parsing: The UCI info line parser extracts Lc0's native
wdl W D Ldata when present, stored inUciLine.wdl. - Engine as long-lived process: Each engine spawns one child process and reuses it across all tool calls. Commands are sent via UCI protocol over stdin/stdout.
- Dual output: Every tool returns both
content(Markdown text for display) andstructuredContent(JSON for programmatic use). - Eval perspective: Both engines report scores from the side-to-move's perspective. Code that compares evals across moves must negate when the side-to-move changes. This is the most bug-prone area.
- Win-probability accuracy model: Game analysis uses the Lichess win-probability formula (
1 / (1 + exp(-0.00368208 * cp))) to compute per-move accuracy. Note: this was calibrated for Stockfish evals; Lc0 accuracy percentages may differ in calibration. - Terminal positions: Checkmate/stalemate/draw positions are detected before engine analysis to avoid garbage evals.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 205 lines · 3,296 tokens per session scan A a15006841027
stockfish-lc0-mcp AGENTS.md is an instructions file published in the GitHub repository alegerber/stockfish-lc0-mcp (2 stars, last pushed 14d ago), licensed MIT. It adds 3,296 tokens to every session, about $0.0165 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
deepseek-harness AGENTS.md
AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.