Skip to main content
Glama
vandewilly

MCP Dice Roller

by vandewilly

MCP Dice Roller 🎲

A simple MCP (Model Context Protocol) server for rolling dice. Perfect for tabletop games, random decisions, and more!

Features

  • Standard Dice Notation - Roll any dice using notation like 2d6, 1d20+5, 3d8-2

  • Keep Highest/Lowest - Support for 4d6kh3 (keep highest 3) and 2d20kl1 (keep lowest)

  • D&D Stat Rolling - Quick character stat generation using 4d6 drop lowest

  • Coin Flips - Simple heads or tails

  • Random Picker - Choose randomly from a list of options

  • Percentile Dice - Roll d100 with tens and ones dice

Related MCP server: Dice MCP Server

Installation

pip install mcp-dice-roller

Usage

With Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "dice-roller": {
      "command": "python",
      "args": ["-m", "mcp_dice_roller"]
    }
  }
}

With VS Code

Add to your VS Code MCP settings:

{
  "mcp.servers": {
    "dice-roller": {
      "command": "python",
      "args": ["-m", "mcp_dice_roller"]
    }
  }
}

Tools

roll_dice

Roll dice using standard notation.

roll_dice("2d6")       → Roll two 6-sided dice
roll_dice("1d20+5")    → Roll d20 and add 5
roll_dice("4d6kh3")    → Roll 4d6, keep highest 3
roll_dice("2d20kl1")   → Roll 2d20, keep lowest (disadvantage)

Example Response:

{
  "notation": "2d6+3",
  "rolls": [4, 6],
  "kept": [4, 6],
  "subtotal": 10,
  "modifier": 3,
  "total": 13
}

roll_multiple

Roll the same dice multiple times with statistics.

roll_multiple("1d20", 5)  → Roll d20 five times

Example Response:

{
  "notation": "1d20",
  "times": 5,
  "totals": [15, 8, 20, 3, 12],
  "statistics": {
    "min": 3,
    "max": 20,
    "sum": 58,
    "average": 11.6
  }
}

roll_dnd_stats

Generate D&D 5e character ability scores.

Example Response:

{
  "method": "4d6 drop lowest",
  "stats": [
    {"rolls": [4, 3, 5, 6], "kept": [4, 5, 6], "total": 15},
    {"rolls": [2, 4, 4, 3], "kept": [3, 4, 4], "total": 11},
    ...
  ],
  "totals": [15, 11, 14, 13, 10, 16],
  "sum": 79
}

flip_coin

Flip a coin.

flip_coin()      → Flip once
flip_coin(10)    → Flip 10 times

pick_random

Pick randomly from options.

pick_random("pizza, burger, sushi, tacos")

Example Response:

{
  "options": ["pizza", "burger", "sushi", "tacos"],
  "selected": "sushi",
  "total_options": 4
}

roll_percentile

Roll d100 (percentile dice).

Example Response:

{
  "tens_die": 7,
  "ones_die": 3,
  "result": 73
}

Development

Setup

# Clone the repository
git clone https://github.com/vandewilly/mcp-dice-roller.git
cd mcp-dice-roller

# Install dependencies
pip install -e ".[dev]"

# Run tests
pytest

Running Locally

python -m mcp_dice_roller

MCP Registry

MCP Name: io.github.vandewilly/dice-roller

This server is published to the MCP Registry.

License

MIT License - see LICENSE for details.

Author

Vandewilly Silva (@vandewilly)

Available Tools

6 tools
flip_coinA

Flip a coin one or more times.

Args: times: Number of times to flip (1-100)

Returns: Results of the coin flip(s)

ParametersJSON Schema
NameRequiredDescriptionDefault
timesNo

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden. It states coin flipping returns results but omits details like randomness quality, side effects, or return format. For a trivial tool this is adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and structured with Args/Returns, but the Args section is somewhat redundant for a single parameter. Still, it is clear and to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 parameter, no output schema, no nested objects), the description covers the core action, parameter, and return value. It could mention independence of flips or randomness source, but it is mostly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but the description adds the allowed range (1-100) for the 'times' parameter, which is not in the schema. This compensates well, though only one parameter exists.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Flip') and resource ('a coin') with optional repetition, clearly distinguishing it from siblings like roll_dice or pick_random.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies coin-flipping use but does not explicitly contrast with alternatives (e.g., when to use this vs. roll_dice for random numbers). No exclusions or prerequisites are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

pick_randomA

Pick a random option from a comma-separated list.

Args: options: Comma-separated list of options (e.g., "pizza, burger, sushi")

Returns: The randomly selected option

ParametersJSON Schema
NameRequiredDescriptionDefault
optionsYes

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It states the operation and return value but does not disclose randomness quality, edge case handling (e.g., empty list), or side effects. The description is minimally adequate for a simple tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, consisting of a single line plus structured Args/Returns sections. It is front-loaded and contains no unnecessary verbiage, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema), the description covers the input format and return value adequately. It could mention edge cases, but it is sufficient for typical usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, but the description adds meaning by explaining that 'options' is a comma-separated list with an example ('pizza, burger, sushi'). This clarifies the format beyond the schema's type string.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Pick a random option from a comma-separated list,' specifying the action (pick), resource (random option), and input format (comma-separated list). This distinguishes it from siblings like flip_coin or roll_dice, which involve specific randomization contexts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implicitly tells when to use: when you have a comma-separated list to randomize. However, it does not explicitly exclude cases like empty lists or provide comparisons to sibling tools, but the context is clear enough for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

roll_diceB

Roll dice using standard dice notation (e.g., '2d6', '1d20+5', '3d8-2').

Args: notation: Dice notation string. Examples: - '1d6' - Roll one 6-sided die - '2d6' - Roll two 6-sided dice - '1d20+5' - Roll one 20-sided die and add 5 - '3d8-2' - Roll three 8-sided dice and subtract 2 - '4d6kh3' - Roll 4d6, keep highest 3 (D&D stat rolling) - '2d20kl1' - Roll 2d20, keep lowest 1 (disadvantage)

Returns: Dictionary with rolls, modifier, and total

ParametersJSON Schema
NameRequiredDescriptionDefault
notationNo1d6

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Only states it rolls dice and returns a dictionary. Does not disclose side effects, idempotency, or error handling. A simple roll operation, but lacks transparency on edge cases (e.g., invalid notation).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is clear and well-structured with summary, Args, and Returns sections. Every sentence adds value, no fluff. Efficiently conveys purpose and param usage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given a simple tool with one param and no output schema, the description is fairly complete. It covers notation, examples, and return structure. Could mention error handling but acceptable for this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 1 param 'notation' with 0% description coverage. Description compensates with detailed examples covering various use cases (keep highest, disadvantage). Adds meaning beyond schema, though does not explain default value or validation rules.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'Roll' and resource 'dice' with standard dice notation. Examples clarify scope but no explicit differentiation from sibling tools like roll_dnd_stats, which also uses similar notation. Still, the purpose is well-defined.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Describes how to use the tool (dice notation) but provides no guidance on when to choose this tool over siblings like roll_dnd_stats, roll_multiple, or roll_percentile. No exclusions or alternatives mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

roll_dnd_statsA

Roll a set of D&D 5e character stats using the standard 4d6 drop lowest method.

Returns: Six ability scores rolled using 4d6, dropping the lowest die

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses the rolling method (4d6 drop lowest) and that it returns six ability scores. This is sufficient for a straightforward stat roller, though it could mention that it uses simulated dice rolls.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with only two sentences, no filler, and the key information is front-loaded. Every word adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema), the description adequately explains what it does and what it returns. It is complete enough for an agent to understand and invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so the description cannot add parameter-level meaning. The baseline for 0-parameter tools is 4, and the description does not need to compensate further.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool rolls D&D 5e character stats using the standard 4d6 drop lowest method. It clearly identifies the verb (roll), resource (D&D stats), and method, distinguishing it from siblings like roll_dice or roll_multiple.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide guidance on when to use this tool versus alternatives like roll_dice or roll_multiple. It lacks explicit when-to-use or when-not-to-use context, requiring the agent to infer the intended use case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

roll_multipleB

Roll the same dice multiple times.

Args: notation: Dice notation (e.g., '1d20+5') times: Number of times to roll (1-20)

Returns: Dictionary with all roll results and statistics

ParametersJSON Schema
NameRequiredDescriptionDefault
timesNo
notationNo1d6

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, and the description does not disclose behavioral traits beyond the obvious fact that rolling dice is non-destructive. It fails to mention any side effects, safety, or potential errors (e.g., domain of results).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise, with a clear one-line purpose and structured Args/Returns sections. No unnecessary words; every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and absence of output schema, the description adequately covers parameters and return format. However, the return dictionary could be more specific (e.g., what statistics are included), but it is still sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning to both parameters: for 'times' it specifies a range (1-20) not in the schema, and for 'notation' it provides an example ('1d20+5'). It also describes the return value as a dictionary with results and statistics, which is absent from the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Roll the same dice multiple times,' which directly conveys the tool's action. It distinguishes from siblings like roll_dice (single roll) and roll_dnd_stats (different purpose), though it could explicitly mention when to use this over roll_dice.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. It does not state that this is for repeated rolls of the same notation, nor does it mention any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

roll_percentileA

Roll percentile dice (d100).

Returns: A random number from 1 to 100

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description carries full burden. It discloses the return value (random number 1-100) and the action (rolling d100). No hidden behaviors, but could note uniformity or randomness source.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, directly stating what the tool does and its return. No fluff, front-loaded, and every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters, no output schema, and simple behavior, the description covers all necessary information. No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters, schema coverage 100%. The description adds no parameter info beyond what is inherent (no params). Baseline 4 applies as no parameter explanation needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it rolls percentile dice (d100) and returns a random number 1-100. This is a specific verb and resource, distinguishing it from siblings like flip_coin (binary) and roll_dice (other dice types).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use vs alternatives like roll_dice or pick_random. The purpose is clear, but without explicit usage context, the agent must infer from the name and siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 6 tool updatesv0.1.0
    • First observedflip_coin
    • First observedpick_random
    • First observedroll_dice
    • First observedroll_dnd_stats
    • First observedroll_multiple
    • First observedroll_percentile

TDQS

A4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: coin flip, random pick from list, dice rolling, D&D stats, repeated rolls, and percentile. No overlap in functionality.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using snake_case: flip_coin, pick_random, roll_dice, roll_dnd_stats, roll_multiple, roll_percentile.

Tool Count5/5

6 tools is appropriate for a dice roller server, covering basic and advanced rolling needs without being excessive or insufficient.

Completeness5/5

The tool set covers standard dice rolling, percentile, D&D stat generation, repeated rolls, coin flips, and random selection. No obvious gaps for its domain.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    A simple demonstration MCP server that provides basic utility tools including dice rolling and number addition functionality. This server serves as a tutorial example for setting up both local and remote MCP servers using FastMCP.
    3
    -
  • 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.
    2
    MIT
  • F
    license
    B
    quality
    B
    maintenance
    An MCP server that provides 18 tools for dice rolling, luck tests, character management, world state, combat, and save/load, enabling an AI game master to run a solo-play gamebook entirely through deterministic game logic.
    18
    1
    -

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/vandewilly/mcp-dice-roller'

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