跳转到主要内容

什么是 MCP?

Model Context Protocol(MCP)是一个 JSON-RPC 2.0 接口,使 AI agents 与应用能够与 Mirobody Health 的 tools 与 resources 交互。
MCP endpoint: http://localhost:18080/mcp

Key Concepts

Tools

AI agents 可调用的 functions,用于执行动作(例如获取健康数据、链接 providers)

Resources

Agents 可访问的数据源(例如用户 profiles、健康指标)

JSON-RPC 2.0

基于 HTTP 的远程过程调用标准协议

Agents

使用 tools 与 resources 帮助用户的 AI assistants

Example Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

Example Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      {
        "name": "get_health_data",
        "description": "Retrieve health data for a user",
        "inputSchema": {
          "type": "object",
          "properties": {
            "user_id": {"type": "string"},
            "data_type": {"type": "string"}
          },
          "required": ["user_id"]
        }
      }
    ]
  }
}
更多 MCP 细节请参见 MCP ToolsMCP Resources