Coin Flip MCP 随机硬币生成器

@TeglonLabs/coin-flip-mcp
0 Stars 363 次浏览 TeglonLabs 更新于 2026-08-23

启用与通过 random.org API 生成真正随机硬币正反面的工具进行交互,支持多种自定义侧面配置,并阐述模型上下文协议。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "coin-flip": {
      "args": [
        "-y",
        "@modelcontextprotocol/server-coin-flip"
      ],
      "command": "npx"
    }
  }
}

可用工具 (1 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

flip_coin 2 个参数

Flip a coin with n sides using true randomness from random.org. For 3-sided coins, try creative side names like: - past/present/future (temporal analysis) - true/unknown/false (epistemic states) - win/draw/lose (outcome evaluation) - rock/paper/scissors (cyclic relationships) - less/same/more (abstraction levels) - below/within/above (hierarchical positioning) - predecessor/current/successor (ordinal progression) Meta-usage patterns: 1. Use less/same/more to guide abstraction level of discourse 2. Use past/present/future to determine temporal focus 3. Chain multiple flips to create decision trees 4. Use predecessor/current/successor for ordinal analysis Ordinal Meta-patterns: - Use predecessor to refine previous concepts - Use current to stabilize existing patterns - Use successor to evolve into new forms Default ternary values are -/0/+

该工具无需必填参数,直接调用即可

服务介绍

Coin Flip MCP 服务器

一个使用 random.org 的随机性 API 提供真正随机抛硬币结果的 MCP 服务器。此服务器通过提供一种生成具有可配置面数的随机结果的工具来展示模型上下文协议。

功能

工具

  • flip_coin - 抛掷一个具有可配置面数的硬币
    • 可选的 sides 参数(默认值:2)
    • 使用来自 random.org 的真实随机性
    • 对边缘情况(0、1 或负数面)进行特殊处理
    • 当有 2 面时:返回 "正面" 或 "反面"
    • 当有 3 面时:返回 "正面"、"反面" 或 "_"
    • 当 n>3 面时:返回 "它落在了第 X 面"

开发

安装依赖项:

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"]
    }
  }
}

示例用法

一旦连接到如 Claude Desktop 这样的 MCP 客户端,您可以使用自然语言与抛硬币工具交互。例如:

  • "抛一枚硬币"
  • "掷一个 6 面骰子"
  • "给我一个 1 到 20 之间的随机数"

服务器将使用来自 random.org 的真实随机性生成结果。

调试

由于 MCP 服务器通过标准输入输出通信,调试可能会比较困难。我们推荐使用 MCP 检查器

npx @modelcontextprotocol/inspector node build/index.js

贡献

欢迎贡献!请随时提交 Pull Request。

许可证

MIT

相关 MCP 服务