Back to MCP directory
publicPublicdnsLocal runtime

janken-mcp-server

一个基于MCP协议的HTTP服务器,提供随机选择的じゃんけん游戏服务。

article

README

🚀 猜拳MCP服务器

猜拳MCP服务器是一个使用MCP协议提供“猜拳”游戏的简单HTTP服务器。它能让用户通过网络请求参与猜拳游戏,为游戏交互提供了便捷的方式。

✨ 主要特性

  • 基于MCP协议的请求/响应形式,确保与客户端的高效通信。
  • 随机返回“石头”“剪刀”“布”的选择,增加游戏的随机性和趣味性。
  • 支持CORS,方便跨域访问。

📦 安装指南

  1. 克隆此仓库:
    git clone <仓库URL>
    cd janken-mcp-server.js
    

💻 使用示例

基础用法

  1. 启动服务器:
    node janken-mcp-server.js
    
  2. 服务器默认在http://localhost:3000接收请求。
  3. 发送符合MCP协议的POST请求。示例:
    curl -X POST http://localhost:3000 -H "Content-Type: application/json" -d '{"query": "猜拳"}'
    
  4. 服务器响应示例:
    {
      "result": "石头",
      "metadata": {
        "choice": "石头"
      }
    }
    
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client