Skip to main content
Glama
Komeiji-Shiki

trpg-dice-mcp

TRPG 掷骰 MCP Server v2.0

密码学安全真随机的 TRPG 掷骰服务器,支持完整骰子表达式引擎、多系统规则预设、暗骰保密。

快速开始

配置 MCP 客户端

在你的 MCP 客户端配置中添加:

{
  "mcpServers": {
    "trpg-dice": {
      "command": "npx",
      "args": ["-y", "trpg-dice-mcp"]
    }
  }
}

Windows 客户端

部分 Windows 环境需要:

{
  "mcpServers": {
    "trpg-dice": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "trpg-dice-mcp"]
    }
  }
}

Related MCP server: MCP Dice Roller

工具一览

工具

用途

示例

roll_dice

掷骰表达式求值

3d6+2, 4d6kh3, d%, (8d6)/2

roll_table

随机表抽取(范围/权重/等概率)

遭遇表、战利品表

roll_check

技能/属性检定

CoC 7e、D&D 5e、PbtA、GURPS

roll_pool

骰池检定

Shadowrun、WoD、Year Zero

roll_fate

FATE 检定

4dF + 修正值

pick_random

随机抽取

先攻排序、抽牌

get_roll_history

查询历史

最近掷骰记录

reveal_hidden_roll

揭示暗骰

追溯查看之前暗骰的完整结果

opposed_check

双方对抗检定

技能对抗、先攻对抗

支持的骰子表达式

基本语法

表达式

含义

3d6

掷 3 颗 6 面骰

1d20+5

d20 + 修正 5

4d6kh3

4d6 取最高的 3 个(D&D 属性)

2d20kl1

2d20 取最低的 1 个(劣势)

3d6!

爆炸骰(出 6 追加一骰)

1d6r2

重骰直到结果 > 2

(8d6)/2

8d6 结果除以 2(向下取整)

floor(3d6/2)

同上,显式 floor

特殊骰

记号

含义

d% / d100

百分骰(1–100)

dF

Fudge 骰(-1/0/+1)

d66

查表骰(11–66,36 个离散值)

修饰符

修饰符

含义

khN

保留最高的 N 个

klN

保留最低的 N 个

dhN

丢弃最高的 N 个

dlN

丢弃最低的 N 个

!

爆炸(出最大值追加一骰)

!!

复合爆炸(累计为单骰值)

!>N

阈值爆炸(出 ≥N 追加)

rN

递归重骰直到结果 > N

规则预设

预设

系统

骰子

判定

coc7

克苏鲁的呼唤 7 版

1d100

≤ 技能

dnd5e

D&D 5 版

1d20+mod

≥ DC

pbta

Powered by the Apocalypse

2d6+mod

固定阈值

gurps

GURPS

3d6

≤ 技能

runequest

RuneQuest

1d100

≤ 技能

fate

FATE

4dF+mod

vs 难度

模型可通过 rules://presets/{name} 资源查阅详细判定规则。

安全性

  • 随机源:使用 node:crypto.randomInt(),密码学安全,无模偏差

  • 暗骰hidden: true 参数使结果不进入 LLM 上下文,仅写入本地加密存储

  • 揭示控制:暗骰揭示默认启用,GM 可通过 reveal_hidden_roll 工具回溯查看暗骰结果

开发

npm install
npm run build
npm test

项目结构

src/
├── index.ts          # stdio 入口
├── server.ts         # MCP 工具注册
├── rng/              # 随机数核心(SecureRng / SeededRng)
├── dice/             # 表达式引擎(tokenizer/parser/eval/range/table)
├── rules/            # 规则预设 + degrees DSL
├── resources/        # MCP Resources(规则速查)
├── state/            # 历史记录 + 暗骰存储
├── tools/            # 9 个 MCP 工具
└── utils/            # 格式化 / i18n

许可

MIT

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    A
    quality
    C
    maintenance
    An MCP server that provides tools for rolling dice using standard notation, flipping coins, and selecting random items from lists. It supports advanced tabletop gaming features such as character stat generation and keep-highest/lowest mechanics.
    Last updated
    6
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    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.
    Last updated
    2
    MIT
  • A
    license
    -
    quality
    D
    maintenance
    Enables dice rolling for RPG games using standard dice notation, supporting complex expressions like keep/drop, reroll, exploding dice, and batch rolls.
    Last updated
    3
    MIT

View all related MCP servers

Related MCP Connectors

  • Official remote MCP server for Archivist AI TTRPG campaign memory: characters, sessions, and more.

  • Production-grade cryptography toolkit with 31 MCP tools for classical, PQC, and KMS workflows.

  • Manage TTRPG campaigns: NPCs, locations, factions, quests, sessions, lore, and knowledge graphs.

View all MCP Connectors

Latest Blog Posts

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/Komeiji-Shiki/trpg-dice-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server