硬币翻转MCP服务器
使用random.org API提供真随机硬币翻转的MCP服务器,支持自定义面数。
快速入门
功能特点
- 提供可配置面数的硬币翻转功能
- 使用random.org真随机性
- 支持2面、3面及更多面的翻转结果
安装与运行
- 克隆仓库:
git clone https://github.com/TeglonLabs/coin-flip-mcp.git
- 安装依赖:
npm install
- 构建项目:
npm run build
- 启动开发模式(自动重建):
npm run watch
配置
在Claude Desktop中添加以下配置到对应系统的配置文件:
- MacOS路径:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows路径:
%APPDATA%/Claude/claude_desktop_config.json
配置内容:
{
"mcpServers": {
"coin-flip": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-coin-flip"]
}
}
}
示例用法
连接客户端后,可以使用自然语言交互,例如:
- "Flip a coin"
- "Roll a 6-sided die"
调试
推荐使用MCP Inspector进行调试:
npx @modelcontextprotocol/inspector node build/index.js
贡献
欢迎提交Pull Request参与贡献。