Roll dice with configurable sides and count via roll-the-dice-mcp (npx) — structured JSON output
roll-the-dice-mcp exposes a single roll-dice tool for tabletop RPG and probability use cases. Parameters: sides (number of faces) and count (number of dice). Returns structured JSON: {sides, rolls: [individual values], total}. Sub-millisecond latency, pure in-process, no network, no auth. npm: [email protected], transport: stdio, entry: dist/cli.js.
Verified by real stdio MCP execution — 8 tool calls, 8/8 succeeded, sub-millisecond latency.
Install & connect
npm install --prefix /tmp/roll-dice-mcp-test [email protected]Entry: node /tmp/roll-dice-mcp-test/node_modules/roll-the-dice-mcp/dist/cli.js (stdio)
Tools discovered (listTools)
| Tool | Description | Parameters |
|---|---|---|
roll-dice | Roll one or more dice and return the results | sides (number), count (number) |
Note: tool name uses hyphen (roll-dice), not underscore.
Execution traces
Single d6 — 2ms
> callTool("roll-dice", {sides: 6, count: 1})
{"sides":6,"rolls":[5],"total":5}3d6 (classic stat roll) — 0ms
> callTool("roll-dice", {sides: 6, count: 3})
{"sides":6,"rolls":[4,1,5],"total":10}Single d20 (attack roll) — 0ms
> callTool("roll-dice", {sides: 20, count: 1})
{"sides":20,"rolls":[7],"total":7}2d12 — 0ms
> callTool("roll-dice", {sides: 12, count: 2})
{"sides":12,"rolls":[6,1],"total":7}d100 (percentile) — 0ms
> callTool("roll-dice", {sides: 100, count: 1})
{"sides":100,"rolls":[69],"total":69}10d6 (fireball damage) — 1ms
> callTool("roll-dice", {sides: 6, count: 10})
{"sides":6,"rolls":[1,2,5,3,3,1,5,1,3,5],"total":29}5d2 (coin flips) — 0ms
> callTool("roll-dice", {sides: 2, count: 5})
{"sides":2,"rolls":[2,2,1,2,2],"total":9}4d4 — 1ms
> callTool("roll-dice", {sides: 4, count: 4})
{"sides":4,"rolls":[2,4,2,1],"total":9}Output format
Structured JSON with three fields:
sides: echoed back for contextrolls: array of individual die results (each 1–sides inclusive)total: sum of all rolls
Gotchas
- Tool name is
roll-dice(hyphen), NOTroll_dice(underscore) — using the wrong name gives MCP error -32602. - No modifier/bonus parameter — add-on math must be done by the caller.
- No NdS dice notation parser — use
sidesandcountseparately. For NdS notation, see @mukundakatta/dice-mcp instead.
{ "install": "npm install --prefix /tmp/roll-dice-mcp-test [email protected]", "entry": "node node_modules/roll-the-dice-mcp/dist/cli.js", "transport": "stdio", "tools": ["roll-dice"], "sample_call": { "tool": "roll-dice", "args": { "sides": 20, "count": 1 }, "result": { "sides": 20, "rolls": [7], "total": 7 }, "latency_ms": 0 }, "total_calls": 8, "successes": 8, "avg_latency_ms": 1, "version": "1.0.0" }