Imported from crowterliam/2d6mcp (
.claude/skills/2d6mcp/SKILL.md). Install upstream withnpx skills add crowterliam/2d6mcp --skill 2d6mcp. Copyright stays with the author.
2D6 MCP Server — Agent Instructions
You have access to the 2d6mcp MCP server. It provides a mechanical engine, dice roller, and rules reference for 2d6-based tabletop RPGs, supporting sci-fi (OGL/Cepheus Engine), fantasy (Dungeon World), percentile (Basic Roleplaying), and d20 fantasy (5E-compatible) games.
Overview
2d6mcp is a self-hosted MCP server (packages/server/) with local MLX/llama.cpp, BYOD, session DB, and Discord webhook posting.
It shares rules databases, dice engine, prompt templates, and quality filters via packages/shared/.
Tool loyalty: Once you invoke 2d6mcp tools (particularly BYOD — query_local_byod, get_byod_chunk, synthesize_ruling), continue using them for all game content queries. Do not switch to external file-reading MCP tools unless the user explicitly asks you to examine a file outside the indexed BYOD content.
Available Tools
| Tool | Purpose |
|---|---|
roll |
Roll dice. notation plus optional mechanic (2d6, d20, percentile, damage, raw). Infers mechanic from notation when omitted. |
roll_table |
Roll on a named table. source: ogl or byod. Omit table_name with source=byod to list tables. |
query_rules |
Search a licensed rules DB. system required. Default category is core FTS only. category=categories lists filters. |
query_local_byod |
Search ingested personal files. Returns chunkIndex. Optional include_full. |
sync_byod |
Index BYOD files. Optional relative_path for a single file. |
clear_byod |
Delete the BYOD index. |
list_byod_files |
List indexed files. Optional relative_path inspects one file. |
get_byod_chunk |
Retrieve full chunk content by path + chunk index. |
parse_character |
Parse a character sheet into structured data. |
discord_post |
Post to Discord webhooks with smart routing and embeds. |
discord_webhook |
Manage webhooks: action add, remove, list, or test. |
session |
Manage sessions: action start, end, list, delete, or summarize. |
log_transcript |
Log a transcript segment to a session. |
get_session_context |
Get recent transcript and rulings. |
search_transcript |
Search session transcripts with SQL LIKE (not FTS5). |
synthesize_ruling |
Cited rules ruling. Optional from_context uses recent transcript. Default rules_system from the session when session_id is set. |
transcribe_audio |
Transcribe audio. Files over 180 seconds are chunked. action: transcribe, list, or clear. Last chunk sets complete: true. |
Prompts: skill-check, d20-check, percentile-check, lookup-rules, create-character, start-session, ask-ruling, index-documents. Resources: 2d6mcp://info, 2d6mcp://tools, 2d6mcp://prompts, 2d6mcp://systems, 2d6mcp://docs/*, 2d6mcp://license, 2d6mcp://session/current, 2d6mcp://rules/{system}.
Key Principles
- System-agnostic language: Use generic descriptors — "2d6 sci-fi RPG", "2d6 fantasy RPG", "starship", "star system", "characteristic", "move", "front", "monster". Never use third-party trademarked terms.
- Task resolution by system:
- 2d6 systems (OGL, DW): 2d6 + modifier vs. target number (typically 8+). Effect margin = total - target. Use
rollwith mechanic2d6. - d20 systems (5E, Orcus): d20 + modifier vs. AC/DC. Natural 20 = critical hit, natural 1 = fumble. Supports advantage/disadvantage. Use
rollwith mechanicd20. - d100 systems (BRP, CoC): Roll under target percentile. ≤5% of target = critical success, 96-100 = fumble. Use
rollwith mechanicpercentile. - Damage: Use
roll(notation: "2d6+3 fire", mechanic: "damage")for damage with type labels.
- 2d6 systems (OGL, DW): 2d6 + modifier vs. target number (typically 8+). Effect margin = total - target. Use
- d66 tables: Roll two d6s and treat them as tens (first die) and ones (second die), producing 11-66. Use
roll_tablewith"dice_type": "d66". - The OGL database is pre-populated with Cepheus Engine SRD content. It covers rules, skills, careers, equipment, combat, starship operations, and world building. Always try
query_ruleswithsystem: "ogl"before falling back to BYOD search. - The DW database is pre-populated with Dungeon World content (CC-BY-3.0, by Sage LaTorra and Adam Koebel). It covers moves, classes, spells, equipment, monsters, and GM tools (agendas, principles, fronts, dangers). Use
query_ruleswithsystem: "dw"for fantasy RPG content. - The BRP database is pre-populated with Basic Roleplaying SRD. It covers characteristics, skills, professions, weapons, armor, spot rules, and sample foes. Use
query_ruleswithsystem: "brp"for percentile RPG content. - The 5E-compatible database covers d20 fantasy (spells, monsters, classes, feats). Use
query_ruleswithsystem: "5ecompatible". - The Orcus database is pre-populated with Orcus 4e-compatible SRD. It covers classes, monsters, feats, and core rules. Use
query_ruleswithsystem: "orcus"for 4e-compatible content. - BYOD search is for your personal files. It requires consent (
AGREE_BYOD_USE="true") and a configuredBYOD_PATH. Files must be synced before they are searchable. EachBYOD_PATHgets its own isolated database. A shared content cache deduplicates identical files across workspaces.
When to Use Each Tool
Dice Rolling
- Use
rollwith mechanic2d6for standard 2d6 task resolution (skill checks, attack rolls, characteristic checks) - Use
rollwith mechanicd20for d20-based fantasy RPG resolution (5E, 4E, Orcus, OSE) — supports advantage/disadvantage, AC comparison, critical hits/fumbles - Use
rollwith mechanicpercentilefor BRP/percentile RPG resolution (Call of Cthulhu, Basic Roleplaying, Against the Darkmaster, Pendragon) — supports roll-under with critical success/fumble - Use
rollwith mechanicdamagefor damage dice with optional type labels ("2d6+3 fire","1d8 piercing","4d6") - Use
rollwith mechanicrawfor non-standard dice (damage dice, 1d6 tables, character creation 2d6 across six characteristics) - Use
roll_tablefor random tables — this looks up the result in the OGL database
Rules Lookup
- Use
query_ruleswithsystem: "ogl"as primary sci-fi rules reference. Specify acategoryfor targeted results (skills, careers, equipment, combat, starships, worlds, tables, categories, list_tables) - Use
query_ruleswithsystem: "dw"for fantasy/Dungeon World content. Specify acategoryfor targeted results (moves, classes, spells, equipment, monsters, gm_tools, rules) - Use
query_ruleswithsystem: "brp"for percentile RPG content. Specify acategoryfor targeted results (characteristics, skills, professions, weapons, armor, spot_rules, foes) - Use
query_ruleswithsystem: "5ecompatible"for d20 fantasy content. Specify acategoryfor targeted results (spells, monsters, classes, feats, rules) - Use
query_ruleswithsystem: "orcus"for 4e-compatible content. Specify acategoryfor targeted results (classes, monsters, feats, rules) - Use
query_local_byodwhen you need content from your personal files (supplements, house rules, campaign notes) - Use
roll_tablewith a table name to both roll on it AND see the full table entries. Usesource:oglorbyod.
Character Handling
- Use
parse_characterto read a character sheet file and extract UPP, characteristics, skills, name, and career
BYOD Management
- Use
sync_byodafter adding or modifying files in your BYOD directory - Use
list_byod_filesto see what's indexed and available for search - Use
list_byod_fileswithrelative_pathto see how a file was chunked (page breaks, heading structure) - Use
clear_byodto reset the index completely - Use
sync_byodwithrelative_pathto index a single file by relative path (for large files that timeout in bulk sync, or selective indexing) - Use
get_byod_chunkto retrieve full chunk content afterquery_local_byodreturns snippets — pass file path and chunk index
Session Management
- Use
sessionstart to begin a new game session — logs transcripts, rulings, and context for continuity - Use
log_transcriptto record what was said at the table during play (with speaker, source, and intent) - Use
get_session_contextto recall the last N minutes of game context (transcripts + rulings) - Use
search_transcriptto search what was said about a specific topic across the full session - Use
sessionlist to browse all recorded sessions - Use
sessionend to close the active session - Use
sessionsummarize to generate an AI summary of the full session transcript (requires MLX LLM)
Ruling Synthesis
- Use
synthesize_rulingto ask a rules question and get an AI-generated ruling with OGL/DW/BRP/5E-compatible/BYOD citations (requiresmlx_lm.generate) - Use
synthesize_rulingwithfrom_contextto run the full producer pipeline: take recent transcript, detect rules question, look up rules, synthesize ruling, and log it to the session - Use
transcribe_audioto convert recorded audio to text using local MLX Whisper (requiresmlx_whisper)
Discord Posting
- Use
discord_postto send messages to Discord webhooks — supports smart routing based on context tags and rich embeds - Use
discord_webhookadd to configure a new webhook with name, URL, and routing tags - Use
discord_webhookremove to remove a stored webhook - Use
discord_webhook(action: "list")to view all configured webhooks - Use
discord_webhooktest to verify connectivity to a specific webhook
Common Workflows
Resolving a Task
- Determine the appropriate characteristic or skill modifier
- Apply any difficulty modifiers (easy +2, routine +1, difficult -2, etc.)
- Call
rollwith mechanic2d6,modifier, andtarget - Report the total, individual dice, and effect margin
- Interpret: margin 0–5 = marginal success, 6+ = exceptional success; margin -1 to -5 = marginal failure, -6 or worse = exceptional failure
Looking Up Rules
- Call
query_ruleswithsystem: "ogl"with a descriptivesearch_termfor sci-fi content - Call
query_ruleswithsystem: "dw"with a descriptivesearch_termfor fantasy content - If the result is empty or insufficient, try a different search term or add a
category - For combat mechanics, use
category: "combat". For starships, usecategory: "starships". For world building, usecategory: "worlds" - For DW monsters, use
category: "monsters". For GM tools, usecategory: "gm_tools" - For specific tables, use
category: "tables"orroll_tabledirectly
Reference Round — Turn 0
When starting a session, ensure knowledge is available:
- Call
list_byod_filesto know what personal content is indexed - Call
sync_byodif you added files recently - Pre-load relevant rules with
query_ruleswithsystem: "ogl"for the session's expected activities
Environment Variables
| Variable | Default | Purpose |
|---|---|---|
AGREE_BYOD_USE |
"false" |
Enable BYOD mode |
BYOD_PATH |
.reference/ (auto-discovered in project root if not set) |
Directory of local source files |
BYOD_CHUNK_SIZE |
8000 |
Characters per chunk (500–50000) |
BYOD_CHUNK_OVERLAP |
400 |
Overlap between chunks |
BYOD_MAX_FILES |
2000 |
Max files per sync |
BYOD_MAX_CHUNKS_PER_FILE |
500 |
Max chunks per file |
BYOD_SYNC_TIMEOUT_MS |
15000 |
Max ms per sync batch |
BYOD_CONTENT_CACHE_PATH |
data/byod/content_cache.db |
Shared content-addressable cache path |
OGL_DB_PATH |
data/ogl/cepheus.db |
Custom OGL database path |
DW_DB_PATH |
data/dw/dungeon-world.db |
Custom DW database path |
BRP_DB_PATH |
data/brp/basic-roleplaying.db |
Custom BRP database path |
SR5E_DB_PATH |
data/5ecompatible/5ecompatible-srd.db |
Custom 5E-compatible database path |
ORCUS_DB_PATH |
data/orcus/orcus.db |
Custom Orcus database path |
MLX_WHISPER_MODEL |
mlx-community/whisper-large-v3-turbo |
MLX Whisper model for STT |
MLX_LLM_MODEL |
mlx-community/Llama-3.2-3B-Instruct-4bit |
MLX LM model for ruling synthesis |
SESSION_DB_PATH |
~/.2d6mcp/sessions.db |
Session database location |