adhnanasharaf/Dice_Rolling_custom_build_MCP_Server
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.
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 coinsdnd_ability_scores- Generate D&D ability scores using various methodsdnd_spell_damage- Calculate D&D spell damage with level scalingadvantage_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 mcpcommand)
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
- Add the function to dice_server.py
- Decorate with @mcp.tool()
- Update the catalog entry with the new tool name
- Rebuild the Docker image
Troubleshooting
Tools Not Appearing
- Verify Docker image built successfully
- Check catalog and registry files
- Ensure Claude Desktop config includes custom catalog
- Restart Claude Desktop
Dice Notation
The server supports standard dice notation:
1d6- Roll one six-sided die2d10- Roll two ten-sided dice1d20+5- Roll a twenty-sided die and add 53d8-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