Skip to main content

mcp-dice: A MCP Server for Rolling Dice

screenshot

A Model Context Protocol (MCP) server that enables Large Language Models (LLMs) to roll dice. It accepts standard dice notation (e.g., 1d20) and returns both individual rolls and their sum.

Features

  • Supports standard dice notation (e.g., 1d20, 3d6, 2d8+1)
  • Returns both individual rolls and the total sum
  • Easy integration with Claude Desktop
  • Compatible with MCP Inspector for debugging

Installation

# Install using uv
uv pip install mcp-dice

Usage

Basic Command Line Usage

# Using uvx
uvx mcp-dice

Input Format

The server accepts a JSON object with a notation field:

{
  "notation": "2d6+3"
}

Example responses:

{
  "rolls": [
    3,
    1
  ],
  "sum": 4,
  "modifier": 3,
  "total": 7,
  "notation": "2d6+3",
  "timestamp": "2024-12-03T16:36:38.926452"
}

Claude Desktop Configuration

Location

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

Examples

macOS Configuration
{
  "mcpServers": {
    "dice_service": {
      "command": "uvx",
      "args": ["mcp-dice"]
    }
  }
}
WSL Configuration
{
  "mcpServers": {
    "dice": {
      "command": "wsl",
      "args": [
        "-e",
        "zsh",
        "-lc",
        "uvx mcp-dice"
      ]
    }
  }
}

Note: Replace zsh with your login shell.

Development and Debugging

Installing Development Dependencies

# Clone the repository
git clone https://github.com/yourusername/mcp-dice
cd mcp-dice

# Install development dependencies
uv pip install -e ".[dev]"

Running Tests

uv run pytest

Using MCP Inspector

The MCP Inspector is a useful tool for debugging your MCP server. Install and run it using npm:

npx @modelcontextprotocol/inspector uvx mcp-dice

Claude Desktop Configuration for Development

macOS Configuration (local dev) ```json { "mcpServers": { "dice_service": { "command": "uv", "args": [ "run", "--directory", "path/to/mcp-dice-repo mcp-dice" ] } } } ```
Windows (WSL) Configuration (local dev)
{
  "mcpServers": {
    "dice": {
      "command": "wsl",
      "args": [
        "-e",
        "zsh",
        "-lc",
        "uv run --directory path/to/mcp-dice-repo mcp-dice"
      ]
    }
  }
}

Note: Replace zsh with your login shell.

Metadata

Release files for mcp-dice 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-dice 0.1.2
File Size Uploaded Provenance
mcp_dice-0.1.2.tar.gz 22.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-dice 0.1.2
File Interpreter ABI Platform
mcp_dice-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 27.8 kB

Release files / mcp_dice-0.1.2.tar.gz

Download URL mcp_dice-0.1.2.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7a6d1502ccb3220f8ea39ba4abe7f67d96e4e63fcde086d5ec75b96ef3c2231b
BLAKE2b-256 checksum
How to use checksums
c39d7fa3c9b8fdf9985126ed35682dac70fbee1a1466e614f6f619700b52eba2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.5

Release files / mcp_dice-0.1.2-py3-none-any.whl

Download URL mcp_dice-0.1.2-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f0b7790a6f1927182ede9acea62ee820141a9e56d2e703cde46ce49329705345
BLAKE2b-256 checksum
How to use checksums
6127c2e50ccd6146467d3de3ef18ab79b2c2c39bec9c4aad1c624aefc323ae13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.5

Security for mcp-dice 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page