Dice Roller MCP Server

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.

Category
Visit Server

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 results
  • roll_dice - Roll using standard NdM+K notation (e.g. 2d6, 1d20+5, 4d8-2)
  • roll_advantage - Roll with advantage (2x, take higher) for DnD 5e
  • roll_disadvantage - Roll with disadvantage (2x, take lower) for DnD 5e
  • roll_stats - Generate a full DnD character stat block (4d6 drop lowest x6)
  • roll_initiative - Roll initiative (1d20 + modifier) for DnD combat
  • roll_custom - Roll any count/sides/modifier combo with an optional label
  • roll_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 mcp command)

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

  1. Add an async function to dice_roller_server.py
  2. Decorate with @mcp.tool()
  3. Single-line docstring only
  4. All params default to empty string ""
  5. Return a formatted string
  6. Add tool name to custom.yaml catalog
  7. 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

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.

Official
Featured
Python
graphlit-mcp-server

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.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured