5e Quint
D&D 5e SRD 5.2.1 game engine: create characters and run turn-based battles through MCP, backed by Quint formal models, rule-level proofs, and model-based testing.
Install
The installation steps are in the documentation below. Documentation
Documentation
From the project's README on GitHub, refreshed weekly. Links open on GitHub.
D&D 5e Rules SDK
An executable, formally specified implementation of D&D 5e SRD 5.2.1 rules for character creation, progression, character sheets, and combat.
Supports every SRD class and its abilities through level 10, within the documented runtime and table-adjudication boundaries.
The shipped SRD catalog contains only SRD 5.2.1 content. Closed-license content is not included; the architecture separates authored content from reusable rule procedures so that separately supplied closed-license content can build on the same foundation. The current public catalog builders accept SRD collections; additional mechanics must pass the owning runtime's admission boundary or receive new procedure support. See content architecture.
How it works
Rules have formal models in Quint and are executed by TypeScript reducers.
The engine tells your application what it needs next: character choices, available Battle Acts, or a missing input such as a target or roll result. When a rule depends on a player choice or table observation, the runtime returns a question to fill. Answering one question can reveal the next.
The core runtime does not roll dice or infer battlefield geometry. Callers provide those facts as witnesses through the API.
A required input is a Hole; its answer is a Fill. In Battle, callers discover Acts, select one, and answer the questions needed to resolve it. See the creation workflow and Battle protocol.
Use it
Use the SDK as the rules engine for a game, a character builder, or tools for running encounters. Your application supplies player decisions and table facts; the runtime applies supported mechanics and returns the next state and inputs. Work toward implementations in other languages is in progress through the conformance tooling, with language-neutral contracts, formal models, and conformance tools. Availability in arbitrary languages is a goal, not a shipped SDK promise.
The MCP server exposes these workflows to an agent, including Play Sessions that can recover across HTTP server restarts. For example, an illustrative interaction during an existing battle:
Player: What can my fighter do?
Agent: You can attack with your weapon. Which target?
Player: The goblin. I'll roll at the table.
Agent: Tell me the attack result.
Player: 17.
Agent: That hits. What did you roll for damage?
Player: 8.
Agent: The hit deals 8 damage. Here is what you can do next.
The agent discovers Acts and answers the runtime's questions through tools; the particular choices and outcomes depend on the battle state. See MCP usage for the tool-level flow. For a browser view, run the character creation UI and battle visualizer.
npm packages
The SDK and stdio MCP distribution targets are @dearlordylord/dnd-sdk and
@dearlordylord/dnd-mcp. See distribution and release instructions
for package builds, verification, publication, and registry-status checks;
release notes identify unreleased changes.
Consumer instructions: SDK and MCP.
SDK example
Programmatic usage
Conceptual pseudocode; the public API exposes each discovery and fill step:
let creation = beginCharacter();
creation = fill(creation, {
class: "fighter",
background: "soldier",
species: "human",
size: "medium",
humanSkill: "perception",
originFeat: "alert",
fighterSkills: ["acrobatics", "survival"],
fightingStyle: "defense",
});
const fighter1 = finishCharacter(creation);
const fighter2 = levelUp(fighter1);
const fighter3 = levelUp(fighter2, { subclass: "champion" });
const fighterSheet = createCharacterSheet(fighter3);
const encounter = startBattle(fighterSheet, srd.monsters.goblinWarrior, {
witnesses: { fighterInitiative: 17, goblinInitiative: 12 },
});
let battle = encounter.battle;
const fighter = encounter.character;
const goblin = encounter.opponent;
battle = attack(battle, {
target: goblin,
witnesses: { distance: 5, attackRoll: 17, damageRoll: 8 },
});
battle = takeDamage(battle, {
target: fighter,
witnesses: { damage: 7 },
});
battle = secondWind(battle, {
witnesses: { healingRoll: 6 },
});
battle = actionSurge(battle);
battle = attack(battle, {
target: goblin,
witnesses: { distance: 5, attackRoll: 16, damageRoll: 7 },
});
const fighterAfterBattle = handoff(battle, fighterSheet);
Inspect the content
Abilities are authored as Dhall data. Ice Knife, an SRD spell, composes an attack phase and a saving-throw phase. This dependency trace is generated from its compiled JSON, authored in Dhall. Colors distinguish costs, input holes, resolution, effects, and scaling:
flowchart TD
classDef source fill:#1f77b4,color:#fff,stroke:#0d3c61
classDef procedure fill:#2ca02c,color:#fff,stroke:#185018
classDef window fill:#9467bd,color:#fff,stroke:#4a2b66
classDef hole fill:#f4a261,color:#000,stroke:#8a4f12
classDef attachment fill:#ffcc00,color:#000,stroke:#8a6d00
classDef resolution fill:#ff7f0e,color:#fff,stroke:#8a4308
classDef lifecycle fill:#7f7f7f,color:#fff,stroke:#333
classDef resource fill:#e377c2,color:#000,stroke:#8a457a
classDef scaling fill:#17becf,color:#000,stroke:#0a5f6a
classDef effect fill:#d62728,color:#fff,stroke:#6a1414
classDef statBlock fill:#111827,color:#fff,stroke:#f59e0b,stroke-width:4px
root1["spell_root<br/>Ice Knife"]:::source
act2["activate"]:::procedure
q3["action_quota<br/>(Casting Time: Action)"]:::resource
slot4["spell_slot<br/>≥ level 1"]:::resource
att5["hole<br/>target<br/>target<br/>one<br/>range 60 ft"]:::hole
res6["attack_roll [phase 1]<br/>ranged spell attack"]:::resolution
dmg7["damage: 1d10 piercing"]:::effect
win8["on_hit_window"]:::window
att9["hole<br/>burst origin<br/>area<br/>emanation r=5 ft<br/>origin: primary target"]:::hole
res10["save_gate [phase 2]<br/>DEX save<br/>DC: caster spell save DC"]:::resolution
dmg11["damage: 2d6 (linear per slot level) cold"]:::effect
sc12["scale_die_size<br/>axis=slot<br/>+1d6 per level above 1"]:::scaling
act2 -- consumes --> q3
act2 -- consumes --> slot4
act2 -- attaches_to --> att5
act2 -- grants --> res6
res6 -- attaches_to --> att5
res6 -- opens_window --> win8
win8 -- grants --> dmg7
dmg7 -- attaches_to --> att5
act2 -- attaches_to --> att9
act2 -- grants --> res10
res10 -- attaches_to --> att9
res10 -- branches_on_save --> dmg11
dmg11 -- attaches_to --> att9
sc12 -- modifies --> dmg11
slot4 -- modifies --> sc12
res6 -- branches_on_completion --> res10
root1 -- roots --> act2
Another authored record can reuse implemented mechanical procedures without a handler keyed to its name. New procedure shapes need runtime support. The Surface authoring guide shows how to compile, validate, and generate a full review trace; architecture explains the content boundary.
Explore
| Build or inspect | Start here |
|---|---|
| Character creation and progression | Creation runtime |
| Persistent character state and rests | Character Sheet runtime |
| Battle Acts, fills, and interrupts | Battle runtime |
| Tool-driven play with recoverable sessions | MCP |
| Character creation UI and battle visualization | Website |
| Package ownership and verification design | Architecture |
License
Code is licensed under Apache 2.0. SRD 5.2.1 content is available under CC BY 4.0; see NOTICE for repository attribution and the working Markdown corpus README for its SRD attribution, Downfallx conversion credit, and source provenance.
Frequently asked questions
What is 5e Quint?
D&D 5e SRD 5.2.1 game engine: create characters and run turn-based battles through MCP, backed by Quint formal models, rule-level proofs, and model-based testing.
How do I install 5e Quint?
Follow the installation steps in its documentation, shown on this page and in its repository.
Is 5e Quint open source?
Yes. Its code is on GitHub under the Apache-2.0 license.
Who maintains 5e Quint?
It is published by dearlordylord. AI.tn lists it but does not maintain or endorse it.
From the community awesome-mcp-servers lists and the project's GitHub repository. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.