Dice Roller MCP server

Provides cryptographically secure dice rolling with standard notation and Fate/Fudge dice support for tabletop RPGs and games requiring reliable random number generation.
Back to servers
Setup instructions
Provider
Luke Bayliss
Release date
May 20, 2025
Stats
2 stars

The Model Context Protocol (MCP) server for dice rolls lets you simulate dice rolling with standard dice notation and Fate/Fudge dice. This server integrates with MCP-compatible clients to provide accurate random dice rolling capabilities with full validation.

Features

  • Parse standard dice notation strings like 2d6, 1d20+5, or 4dF
  • Support for standard dice and Fate/Fudge dice
  • Generate random dice rolls with accurate probability distributions
  • Full input and output validation using Zod schemas
  • Seamless integration with MCP-compatible clients like Claude Desktop

Installation

Using with Claude Desktop

Add this server to your Claude Desktop configuration:

{
  "mcpServers": {
    "dice": {
      "command": "npx",
      "args": ["-y", "server-dice-roll"]
    }
  }
}

Using with npm/npx

# Install globally
npm install -g server-dice-roll

# Run the server
mcp-server-dice-roll

# Or run directly with npx
npx server-dice-roll

Usage

The MCP server provides two main tools:

Parse Dice Notation

This tool parses a dice notation string and returns its structured representation:

parse_dice_roll_notation
  input: { notation: "3d6+4" }
  output: { type: "standard", count: 3, sides: 6, modifier: 4 }

Roll Dice

This tool rolls dice based on a configuration and returns the results:

dice_roll
  input: { type: "standard", count: 3, sides: 6, modifier: 4 }
  output: { rolls: [5, 2, 6], total: 17, original: "3d6+4" }

Understanding Dice Notation

Standard Notation

The standard format is NdS+M where:

  • N is the number of dice to roll (optional, defaults to 1)
  • d indicates a die roll
  • S is the number of sides on each die
  • +M is a modifier to add to the total (optional)

Examples:

  • d6 - Roll one 6-sided die
  • 2d10 - Roll two 10-sided dice and sum the results
  • 3d8+5 - Roll three 8-sided dice, sum the results, and add 5

Fate/Fudge Dice

Fate dice (also known as Fudge dice) are special 6-sided dice with values of -1, 0, and +1 (two sides each).

Format: NdF where:

  • N is the number of dice to roll
  • dF indicates Fate dice

Example:

  • 4dF - Roll four Fate dice (results in values between -4 and +4)

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "dice" '{"command":"npx","args":["-y","server-dice-roll"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "dice": {
            "command": "npx",
            "args": [
                "-y",
                "server-dice-roll"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "dice": {
            "command": "npx",
            "args": [
                "-y",
                "server-dice-roll"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later