home / mcp / dice rolling mcp server
A TypeScript-based Model Context Protocol (MCP) server providing comprehensive dice rolling capabilities with advanced gaming mechanics
Configuration
View docs{
"mcpServers": {
"jimmcq-dice-rolling-mcp": {
"url": "https://dice-rolling-mcp.vercel.app/mcp"
}
}
}This MCP server provides cryptographically secure dice rolling for AI assistants through a simple, standards-compliant interface. It supports standard and advanced dice mechanics, giving your AI-powered workflows true randomness for gaming, simulations, and decision-making that requires reliable probability results.
You connect an MCP client to either a remote HTTP endpoint or a local STDIO server to start making dice rolls. When you prompt your AI with a dice expression, the server parses the notation, computes results using secure random numbers, and returns a structured result you can display or analyze. You can use standard notation like 3d6+2, add modifiers, combine dice types, and apply advanced mechanics such as advantage, exploding dice, rerolls, and success counting. Tools are available to search for dice operations, fetch detailed topics, and execute or validate rolls.
# Prerequisites
node >= 18
npm >= 6
# Install and build
git clone https://github.com/jimmcq/dice-rolling-mcp
cd dice-rolling-mcp
npm install
npm run buildThere are two primary methods to connect to this MCP server: a remote HTTP endpoint for streams over the network, and a local STDIO configuration suitable for desktop integrations. Use the remote path when your client supports HTTP MCP connections. Use the local STDIO path when you run the server on your machine and want to connect via a local I/O channel.
Remote HTTP endpoint (production URL): use this URL in your MCP client configuration to connect over HTTP.
Local STDIO configuration (for Claude Desktop or similar clients) uses a command that runs the MCP server locally and communicates via standard input/output.
The server uses cryptographically secure randomness for all dice results, preventing predictability and ensuring gaming integrity. It validates inputs to reject malformed expressions and enforces resource limits to avoid excessive computation. The architecture is modular to support future dice mechanics and maintains strict type safety with TypeScript.
Basic roll: Roll 3d6+2 for damage.
Advantage roll: Roll 2d20kh1 (keep highest) with a modifier.
Two integration methods are supported: a remote HTTP transport and a local STDIO transport. The remote endpoint is exposed for production use, while the local STDIO flow is suitable for desktop clients that launch the MCP server as a child process.
A complete test suite validates notation parsing, execution with mocked randomness, edge cases, and MCP protocol readiness. Development builds produce a dist output that can be started in standalone mode.
Discovers available dice rolling operations and documentation. Enables integration with chat assistants and remote MCP clients.
Retrieves detailed content for a specific topic by ID, enabling rich UI rendering and programmatic access to topics.
Executes dice rolls using standard notation with optional labeling and verbose output. Returns both human-readable results and structured data.
Validates dice notation without rolling, providing a structured breakdown of the expression and any errors.