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.
2d6
, 1d20+5
, or 4dF
Add this server to your Claude Desktop configuration:
{
"mcpServers": {
"dice": {
"command": "npx",
"args": ["-y", "server-dice-roll"]
}
}
}
# Install globally
npm install -g server-dice-roll
# Run the server
mcp-server-dice-roll
# Or run directly with npx
npx server-dice-roll
The MCP server provides two main tools:
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 }
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" }
The standard format is NdS+M
where:
N
is the number of dice to roll (optional, defaults to 1)d
indicates a die rollS
is the number of sides on each die+M
is a modifier to add to the total (optional)Examples:
d6
- Roll one 6-sided die2d10
- Roll two 10-sided dice and sum the results3d8+5
- Roll three 8-sided dice, sum the results, and add 5Fate 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 rolldF
indicates Fate diceExample:
4dF
- Roll four Fate dice (results in values between -4 and +4)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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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