Dice MCP Server
Provides comprehensive TRPG dice rolling functionality including standard notation, advantage/disadvantage mechanics, and success-counting dice pools. It enables users to perform complex dice logic and track roll history through an MCP-compliant interface.
README
Dice MCP Server
A Model Context Protocol (MCP) server that provides TRPG dice rolling functionality for multiple game systems.
Features
- Standard dice notation:
1d20,2d6+3,4d6,1d100,3d20-2d20+2 - Fudge/FATE dice:
4dF,4dF+3— each die rolls -1, 0, or +1 - Keep highest / lowest:
4d6kh3,2d20kl1 - Advantage / Disadvantage: D&D 5e style (bool ON/OFF)
- Bonus / Penalty dice: CoC style — extra tens dice on d100 (int 0-2)
- Critical hit / fumble: Natural 20/1 detection (bool ON/OFF)
- Target check: Two modes —
at_least(D&D: ≥) /at_most(CoC: ≤) - Success degrees: System-specific degree calculation
coc: Regular / Hard / Extreme / Critical / Fumblepf2e: Crit Success / Success / Failure / Crit Failure (±10 margin, nat 20/1 shift)pbta: Strong Hit / Weak Hit / Miss (fixed thresholds)
- Dice pool: WoD, Shadowrun — success counting, exploding, double successes
- Botch/Glitch detection (bool ON/OFF)
- Reroll: Re-roll last roll with same parameters (Inspiration, Lucky, etc.)
- Roll history: Track and review recent rolls per session
Quick Start (uvx)
{
"mcpServers": {
"dice": {
"command": "uvx",
"args": ["roleplaying-dice-mcp"]
}
}
}
Config: macOS
~/Library/Application Support/Claude/claude_desktop_config.json/ Windows%APPDATA%\Claude\claude_desktop_config.json
Alternative: pip / Docker
pip install roleplaying-dice-mcp
roleplaying-dice-mcp
docker build -t dice-mcp-server . && docker run -i dice-mcp-server
Tools
roll_dice
Roll dice using standard TRPG notation.
| Parameter | Type | Default | Description |
|---|---|---|---|
notation |
string | required | Dice expression: 1d20+5, 4d6kh3, 4dF+2, 1d100 |
advantage |
bool | false |
Roll d20 twice, take higher (1d20 only) |
disadvantage |
bool | false |
Roll d20 twice, take lower (1d20 only) |
bonus_dice |
int | 0 |
CoC bonus dice (0-2, 1d100 only) — extra tens, keep lowest |
penalty_dice |
int | 0 |
CoC penalty dice (0-2, 1d100 only) — extra tens, keep highest |
target |
int | — | DC/AC/skill value for success check |
target_mode |
string | "at_least" |
"at_least" (D&D: ≥) or "at_most" (CoC: ≤) |
critical |
bool | false |
Nat 20/1 detection. With degrees="pf2e", shifts degree ±1 step |
degrees |
string | — | "coc" / "pf2e" / "pbta" — enables degree calculation |
Examples:
// D&D 5e: advantage + critical + DC
{ "notation": "1d20+5", "advantage": true, "target": 15, "critical": true }
// D&D ability scores
{ "notation": "4d6kh3" }
// FATE
{ "notation": "4dF+3" }
// CoC: bonus die + degrees
{ "notation": "1d100", "bonus_dice": 1, "target": 65, "target_mode": "at_most", "degrees": "coc" }
// → 1d100 (보너스 ×1): [43, 73] → 43
// → 판정: 하드 성공! (43 ≤ 32) ← wait, depends on roll
// PF2e: degrees with nat 20/1 shift
{ "notation": "1d20+8", "target": 20, "critical": true, "degrees": "pf2e" }
// PbtA: fixed thresholds
{ "notation": "2d6+1", "degrees": "pbta" }
roll_pool
Dice pool with success counting.
| Parameter | Type | Default | Description |
|---|---|---|---|
pool |
int | required | Number of dice (1-50) |
sides |
int | 10 |
Sides per die |
target |
int | 8 |
Success threshold (≥) |
explode |
bool | false |
Reroll on max value |
double_on |
int | — | Double success at this value or higher |
count_ones |
bool | false |
Botch/Glitch detection |
When count_ones is enabled:
- WoD Botch: 0 successes + any 1s
- Shadowrun Glitch: Half+ dice are 1s
- Shadowrun Critical Glitch: Glitch + 0 successes
// WoD: 7d10, exploding, botch detection
{ "pool": 7, "target": 8, "explode": true, "count_ones": true }
// Shadowrun: 8d6, target 5, glitch detection
{ "pool": 8, "sides": 6, "target": 5, "count_ones": true }
reroll
Re-roll the last roll_dice or roll_pool with identical parameters. No arguments.
get_history / clear_history
| Tool | Parameter | Description |
|---|---|---|
get_history |
limit (default 10) |
Retrieve recent roll records |
clear_history |
— | Clear all history |
System Coverage
| System | Coverage | Key Features Used |
|---|---|---|
| D&D 5e | 95% | notation, advantage, critical, target, 4d6kh3 |
| CoC 7e | 85% | d100, bonus/penalty dice, degrees=coc, at_most |
| PF2e | 85% | d20+mod, degrees=pf2e, critical (nat 20/1 shift) |
| PbtA | 90% | 2d6+mod, degrees=pbta |
| FATE | 95% | 4dF+mod |
| WoD | 90% | roll_pool, explode, count_ones (botch) |
| Shadowrun | 85% | roll_pool (d6), count_ones (glitch) |
| Savage Worlds | 50% | exploding works, but no wild die or raise counting |
Project Structure
├── server.py # MCP server — tools & handlers
├── dice_parser.py # Notation parser (NdM, NdF, kh/kl)
├── history.py # Roll history manager
├── src/roleplaying_dice_mcp/ # PyPI package
├── tests/test_trpg_scenario.py
├── pyproject.toml
├── Dockerfile
└── README.md
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。