Skip to main content
Glama
MCP Dice Roller

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)

Inputs: times.

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

Inputs: options (required).

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

Inputs: notation.

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

Inputs: no named parameters.

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

Inputs: times, notation.

roll_percentileA

Roll percentile dice (d100).

Returns: A random number from 1 to 100

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    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
    ResponsivenessNo recent community issues

    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