Dice Roller MCP Server
Provides comprehensive dice rolling, coin flipping, and tabletop RPG mechanics for AI assistants like Claude. It enables real-time tabletop gaming through features such as standard NdM notation, advantage/disadvantage rolls, and D\&D character stat generation.
README
Dice Roller MCP Server
A Model Context Protocol (MCP) server that provides dice rolling, coin flipping, and full DnD/tabletop RPG mechanics for AI assistants.
Purpose
This MCP server gives Claude (or any MCP-compatible AI) the ability to roll dice, flip coins, and run tabletop RPG mechanics in real-time with true randomness.
Features
flip_coin- Flip one or more coins, get Heads/Tails resultsroll_dice- Roll using standard NdM+K notation (e.g. 2d6, 1d20+5, 4d8-2)roll_advantage- Roll with advantage (2x, take higher) for DnD 5eroll_disadvantage- Roll with disadvantage (2x, take lower) for DnD 5eroll_stats- Generate a full DnD character stat block (4d6 drop lowest x6)roll_initiative- Roll initiative (1d20 + modifier) for DnD combatroll_custom- Roll any count/sides/modifier combo with an optional labelroll_percentile- Roll a percentile die (d100)roll_drop_lowest- Roll NdM and drop the lowest result
Prerequisites
- Docker Desktop with MCP Toolkit enabled
- Docker MCP CLI plugin (
docker mcpcommand)
Installation
See INSTALLATION section at the bottom of this file, or follow the numbered steps provided when you received these files.
Usage Examples
In Claude Desktop, you can ask:
- "Roll a d20 with +5 modifier"
- "Flip 3 coins"
- "Roll 2d6+3 for damage"
- "Roll my DnD character stats"
- "Roll initiative with +2 dex"
- "Roll with advantage on a d20"
- "Roll 4d6 drop lowest for strength"
- "Roll a percentile die"
- "Roll 3d8 for my fireball damage, label it Fireball"
Architecture
Claude Desktop -> MCP Gateway -> Dice Roller MCP Server (Docker)
No external API or secrets needed. Pure Python random module.
Development
Local Testing
# Run directly (no Docker needed for testing)
python dice_roller_server.py
# Test MCP protocol
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | python dice_roller_server.py
Adding New Tools
- Add an async function to dice_roller_server.py
- Decorate with @mcp.tool()
- Single-line docstring only
- All params default to empty string ""
- Return a formatted string
- Add tool name to custom.yaml catalog
- Rebuild Docker image: docker build -t dice-roller-mcp-server .
Troubleshooting
- Tools not appearing? Verify Docker image built, check catalog/registry files, restart Claude Desktop.
- Gateway panic? Ensure all docstrings are single-line only.
- Wrong results? All randomness uses Python's secrets-seeded random — it's fair!
Security
- No API keys required
- Running as non-root user in Docker
- No network access needed
License
MIT License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.