beyond-mcp
beyond-mcp
D&D Beyond MCP 服务器:角色卡、怪物数据块、战役名册、实时游戏日志掷骰流,以及需选择启用的角色卡写入。从 roll20-dm-mcp 按其 issue #171 提取,从而让 DDB 拥有自己的 MCP 接口层——dm-whisper gem 和 Claude Code 通过配置选择它,与可互换的 VTT 原语服务器并列(目前为 roll20-dm-mcp,后续为 forge-mcp/ddb-maps-mcp)。
本服务器对 Roll20 或任何 VTT 一概不知,并且从不打开浏览器。读取始终开启;写入为选择启用(DDB_WRITES=enabled)。
原名为
ddb-mcp;为避免与不相关的公开仓库 ddb-mcp/ddb-mcp 冲突而更名。旧仓库 URL 会重定向。
工具
工具 | 功能 |
| 握手: |
| 按数字 ID 获取角色卡 — 紧凑的 HP/AC/状态快照; |
| 按名称或 ID 获取怪物图鉴条目 — 紧凑的 HP/AC/CR 快照; |
| 账户所在的每个战役,以及其 ID。 |
| 战役的 |
| 订阅战役的游戏日志 WebSocket;将已完成的掷骰捕获到有界缓冲区。默认跳过 Beyond20 桥接的掷骰(补隙模式)。 |
| 基于游标排空已捕获的掷骰(原始消息 + 单行摘要)。消费方直接采用实际的骰子数值 — 绝不重新掷骰。 |
| 停止掷骰泵 / 报告连接健康状态(CONNECTED 与 RETRYING、失败次数、最后错误)。 |
工具名称和默认输出形状与 roll20-dm-mcp 提供的保持一致,因此现有调用方只需指向本服务器即可迁移。掷骰泵在设计上有所不同:它缓冲而不是发布到 Roll20——gem 会排空它,并通过 roll20-dm-mcp 的 post_roll_as_character 桥接掷骰。
写入工具(选择启用——DDB_WRITES=enabled)
读取始终可用;这些变更工具仅在部署设置 DDB_WRITES=enabled 时注册,因此准备阶段和默认安装保持只读。它们是原语——对给定的任意角色 ID 精确实施所要求的变更,不涉及角色卡所有权的任何策略。由于 DDB 的 PC HP 也由 Beyond20 和玩家自身的编辑驱动,写入会与这些操作竞争(最后写入者胜),并旨在作为 DM 的刻意行为。
工具 | 功能 |
| 按绝对数值设置当前和/或临时 HP(限制在 |
| 按名称添加/移除 5e 状态(exhaustion 需要一个等级)。 |
Related MCP server: DM20 Protocol
认证
读取使用 D&D Beyond 的 CobaltSession cookie 进行认证(该 cookie 会换取短期 JWT;参见 docs/ddb-browserless-protocol.md)。此 cookie 只被消费,绝不采集:在环境中提供 DDB_COBALT,或将 DDB_DATA_DIR 指向 gem 写入 ddb-cobalt.json 的目录。缺少或过期的 cookie ⇒ 每次读取都会明确失败,并附上重新采集说明。
配置
环境变量 | 含义 |
| CobaltSession cookie 的值(覆盖数据文件)。 |
| 存放 |
|
|
| 设置为 |
| 仅用于 HTTP 入口(默认 39210 / 127.0.0.1 / 自动生成到 |
运行
npm install
npm run build
npm start # stdio MCP server (Claude Code .mcp.json, gem supervised spawn)
npm run serve # HTTP MCP server on /mcp + rolls SSE on /events (bearer-authed)Claude Code 的 .mcp.json:
{
"mcpServers": {
"ddb": { "command": "node", "args": ["E:/personalProjects/beyond-mcp/dist/index.js"] }
}
}开发
npm test # vitest run
npx vitest run src/bridge/ddb-gamelog.test.ts # one file
npm run lint
npm run dev # tsx watch, stdioNode 20+、TypeScript(NodeNext ESM)、vitest — 与 roll20-dm-mcp 相同的约定。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceConnects Claude Desktop to Foundry VTT for AI-powered campaign management, enabling natural language interaction with game data including quest creation, character management, compendium searches, and dice rolling. Provides 20 MCP tools for seamless integration between Claude and your tabletop RPG sessions.66
- AlicenseBqualityDmaintenanceA comprehensive MCP server for managing AI-assisted Dungeons & Dragons campaigns, featuring tools for character sheets, combat tracking, and world-building. It enables players and DMs to interact with 5e game mechanics and query personal PDF rulebooks using RAG capabilities.972MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that provides Claude direct access to D\&D Beyond accounts to manage characters, campaigns, and sourcebook content. It enables users to search for spells and monsters, retrieve character data, and read owned digital books through an authenticated session.5
- AlicenseAqualityAmaintenanceA Model Context Protocol server that gives Claude direct access to your D\&D Beyond account for characters, campaigns, sourcebooks, spells, monsters, rules, encounters, and treasure.35301MIT
Related MCP Connectors
D&D 5e MCP — wraps the D&D 5th Edition API (free, no auth)
Official remote MCP server for Archivist AI TTRPG campaign memory: characters, sessions, and more.
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/eschatus/beyond-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server