MCP Riddle Game Server MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add --transport http mcp-riddle "http://<server-ip>:48080/sse"
README.md

A Starlette-based MCP riddle game service supporting HTTP and SSE.

MCP Riddle Game Server

一个基于 Starlette 的 MCP 猜谜游戏服务,支持 HTTP POSTSSE 两种通信方式。

功能

  • 提供 4 个 MCP 工具:
    • get_riddle_random:获取谜语(random / sequential / category
    • get_riddle_answer:校验答案
    • list_categories:列出分类
    • get_riddle_count:谜语统计
  • 支持从 riddles.json 加载数据
  • 可通过环境变量 RIDDLES_JSON 覆盖谜语库

项目结构

mcp-riddle/
├── server_sse.py
├── riddles.json
├── requirements.txt
├── Dockerfile
├── DEPLOY.md
└── README.md

本地运行

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python server_sse.py

启动后默认监听 0.0.0.0:8000

接口

  • SSE: GET /sse
  • MCP 消息: POST /messages
  • 健康检查: GET /health

兼容端点(用于部分第三方 Agent):

  • GET /mcp(SSE 别名)
  • POST /sse(部分平台会对同一路径发消息)
  • POST /sse/messages(SSE 消息别名)
  • POST /mcp(单路径兼容)

健康检查示例

curl http://127.0.0.1:8000/health

HTTP 模式调用示例

curl -X POST http://127.0.0.1:8000/messages \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
curl -X POST http://127.0.0.1:8000/messages \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_riddle_random","arguments":{"mode":"sequential"}}}'

Docker

docker build -t mcp-riddle .
docker run -d --name mcp-riddle-server -p 48080:8000 --restart always mcp-riddle
curl http://127.0.0.1:48080/health

AI Agent 接入

SSE 方式

{
  "mcpServers": {
    "riddle-game": {
      "url": "http://<server-ip>:48080/sse",
      "transport": "sse"
    }
  }
}

如果平台只允许填一个端点路径,优先使用 /mcp

HTTP 方式

{
  "mcpServers": {
    "riddle-game": {
      "url": "http://<server-ip>:48080/messages",
      "transport": "http"
    }
  }
}

Tools (4)

get_riddle_randomFetches a riddle using random, sequential, or category-based modes.
get_riddle_answerVerifies the answer to a specific riddle.
list_categoriesLists all available riddle categories.
get_riddle_countProvides statistics on the total number of riddles.

Environment Variables

RIDDLES_JSONPath to a custom JSON file to override the default riddle library.

Configuration

claude_desktop_config.json
{"mcpServers": {"riddle-game": {"url": "http://<server-ip>:48080/sse", "transport": "sse"}}}

Try it

Give me a random riddle to solve.
List all the riddle categories available.
I want to play a riddle in sequential order.
Check if 'apple' is the correct answer for riddle ID 101.
How many riddles are currently in the database?

Frequently Asked Questions

What are the key features of MCP Riddle Game Server?

Supports both HTTP POST and SSE communication protocols. Provides four distinct tools for riddle retrieval and verification. Allows custom riddle libraries via JSON file configuration. Includes built-in health check endpoints for monitoring. Compatible with various AI agents and MCP clients.

What can I use MCP Riddle Game Server for?

Integrating a fun, interactive game element into AI chat sessions. Testing MCP server connectivity and tool execution capabilities. Building custom riddle-based educational or entertainment applications. Demonstrating SSE and HTTP transport methods for MCP servers.

How do I install MCP Riddle Game Server?

Install MCP Riddle Game Server by running: python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt && python server_sse.py

What MCP clients work with MCP Riddle Game Server?

MCP Riddle Game Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Riddle Game Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare