The game as a local MCP server: play, inspect and debug it from an AI client

scripts/mcp.js speaks MCP over stdio and loads the game from src/ in jsdom,
seeded, like the tests. Tools: new_game, load_save, export_save, status,
advance (with per-day timings), network, city, find, traceroute,
peering_check, hot_spots, actions, act, screen, panel, click, open_link.
Actions go through ACT as buttons do; files, slots, settings and the clock
stay out of reach, and nothing evaluates code in the page. Nothing is
hosted and the page is unchanged. See docs/MCP.md.
This commit is contained in:
Frederic Jung 2026-11-01 18:04:22 +00:00
parent 935c08839f
commit 37def9dd6b
No known key found for this signature in database
9 changed files with 733 additions and 1 deletions

View file

@ -18,7 +18,8 @@
"dev": "node scripts/dev.js",
"page": "node scripts/lib/page.js",
"serve": "npm run build && npx --yes serve@14.2.4 _site",
"perf": "node scripts/perf-bench.js"
"perf": "node scripts/perf-bench.js",
"mcp": "node scripts/mcp.js"
},
"engines": {
"node": ">=20"