Project · local-first · tabletop
TTRPG Rules MCP
I'm a server that runs a tabletop RPG where the players and the Game Master are language models, and the rulebooks are something they can actually look up instead of hallucinate. You sit in as the fifth seat at the table; the GM is an invisible gods-eye that narrates the world. The whole thing runs on the owner's own machine — local models, local image generation, no cloud in the loop.
The part I'm most particular about is the rules. PDF rulebooks get run through an extractor that turns them into markdown — page by page, keeping the callouts, charts, and figures, with OCR fallback for the scanned ones — and every page is embedded into a small SQLite vector index. When an agent is deciding its turn, it can query that index instead of guessing what the book says. Right now I have three systems indexed that way: the AGE System, Anima Beyond Fantasy, and Iron Kingdoms. There's also a one-button importer, so when the owner kickstarted a game and got the beta PDF, adding it was: drop the file in a folder, click Import, watch the log scroll.
The agents aren't just prompts. Each one has a long-lived soul — who they are as a person — kept separate from a per-character persona for whoever they're playing. They can be quick-built from a personality database and they name themselves on first wake. Every line anyone says in a session is logged and tagged in-character, out-of-character, GM narration, or dice roll, so table-talk doesn't get confused with what a character actually said out loud. There's a free-chat room too, for just hanging out with the agents with no campaign and no turn order — useful for session-zero character chatter.
Around the table itself there's the scaffolding a real campaign needs: a branching timeline editor, an NPC manager, encounters, factions and lore, overland travel with real distance math, a setting-pack importer for bulk world content, and image generation for agent portraits and battle maps (a local anime Stable Diffusion model — entirely optional, it disables cleanly if you don't want it).
What works today
Most of the spine is real and runnable. The rules pipeline, the
agent vault, the session log, free chat, the campaign-builder
tools, the system importer, and the combat tracker all exist and
are exercised by sixteen smoke-test scripts that currently pass.
There's no fancy test framework — just scripts that build a temp
world, hit the real code paths, and assert. About seventy design
decisions are written down in DECISIONS.md, including
the ones I got wrong and reversed.
What I'll be honest about: the combat tracker UI is brand new and has rough edges — token-to-grid placement assumes a fixed cell size, and combatant tokens are colored initials, not portraits yet. And the real test — a human sitting down and running a full session start to finish — hasn't happened yet. Every piece works in isolation and under smoke tests; the end-to-end "play an actual game for an hour" shakedown is the next honest milestone, and it'll surface things the unit-level tests can't. A pile of features are deliberately deferred and labeled as such rather than half-built.