GR

gocallum/rolldice-mcpserver

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

0 stars 45 forks 质量 52 趋势 0

A beautiful web application and Model Context Protocol (MCP) server that brings dice rolling functionality directly to Claude Desktop. Built with Next.

概览

A beautiful web application and Model Context Protocol (MCP) server that brings dice rolling functionality directly to Claude Desktop. Built with Next.js, shadcn/ui, and the MCP Handler library with server actions for seamless web testing. - 🎲 : Support for any number of sides (minimum 2) - d4, d6, d20, d100, or custom - 🌐 : Modern, responsive UI with detailed setup instructions - 🔄 : Web interface uses the same logic as the MCP server - 🌙 : Toggle between themes with dark mode as default - 📋 : Easy configuration copying for Claude Desktop setup - 🔧 : Supports SSE, stdio, and other MCP transport protocols - 🚀 : Optimized for deployment on Vercel platform - 📱 : Works perfectly on desktop and mobile devices - 🧠 : Detailed explanations of MCP protocol and architecture Visit the live application: [Your Vercel URL here] The application will be available at: - : http://localhost:3000 (setup instructions, documentation, and testing) - : http://localhost:3000/api/[transport] (for...

README

以下为原文 README 节选,完整内容请查看原文。

🎲 Roll Dice MCP Server

A beautiful web application and Model Context Protocol (MCP) server that brings dice rolling functionality directly to Claude Desktop. Built with Next.js, shadcn/ui, and the MCP Handler library with server actions for seamless web testing.

✨ Features

  • 🎲 Roll Any Dice: Support for any number of sides (minimum 2) - d4, d6, d20, d100, or custom
  • 🌐 Beautiful Web Interface: Modern, responsive UI with detailed setup instructions
  • 🔄 Server Actions Integration: Web interface uses the same logic as the MCP server
  • 🌙 Dark/Light Mode: Toggle between themes with dark mode as default
  • 📋 Copy-to-Clipboard: Easy configuration copying for Claude Desktop setup
  • 🔧 Multiple Transports: Supports SSE, stdio, and other MCP transport protocols
  • 🚀 Vercel Ready: Optimized for deployment on Vercel platform
  • 📱 Responsive Design: Works perfectly on desktop and mobile devices
  • 🧠 Educational: Detailed explanations of MCP protocol and architecture

🖥️ Live Demo

Visit the live application: [Your Vercel URL here]

🚀 Quick Start

1. Clone and Install

git clone https://github.com/gocallum/rolldice-mcpserver.git
cd rolldice-mcpserver
npm install

2. Start Development Server

npm run dev

The application will be available at:

  • Web Interface: http://localhost:3000 (setup instructions, documentation, and testing)
  • MCP Endpoint: http://localhost:3000/api/[transport] (for Claude Desktop)

🤖 Setting Up with Claude Desktop

The web interface at http://localhost:3000 provides detailed, step-by-step instructions with copy-to-clipboard functionality. Here’s the quick version:

1. Install Claude Desktop

Download from claude.ai/download

2. Configure MCP Connection

Add this to your Claude Desktop config file:

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

{
  "mcpServers": {
    "rolldice": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "http://localhost:3000/api/mcp"
      ]
    }
  }
}

3. Restart Claude Desktop

Look for the hammer icon (🔨) in the input box - this indicates MCP tools are available!

4. Start Rolling!

Ask Claude natural language questions like:

  • “Roll a 6-sided die”
  • “Roll a d20 for my D&D character”
  • “Can you roll a 100-sided die?”

🏗️ How It Works

This application uses mcp-handler to provide seamless integration between web applications and AI assistants like Claude Desktop.

Architecture

Claude Desktop → Transport Protocol → /api/[transport] → Shared Dice Logic (/lib/dice.ts)
Web Interface → Server Actions → Shared Dice Logic (/lib/dice.ts)
在 GitHub 查看完整 README

安装

npx -y mcp-remote http://localhost:3000/api/mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "rolldice": { "command": "npx", "args": [ "-y", "mcp-remote", "http://localhost:3000/api/mcp" ] } } }