Skip to main content
Glama
lys1313013

mcp-server-demo

by lys1313013

mcp-server-demo

演示用 MCP Server(Python 3.13 + Streamable HTTP)。所有工具返回 Mock 数据, 并带有防伪标记(marker / data_source 字段),用于验证模型回答确实来自 MCP 而非自行编造。

工具列表

工具

说明

防伪设计

get_user_info(user_id)

查询用户信息(有效 ID:1001~1003)

用户名是模型猜不到的虚构值,且带 marker

list_users()

列出全部演示用户

同上

get_weather(city)

查天气,同一城市结果恒定(哈希生成)

天气状况是现实不存在的(如"樱花雪暴"),另带城市名决定的 weather_code

get_server_time()

服务器当前时间

故意使用非标准时间格式 ⏰...

防伪标记:marker = "🦄MCP-DEMO-α7f3c9",data_source = "MCP-SERVER-DEMO::MOCK-DB"。 模型正确回答里出现这些值,即证明数据来自本 server。

Related MCP server: idm-mcp

本地运行

pip install -r requirements.txt
python server.py
# MCP 端点: http://localhost:13316/mcp
# 健康检查: http://localhost:13316/health

Docker

镜像由 GitHub Actions 自动构建并推送到阿里云 ACR,直接拉取即可:

docker pull crpi-yvha9coypdedaafa.cn-beijing.personal.cr.aliyuncs.com/lys1313013/mcp-server-demo:latest
docker run -d -p 13316:13316 --name mcp-server-demo \
  crpi-yvha9coypdedaafa.cn-beijing.personal.cr.aliyuncs.com/lys1313013/mcp-server-demo:latest

或使用 docker compose(同样拉取 ACR 镜像):

docker compose up -d

如需本地自行构建:

docker build -t mcp-server-demo .

客户端接入

Claude Code:

claude mcp add --transport http mcp-server-demo http://localhost:13316/mcp

Claude Desktop(claude_desktop_config.json):

{
  "mcpServers": {
    "mcp-server-demo": {
      "type": "http",
      "url": "http://localhost:13316/mcp"
    }
  }
}

验证方式

接入后问模型:「查一下用户 1001 的信息」或「北京天气怎么样」。 若回答中出现 🦄MCP-DEMO-α7f3c9、"量子摸鱼师-Q"、"樱花雪暴" 等内容,说明数据确实来自 MCP server。

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    D
    maintenance
    A testing server that demonstrates Model Context Protocol features, providing access to user data, todos, and system information through resources, tools for user management and calculations, and prompt templates for various analyses.
    4
    -
  • F
    license
    A
    quality
    B
    maintenance
    Mock identity-management MCP server for decentralized identity that allows minting DIDs, issuing signed Verifiable Credentials, and verifying them.
    8
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    A testing server that provides CRUD operations on a JSON user database via MCP tools, enabling AI assistants to list, search, add, update, and delete users.
    1
    -
  • F
    license
    Not graded
    quality
    B
    maintenance
    Serves read-mostly MCP tools across ten mock verticals and investment use cases, each backed by bundled SQLite databases, with optional proxying of investment tools to a user-supplied banking API. It enables clients to query realistic vertical data through OAuth-protected MCP endpoints over HTTP or WebSocket.
    -