2D6 MCP
Provides a Discord bot with slash commands for dice rolling, rules queries, session management, and Discord webhook posting tools for automated messaging.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@2D6 MCPRoll 2d6+2 for my Persuasion check"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
2D6 MCP — AI GM Assistant
SPDX-License-Identifier: AGPL-3.0-only Copyright (C) 2026 Jupiter Industries (Liam Crowter) and the 2d6mcp maintainers
A system-agnostic Model Context Protocol (MCP) server providing a mechanical engine, dice roller, rules reference, and AI-powered rulings assistant for tabletop RPGs. Supports sci-fi (OGL/Cepheus Engine SRD), fantasy (Dungeon World, CC-BY-3.0), generic percentile (Basic Roleplaying SRD, BRP OGL v1.0), and d20 fantasy (5E-compatible SRD, CC-BY-4.0) games.
Features
Dice Engine —
2d6+1,3d6,d66, target numbers, effect marginsOGL Rules Database — Generated on first use from bundled seed data: Cepheus Engine SRD (OGL v1.0a)
Dungeon World Database — Generated on first use from bundled seed data: moves, classes, spells, monsters, GM tools (CC-BY-3.0)
Basic Roleplaying Database — Generated on first use from bundled seed data: BRP SRD 1.0.2 characteristics, skills, professions, weapons, armor, spot rules (BRP OGL v1.0)
5E-Compatible Database — Generated on first use from bundled seed data: d20 fantasy SRD classes, spells, monsters, feats, and rules (CC-BY-4.0)
AI Rulings — Ask rules questions, get cited answers from OGL/DW/BRP/5E-compatible/BYOD sources. Powered by local MLX, llama.cpp, or Ollama
Discord webhooks — Post rulings and table output to Discord channels from the MCP server
BYOD Indexing — Ingest your own PDF/text/markdown files for local full-text search
Session Management — Start/end sessions, log transcripts, search what was said at the table
Local STT/LLM — MLX on macOS; whisper.cpp, llama.cpp, or Ollama on Windows/Linux
Related MCP server: Foundry VTT MCP Bridge
Quick Start
git clone https://github.com/crowterliam/2d6mcp.git
cd 2d6mcp
npm install
npm run build
npm run setup # create consent token for BYOD mode
npm run populate-ogl # generate the OGL rules database
npm run populate-dw # generate the Dungeon World rules database
npm run populate-brp # generate the Basic Roleplaying rules database
npm run populate-5ecompatible # generate the 5E-compatible rules database from .reference/SRD
npm run populate-orcus # generate the Orcus database
npm run populate-osr # generate OSR / B/X-compatible procedures (original summaries, not book text)
npm run start # run the MCP server (stdio transport)populate-5ecompatible reads a local clone at .reference/SRD. Clone the structured markdown tree maintained by Oldmanumby (packaging only — they did not author the SRD text; Wizards of the Coast LLC / CC-BY-4.0 remains the SRD 5.2.1 attribution):
git clone https://github.com/oldmanumby/dnd.srd.5.2.1 .reference/SRDSee data/5ecompatible/SRD-NOTICE.txt. Do not vendor that markdown tree into git.
MCP Client Configuration
LobeHub and other clients that expect an npm package can use:
{
"mcpServers": {
"2d6mcp": {
"command": "npx",
"args": ["-y", "crowterliam-2d6mcp"]
}
}
}Docker (stdio):
{
"mcpServers": {
"2d6mcp": {
"command": "docker",
"args": ["run", "-i", "--rm", "2d6mcp"]
}
}
}docker build -t 2d6mcp .From a local clone:
{
"mcpServers": {
"2d6mcp": {
"command": "node",
"args": ["/absolute/path/to/2d6mcp/packages/server/dist/index.js"],
"env": {
"AGREE_BYOD_USE": "true",
"BYOD_PATH": "/path/to/your/rpg/files"
}
}
}
}Smithery: smithery.yaml at the repository root launches packages/server/dist/index.js over stdio.
BYOD — Non-Commercial Use Disclosure
BYOD (Bring Your Own Documents) mode enables local file ingestion for personal, non-commercial use only. By enabling BYOD (AGREE_BYOD_USE="true" or npm run setup), you confirm that:
You are the legal owner of the imported files or hold a valid license to use them.
This tool is provided strictly for personal, non-commercial automation and referencing.
The developers of this software do not condone piracy or the unauthorized distribution of copyrighted tabletop roleplaying materials.
Tools
Tool | Description |
| Roll dice. |
| Roll on a named table. |
| Search a licensed rules DB. |
| Search personal files. Indexes matching top-level game folders on demand, then searches. Optional |
| On-demand index. No args lists folders. |
| Delete the BYOD index. |
| List indexed files. Optional |
| Retrieve full chunk content by path + chunk index. |
| Parse a character sheet ( |
| Post messages to Discord webhooks with smart routing |
| Manage webhooks: |
| Manage sessions: |
| Log a transcript segment to a session |
| Get recent transcript segments and rulings ( |
| Search transcripts ( |
| Cited rules ruling. Prefers BYOD when |
| Transcribe audio. Files over 180 seconds are chunked. Last chunk sets |
| Ingest a live companion transcript ( |
Prompts
Prompt | Purpose |
| 2d6 task check via |
| d20 attack or ability check via |
| d100 roll-under via |
| Licensed rules search via |
| Character creation using |
| Start a logged session |
| Cited ruling via |
| On-demand BYOD ingest via |
Resources
Attachable context at 2d6mcp://info, 2d6mcp://tools, 2d6mcp://prompts, 2d6mcp://systems, 2d6mcp://docs/quickstart, 2d6mcp://docs/environment, 2d6mcp://license, 2d6mcp://session/current, and 2d6mcp://rules/{system} for each licensed database.
Architecture
2d6mcp/
├── packages/
│ ├── server/ # MCP server — stdio transport, local MLX, BYOD, session DB
│ ├── shared/ # @2d6mcp/shared — dice, keywords, prompts, quality filter
│ ├── ogl/ # @2d6mcp/ogl — OGL rules database + queries
│ ├── dw/ # @2d6mcp/dw — DW rules database + queries
│ ├── brp/ # @2d6mcp/brp — BRP rules database + queries
│ ├── 5ecompatible/ # @2d6mcp/5ecompatible — 5E-compatible rules database + queries
│ ├── orcus/ # @2d6mcp/orcus — Orcus d20-compatible rules database + queries
│ └── osr/ # @2d6mcp/osr — B/X-style procedures (original summaries; books via BYOD)
├── data/ # SQLite databases (shared)
├── tests/ # Vitest test suite
├── tsconfig.base.json
└── package.json # npm workspaces rootAgent Modes
This project includes AI agent instructions for common coding assistants. See .kilo/agent/ for domain-specific modes:
Agent File | Domain |
| Master reference — all tools, workflows, environment vars |
| Dice rolling, effect margins, difficulty, boon/bane |
| Rules lookup, table rolling, OGL + BYOD search |
| UPP, characteristics, career paths, skills |
| BYOD sync, listing, inspection, troubleshooting |
Slash commands are in .kilo/command/ for quick access to common operations.
Build & Test
npm install # install all workspace dependencies
npm run build # compile all packages (tsc --build)
npm test # run the Vitest suite
npm run typecheck # type-check without emitting
npm run start # run the MCP server (packages/server/dist/index.js)
npm run sync-byod # list BYOD collections; pass a query or --root to index that scope
npm run version:check # assert lockstep SemVer across workspacesVersioning is SemVer 2.0 lockstep (root + every packages/* share one version). MCP server.version is read from root package.json. See VERSIONING.md for bump rules and CHANGELOG.md for release notes. Do not npm publish from this repo until the maintainer explicitly approves it.
Environment Variables
Variable | Default | Description |
|
| Set to |
| — | Path to directory containing local RPG source files |
|
| Characters per chunk (500–50000) |
|
| Overlap between consecutive chunks |
|
| Maximum files to process per sync |
|
| Maximum chunks from any single file |
|
| Milliseconds per sync batch |
|
| Force single-file index concurrency for high-latency filesystems |
|
| Shared content cache database |
|
| Path to custom OGL SQLite database |
|
| Path to custom DW SQLite database |
|
| Path to custom BRP SQLite database |
|
| Path to custom 5E-compatible SQLite database |
|
| Path to custom Orcus SQLite database |
|
| Path to OSR / B/X-compatible procedures database |
|
| MLX Whisper model |
|
| MLX LLM model |
|
| Session database location |
|
| STT backend: |
|
| LLM backend: |
|
| Ollama daemon URL ( |
|
| Ollama model name ( |
| — | External companion SQLite path for |
| — | Extra allowlisted paths for companion SQLite/NDJSON (colon or semicolon separated) |
Live transcript companion
2d6mcp does not capture system loopback or microphone audio. Use an external live-transcript companion, or an NDJSON fixture for smoke tests without that app installed.
Companion SQLite schema: meetings (id, title, started_at, duration_s, …) and segments (id, meeting_id, start_ms, end_ms, speaker, text).
Run a compatible companion separately, or write NDJSON.
ndjson_fileworks without a companion app.Set
LIVE_TRANSCRIPT_DBto the SQLite file and/orLIVE_TRANSCRIPT_ALLOW_PATHSfor fixture files. Windows drive letters in those lists are kept intact.Start a session with
sessionaction: start.Poll
ingest_live_transcript(action: polloringest) with thatsession_id. New segments are logged as voice/narration. Repeat during play; the per-session cursor is incremental and idempotent.action: statusshows the cursor;action: reset_cursorclears it. Paths outside the project root,BYOD_PATH,LIVE_TRANSCRIPT_ALLOW_PATHS, andLIVE_TRANSCRIPT_DBare rejected.
Live-sidecar smokes should rotate or truncate NDJSON (or start a fresh session) between scenarios so an older fixture line is not still in the from_context window. The code also prefers the most recent speaker-Me rules-ish utterance, including lines without ?.
Outbound webhook tools are unchanged. System loopback / mic capture is out of scope for 2d6mcp.
Session labels
query_rules(system=ogl) is 2d6 sci-fi SRD — not old-school fantasy. For B/X-style procedures use system=osr plus BYOD for the operator's local OSR/B/X shelf PDFs.
Set an optional durable table_label on session start so get_session_context, search_transcript, and session list can filter one table without mixing transcripts.
Example |
|
| Notes |
Sci-fi SRD table |
|
| Trade/encounter ticks via |
Personal files (BYOD) |
|
|
|
B/X-style table |
|
|
|
Percentile table |
|
|
|
Personal files (BYOD)
BYOD tooling is system-agnostic. sync_byod / query_local_byod / root / relative_path / byod_system work for any operator shelf folder. Pin with root/relative_path to stay inside one nested folder and avoid sibling collections.
rules_system=byod (or a session with byod_system set) means rulings prefer indexed personal files. Pass rules_context from get_byod_chunk into synthesize_ruling when you already have chunks.
Optional roll difficulty presets are generic operator targets (average=8, difficult=10, very_difficult=12, impossible=16). Ignored when target is set. parse_character needs file_path under the project or BYOD_PATH, or pasted sheet_text. search_transcript treats unquoted tokens as AND.
OSR lookup vs commercial books
Mid-session procedures:
query_rules(system=osr)androll_table(source=osr)(Monster Reaction, Morale Check, Hireling Reaction, Wandering Encounter Tick). Bundled text is original 2d6mcp AGPL wording, not a book dump.Full commercial books are BYOD only: local-only, consent-gated (
AGREE_BYOD_USE), never uploaded, never committed. Example path (docs only):/path/to/rpg-shelf.sync_byod(query="old-school")thenquery_local_byod.Optional:
npm run populate-osr -- --source-dir <notes>imports operator.md/.txtinto the local DB. PDFs stay in BYOD. Never commit book PDFs or extracted dumps. Commercial rulebooks stay on the operator's licensed shelf.
Multi-shelf BYOD
Consent (AGREE_BYOD_USE or npm run setup) is required. Point BYOD_PATH at the parent of game folders so each top-level directory is a collection. sync_byod with no args lists those folders; query or system indexes matches only; relative_path or root indexes a nested folder such as parent/line. High-latency mounts: BYOD_NETWORK=true. query_local_byod accepts the same root / relative_path pin so a family name does not search edition-5-sibling.
Sci-fi trade and encounter recipes (source=ogl)
Do not paste commercial core-book text. Use the bundled OGL tables and these agent recipes:
List tables:
query_rules(system=ogl, category=list_tables)orroll_table(source=ogl)with a known name.Passage / patrons / random persons:
roll_table(table_name="Patron Encounter"),roll_table(table_name="Personal Encounter").Wilderness or starship encounter ticks:
query_rules(system=ogl, search_term="encounter", category=worlds)andcategory=starships.Freight/trade:
query_rules(system=ogl, search_term="freight", category=trade)(aliases:Trade & Commerce,commerce). Returns Open SRD freight rate (Cr1,000/ton per jump), speculative trade, passengers, and mail. Broker:category=skills. Trade codes/routes:category=worlds.category=list_tableshas no commercial freight-lot matrix — use Population/starport as a guide, or BYOD if the operator indexed a licensed book.
Percentile (CoC 7e-style) helpers
roll(mechanic="coc", target=50, bonus_dice=1, penalty_dice=0, san_success="1", san_fail="1d6", opposed_target=40) reports Hard (floor(skill/2)), Extreme (floor(skill/5)), success level, optional SAN loss, and opposed winner. Bonus and penalty dice cancel. Discord posting remains draft-only / operator-yes.
License
This project uses a multi-license architecture:
Source code (
packages/**, root config files): AGPL-3.0-onlyOGL game data (
data/ogl/**): OGL v1.0aDungeon World data (
data/dw/**): CC-BY-3.0Basic Roleplaying data (
data/brp/**): BRP Open Game License v1.05E-compatible SRD data (
data/5ecompatible/**): CC-BY-4.0. Populate clones Oldmanumby's markdown packaging into.reference/SRD(oldmanumby/dnd.srd.5.2.1); Oldmanumby did not author the SRD text.OSR / B/X-compatible procedures (
data/osr/**): original 2d6mcp summaries (NOTICE, AGPL); commercial rulebooks via BYOD only
The BRP logo (BRP.png in the project root and data/brp/BRP.png) is a trademark of Chaosium Inc., displayed in compliance with Section 15 of the BRP Open Game License v1.0.

You are granted permission to reproduce the logo only for the purpose of labeling derivative works under the BRP OGL.
Full license documentation: LICENSE.md
Copyright © 2026 Jupiter Industries (Liam Crowter) and the 2d6mcp maintainers
This server cannot be deployed
Maintenance
Related MCP Connectors
Campaign manager for D&D and TTRPG GMs: your AI reads and writes a live typed campaign database.
Connect any AI to your Foundry VTT world: actors, combat, dice, journals, tokens, compendiums.
1Official remote MCP server for Archivist AI TTRPG campaign memory: characters, sessions, and more.
Savecraft serves real save game data and expert game knowledge to AI assistants.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceIntegrates with FoundryVTT tabletop gaming sessions, allowing AI assistants to query game data, roll dice, generate content (NPCs, loot, encounters), manage combat, and provide tactical suggestions through natural language.1 npm-
- FlicenseNot gradedqualityCmaintenanceEnables AI-powered campaign management for Foundry Virtual Tabletop through natural language, supporting multiple RPG systems with tools for quest creation, character management, combat resolution, and more.-
- AlicenseNot gradedqualityBmaintenanceEnables AI to act as Game Master for tabletop RPGs with deterministic dice, five-tier outcomes, FitD-style stress, combat tracking, clocks, investigations, NPC relationships, and world generation via 134 tools over MCP.2MIT
- FlicenseNot gradedqualityCmaintenanceEnables tabletop RPG dice rolling through natural language, supporting standard dice formulas, modifiers, exploding dice, and d20 prompts for ability checks, saving throws, attack rolls, and damage rolls.-