convez.ai
MCP ServerAutomaçãoAvançado
cpuchip

dnd-tools

cpuchip/dnd-tools

Backbone de jogo para campanhas D&D 5e com IA, dados locais e rolos honest

Ver no GitHub
InicialPluginScore · de 0 a 100

Servidor MCP para gerenciar campanhas de D&D 5e com agentes de IA: folhas de personagem, estado da campanha e log de sessões armazenados localmente. Integra dados do SRD 5.2 e referências do Open5e (criaturas, magias, itens, condições) com um design transparente onde os dados e rolos ficam sempre visíveis.

Instalação

$npx convez-ai cpuchip/dnd-tools

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
1
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
1

Casos de uso

  • Executar campanhas de D&D com DM ou jogadores assistidos por IA
  • Manter registro persistente de personagens, campanha e histórico de sessões
  • Resolver testes de habilidade e combate com modificadores transparentes
  • Consultar referências SRD e Open5e (monstros, magias, itens) offline

Veredito

Solução especializada e bem-arquitetada para orquestração de campanhas D&D com IA. O design de transparência nos rolos e a persistência local de estado são diferenciais sólidos; exige familiaridade com MCP e Go para estender, mas funciona como servidor standalone pronto para uso.

README

A tradução para o português deste README ainda está na fila.

dnd-tools

An MCP server for running D&D 5e campaigns with AI agents at the table: character sheets, campaign state, and a session log you own, on the SRD 5.2 ruleset, with reference data (creatures, spells, items, conditions) served from Open5e and cached locally.

Built as the game-state backbone for AI-driven campaigns on ai-chattermax — a DM persona looks up monsters, a Party persona builds and levels PCs — but it's a standalone server any MCP client can use.

The dice-honesty design

dnd-tools never rolls dice. dnd_char_check resolves a check to its modifier and hands back the exact /roll command to post in the room:

Thorin — Perception (WIS): +5 (WIS +3, proficiency +2). Roll it in the open: /roll 1d20+5 [Thorin — Perception (WIS)]

The chat server rolls server-side (crypto/rand), in history, for every sender. One implementation, one fairness story: neither a human nor a model can fudge a roll, and a model never invents one — the same discipline as read-before-quoting.

Tools

ToolWhat it does
dnd_campaign_createCreate a campaign (status: prep → active → archived)
dnd_campaign_getOverview: premise, roster, recent session log
dnd_campaign_logAppend a session recap (the archive/resume record)
dnd_char_createCreate a sheet — HP and save proficiencies derive from class; standard array, CSV, or JSON ability scores
dnd_char_getFull markdown sheet
dnd_char_listOne-line roster
dnd_char_updateDamage/heal (hp_delta), AC, XP, inventory add/remove, spell slots, skills, features, notes
dnd_char_levelup+1 level: average HP gain, proficiency recompute
dnd_char_checkModifier + breakdown + the /roll command (skills, abilities, saves, initiative)
dnd_ref_searchSearch SRD creatures/spells/items/conditions by name (Open5e, cached)
dnd_ref_getOne reference entry, formatted for the table

Rulesets: srd-2024 (SRD 5.2, the 2024 rules — default) or srd-2014 (SRD 5.1).

Run

go build ./cmd/dnd-mcp

# stdio MCP server; state in ./dnd.db (or -db / DND_DB)
./dnd-mcp

# with the optional read-only HTTP sheet API
./dnd-mcp -http :8089
# GET /healthz · /api/campaigns · /api/campaigns/{name}
# GET /api/characters/{name}?campaign=X · /api/characters/{name}/sheet

Storage is a single SQLite file (pure-Go driver — cross-compiles with CGO_ENABLED=0). Open5e responses are cached in the same file, so repeat lookups are instant and work offline.

Architecture

cmd/dnd-mcp/        entry — stdio MCP server + optional HTTP API
internal/rules/     SRD 5.2 core math: modifiers, proficiency, skills, classes, XP
internal/store/     SQLite: campaigns, characters, campaign log, ref cache
internal/sheet/     markdown sheet renderer
internal/open5e/    Open5e client (read-through cache)
internal/mcpserver/ tool registration + handlers
internal/httpapi/   read-only JSON/markdown sheet API

The character model is deliberately flat JSON-friendly columns — close enough to common character-JSON exports that an importer (e.g. from a user-supplied D&D Beyond export) could map onto it later. There is no D&D Beyond API integration: none exists publicly.

Licenses & attribution

  • Code: MIT (see LICENSE).
  • Rules data: This work includes material from the System Reference Document 5.2.1 ("SRD 5.2.1") by Wizards of the Coast LLC, available at https://www.dndbeyond.com/srd. The SRD 5.2.1 is licensed under the Creative Commons Attribution 4.0 International License. Portions derive likewise from the SRD 5.1 under the same license.
  • Reference API: Open5e — an open-source API over the SRDs and other openly licensed 5e content. Cached responses carry the same CC-BY-4.0 attribution.

D&D and Dungeons & Dragons are trademarks of Wizards of the Coast LLC. This project is unaffiliated.

Ver o original no GitHub

Bom para

Relacionados