inkcheck
MCP server for AI agents to compile, playtest, and exhaustively explore ink interactive fiction stories, catching compile errors, runtime errors, unreachable content, and verifying story structure.
README
inkcheck
CI for ink stories. Compile checks, exhaustive branch playtesting, runtime-error repro paths, and dead-content detection — as an MCP server for AI coding agents and as a standalone CLI for your pipeline.
inkcheck is a QA tool, not a writing tool. It doesn't generate a word of prose. It exists so that the story you wrote can be verified the way code is: every branch compiled, every reachable path played, every dead end and broken divert caught before a player finds it.
What it catches
- Compile errors and warnings — broken diverts, unresolved variables, loose ends, with file and line numbers (via inklecate, the official compiler)
- Runtime errors with a reproduction path — the exact sequence of choices that triggers a divide-by-zero, a bad external call, or out-of-content, e.g.
repro: [Enter in darkness → Descend to the cellar] - Unreachable content — knots no explored path ever visits, so orphaned scenes don't ship silently
- Every distinct ending — with the choice trail that reaches it, so you know your five endings are actually five reachable endings
vs. the alternatives
| Catches syntax errors | Plays every branch | Finds unreachable content | Repro path for crashes | Runs in CI | |
|---|---|---|---|---|---|
inklecate (compiler) |
✓ | — | — | — | ✓ |
| Manual playtesting | — | only what you click | by luck | if you remember your clicks | — |
| inkcheck | ✓ | ✓ (bounded exhaustive) | ✓ | ✓ | ✓ |
The compiler tells you the story is valid. Clicking through tells you the paths you happened to click work. Neither tells you whether all five endings are reachable or which choice sequence crashes the runtime. inkcheck walks the graph for you and answers exactly those questions — deterministically, in CI.
Example
$ inkcheck examples/manor.ink
✓ compiled — 92 words, 7 knots, 6 choices
✓ explored 10 states — 5 distinct ending(s)
ending via [Enter in darkness → Search the study → Leave with your loot]: "You slip out the servant door, heavier by half a purse."
...
✗ 1 runtime error(s):
obj is null or undefined (at cellar.3)
repro: [Enter in darkness → Descend to the cellar]
⚠ 1 knot(s) never visited on any explored path:
treasure_vault (manor.ink:35)
Exit code is non-zero on compile or runtime errors (add --strict to also fail on warnings and unvisited knots), so it drops straight into CI.
Scale check: it explores 5,000 states of inkle's published game The Intercept (14,728 words, 343 choices) in ~5 seconds, surfacing 16 distinct endings — and, correctly, zero errors.
MCP server
Four tools for AI agents working on ink stories:
| Tool | What it does |
|---|---|
compile_story |
Structured compile issues (severity, file, line) |
story_stats |
Word/knot/choice counts + full knot list with locations |
playtest_story |
Play one scripted choice path headlessly; returns transcript, tags, variables, errors |
explore_story |
Bounded exhaustive walk: endings, error repro paths, knot coverage |
Add to Claude Code:
claude mcp add inkcheck -- npx -y inkcheck mcp
or to any MCP client config:
{
"mcpServers": {
"inkcheck": { "command": "npx", "args": ["-y", "inkcheck", "mcp"] }
}
}
The intended loop for an agent editing a story: edit .ink → compile_story → explore_story → fix what it reports → repeat. The agent never has to guess whether a story graph is sound.
CLI
inkcheck <story.ink> [--max-depth N] [--max-states N] [--no-min-repro] [--strict] [--json]
inkcheck mcp # start the MCP server on stdio
GitHub Actions:
- uses: actions/setup-node@v4
with: { node-version: 22 }
- run: npx -y inkcheck story/main.ink --strict
For agents
inkcheck is built to be driven by an AI coding agent, not just a human at a terminal.
- Machine-readable interface:
tool.jsonat the repo root describes the CLI flags, MCP tools, exit codes, and--jsonoutput shape in one file. --jsonemits the entire report as a single JSON object ({ compile, stats, explore }) on stdout — parse that instead of scraping the pretty output.- Deterministic exit codes:
0clean ·1compile/runtime errors (or, under--strict, warnings and unvisited knots) ·2usage error. Branch on the exit code; don't grep the text. - MCP:
claude mcp add inkcheck -- npx -y inkcheck mcpexposescompile_story,story_stats,playtest_story, andexplore_storyas tools. - The loop: edit
.ink→compile_story→explore_story→ fix what it reports → repeat. inkcheck is a deterministic oracle for a story graph you generated or edited — use it to verify your own work before returning it.
llms.txt at the repo root is a compact, model-friendly summary of all of the above.
How it works
- Compilation uses
inklecate, the canonical compiler — found via$INKLECATE_PATH, thenPATH, then auto-downloaded from the official ink release into~/.cache/inkcheckon first run. Stories are compiled with-cso all knot visits are counted. - Exploration runs the compiled story in inkjs (the official JS runtime port), walking the choice tree depth-first from a single pooled story instance (the compiled JSON is parsed once, states rewind via
LoadJson). States are deduplicated by content hash (ignoring turn counters and RNG seeds), which is what makes stories with loops terminate.INCLUDEs are followed;EXTERNALfunctions are auto-stubbed so exploration doesn't require a game engine. - A second breadth-first pass shortens error and ending repro paths to minimal choice trails where they're reachable within limits (skip with
--no-min-repro). - Bounds (
--max-depth,--max-states) keep worst-case combinatorics in check; the report says explicitly when it was truncated.
Roadmap
- Localization/tag lint (untagged lines, inconsistent tag schemas)
- State assertions ("gold must never go negative on any path")
- Yarn Spinner support via
ysc
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。