mcp-dice
mcp-dice:用于掷骰子的 MCP 服务器
一个模型上下文协议 (MCP) 服务器,支持大型语言模型 (LLM) 掷骰子。它接受标准骰子符号(例如1d20 ),并返回每次掷骰结果及其和。
特征
支持标准骰子符号(例如
1d20、3d6、2d8+1)返回单个掷骰结果和总和
轻松与 Claude Desktop 集成
兼容 MCP Inspector 进行调试
Related MCP server: Globalping
安装
通过 Smithery 安装
要通过Smithery自动安装 Dice Roller for Claude Desktop:
npx @smithery/cli install mcp-dice --client claude使uv可用: https://docs.astral.sh/uv/getting-started/installation/
用法
基本命令行用法
# Using uvx
uvx mcp-dice输入格式
服务器接受带有notation字段的 JSON 对象:
{
"notation": "2d6+3"
}示例响应:
{
"rolls": [
3,
1
],
"sum": 4,
"modifier": 3,
"total": 7,
"notation": "2d6+3",
"timestamp": "2024-12-03T16:36:38.926452"
}Claude桌面配置
地点
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.json
示例
{
"mcpServers": {
"dice": {
"command": "uvx",
"args": ["mcp-dice"]
}
}
}{
"mcpServers": {
"dice": {
"command": "wsl",
"args": [
"-e",
"zsh",
"-lc",
"uvx mcp-dice"
]
}
}
}注意:用您的登录 shell 替换zsh 。
开发与调试
安装开发依赖项
# Clone the repository
git clone https://github.com/yourusername/mcp-dice
cd mcp-dice
# Install development dependencies
uv pip install -e ".[dev]"运行测试
uv run pytest使用 MCP 检查器
MCP Inspector是一款用于调试 MCP 服务器的实用工具。使用 npm 安装并运行它:
npx @modelcontextprotocol/inspector uvx mcp-diceClaude 桌面开发配置
{
"mcpServers": {
"dice": {
"command": "uv",
"args": [
"run",
"--directory",
"path/to/mcp-dice-repo",
"mcp-dice"
]
}
}
}注意:将path/to/mcp-dice-repo替换为文件系统上存储库的路径。
{
"mcpServers": {
"dice": {
"command": "wsl",
"args": [
"-e",
"zsh",
"-lc",
"uv run --directory path/to/mcp-dice-repo mcp-dice"
]
}
}
}注意:请将zsh替换为您的登录 shell。另外,请将path/to/mcp-dice-repo替换为您的 WSL 文件系统上的存储库路径。
Available Tools
1 toolroll_diceA
Roll dice using standard notation (e.g., '2d6+3', '1d20-2')
Inputs: notation (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'roll_dice' has a clearly distinct purpose that cannot be confused with any other tool in this set.
The naming follows a consistent verb_noun pattern with 'roll_dice', and since there is only one tool, there is no inconsistency to evaluate. The naming is clear and predictable for this single-tool server.
A single tool is generally too few for most server purposes, as it limits functionality and can feel thin. For a dice-rolling server, while the core operation is covered, additional tools like rolling multiple dice types or retrieving roll history could enhance completeness, making the count borderline inappropriate.
The tool covers the basic dice-rolling functionality well, but there are notable gaps. For example, there are no tools for listing available dice types, saving roll results, or performing statistical analysis on rolls, which could be expected in a more comprehensive dice-rolling domain.
Maintenance
Related MCP Connectors
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that provides LLMs access to other LLMs456 npm83MIT

Globalpingofficial
FlicenseNot gradedqualityCmaintenanceRemote MCP server that gives LLMs access to run network commands66-- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI agents to act as dynamic dungeon masters for text-based RPGs with dynamically generated rule systems and comprehensive game state management.15MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server enabling AI agents to autonomously play D\&D as players and Dungeon Masters, with real dice rolls and full campaign management.3MIT