Dice_Rolling_custom_build_MCP_Server

adhnanasharaf/Dice_Rolling_custom_build_MCP_Server

3.1

If you are the rightful owner of Dice_Rolling_custom_build_MCP_Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Dice Roller MCP Server is a Model Context Protocol server designed to facilitate dice rolling and D&D mechanics for AI assistants.

Tools
7
Resources
0
Prompts
0

Dice Roller MCP Server

A Model Context Protocol (MCP) server that provides comprehensive dice rolling, coin flipping, and D&D mechanics for AI assistants.

Purpose

This MCP server provides a secure interface for AI assistants to perform various dice rolling operations, from simple coin flips to complex D&D spell damage calculations.

Features

Current Implementation

  • roll - Roll dice using standard notation (1d6, 2d10+3, etc.)
  • coin_flip - Flip one or multiple coins
  • dnd_ability_scores - Generate D&D ability scores using various methods
  • dnd_spell_damage - Calculate D&D spell damage with level scaling
  • advantage_roll - Roll with advantage (roll twice, take higher)
  • disadvantage_roll - Roll with disadvantage (roll twice, take lower)
  • random_number - Generate random numbers within specified ranges

Prerequisites

  • Docker Desktop with MCP Toolkit enabled
  • Docker MCP CLI plugin (docker mcp command)

Installation

See the step-by-step instructions provided with the files.

Usage Examples

In Claude Desktop, you can ask:

  • "Roll a d20 for my attack"
  • "Flip 3 coins"
  • "Generate ability scores for my D&D character"
  • "Roll damage for a 3rd level fireball"
  • "Roll with advantage on a stealth check"
  • "Give me a random number between 1 and 50"

Architecture

Claude Desktop → MCP Gateway → Dice Roller MCP Server
                                        ↓
                                 Random Number Generation

Development

Local Testing

# Run directly
python dice_server.py

# Test MCP protocol
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | python dice_server.py

Adding New Tools

  1. Add the function to dice_server.py
  2. Decorate with @mcp.tool()
  3. Update the catalog entry with the new tool name
  4. Rebuild the Docker image

Troubleshooting

Tools Not Appearing

  1. Verify Docker image built successfully
  2. Check catalog and registry files
  3. Ensure Claude Desktop config includes custom catalog
  4. Restart Claude Desktop

Dice Notation

The server supports standard dice notation:

  • 1d6 - Roll one six-sided die
  • 2d10 - Roll two ten-sided dice
  • 1d20+5 - Roll a twenty-sided die and add 5
  • 3d8-2 - Roll three eight-sided dice and subtract 2

D&D Features

Ability Score Generation

  • 4d6 drop lowest: Roll 4d6, drop the lowest die (default)
  • 3d6: Straight 3d6 rolls
  • Point buy: Shows point buy rules

Advantage/Disadvantage

  • Rolls two dice and takes the higher (advantage) or lower (disadvantage) result
  • Works with modifiers (e.g., "1d20+5")

Spell Damage

  • Automatically scales damage dice based on spell level
  • Special handling for spells like Fireball

Security Considerations

  • All randomization uses Python's built-in random module
  • Input validation prevents excessive computations
  • Running as non-root user
  • No external network access required

License

MIT License