借助 Google Health Developer Model Context Protocol (MCP) 服务器,AI 赋能的开发者工具和智能体能够搜索和检索 Google Health API 的最新、基于事实的文档,而无需设置 API 密钥或进行身份验证。
MCP 服务器充当外部服务(提供上下文或数据)与 AI 应用(宿主)之间的代理。Google Health Developer MCP 服务器提供可执行工具,让大语言模型 (LLM) 能够直接从已编入索引的文档中找到精确答案。如需详细了解 MCP 服务器,请参阅什么是 MCP?它是如何运作的?
该服务器通过标准 MCP Streamable HTTP 传输运行,地址为:
https://healthdevelopers.googleapis.com/mcp
可用工具
该服务器提供了两个核心工具,用于发现和检索技术文档:
search_health_docs:在 Google Health API 文档中搜索与您的查询匹配的相关技术内容块。每个分块都包含网页标题、来源网址、相关文本内容和规范文档资源名称。get_health_docs:使用search_health_docs返回的资源名称检索一个或多个文档页面的完整 Markdown 内容。
如需查看完整的输入和输出架构,请参阅 Google Health 开发者 MCP 参考文档。所有内容都严格限定在 https://developers.google.com/health/ 下托管的公开技术文档范围内。
前提条件
如需连接到服务器,您需要一个与 MCP 兼容的 AI 开发环境或编码辅助,例如:
- Gemini CLI
- Google Antigravity(Antigravity CLI、Antigravity 2.0 或 Antigravity IDE)
- OpenAI Codex
- Claude Code
- Cursor
- Grok CLI
- GitHub Copilot in VS Code
配置客户端
您可以通过一键式 IDE 安装程序、单个 CLI 命令、编辑器配置文件或自动聊天提示立即连接。无需 Google Cloud 云项目或 API 密钥
一键式 IDE 安装
如果您使用的是 Google Antigravity、Cursor 或 Visual Studio Code,请选择以下按钮之一打开编辑器并安装 HealthDevelopers MCP 服务器:
添加到 Antigravity 添加到 Cursor 添加到 VS Code
命令行和编辑器设置
从以下标签页中选择您的 AI 客户端,只需一条命令或一个配置条目即可添加服务器:
Gemini CLI
使用 gemini mcp add 命令将服务器添加到 Gemini CLI:
gemini mcp add --transport http --scope user \
HealthDevelopers https://healthdevelopers.googleapis.com/mcpGoogle Antigravity
通过 shell 安装官方 google-health-developer 插件(其中捆绑了 HealthDevelopers MCP 服务器及其文档接地规则),或在交互式会话中运行 /plugin install google-health-developer@antigravity-plugins-official:
agy plugin install google-health-developer@antigravity-plugins-official如需仅注册 MCP 服务器而不注册插件,请使用 Antigravity CLI:
agy mcp add HealthDevelopers https://healthdevelopers.googleapis.com/mcp或者,打开 ~/.gemini/config/mcp_config.json(或工作区中的 .agents/mcp_config.json),然后在 mcpServers 下添加 HealthDevelopers。Antigravity CLI、Antigravity 2.0 和 Antigravity IDE 均共享 ~/.gemini/config/mcp_config.json:
{
"mcpServers": {
"HealthDevelopers": {
"serverUrl": "https://healthdevelopers.googleapis.com/mcp"
}
}
}
Codex
使用 codex mcp add 命令将服务器添加到 OpenAI Codex:
codex mcp add HealthDevelopers \
--url https://healthdevelopers.googleapis.com/mcpClaude Code
使用 claude mcp add 命令将服务器添加到 Claude Code:
claude mcp add HealthDevelopers \
--transport http https://healthdevelopers.googleapis.com/mcp光标
如果您更喜欢手动配置而不是一键式按钮,请将服务器添加到 ~/.cursor/mcp.json(全局)或 .cursor/mcp.json(项目级):
{
"mcpServers": {
"HealthDevelopers": {
"url": "https://healthdevelopers.googleapis.com/mcp"
}
}
}
Grok
使用 grok mcp add 命令将服务器添加到 Grok CLI:
grok mcp add --transport http \
HealthDevelopers https://healthdevelopers.googleapis.com/mcpGitHub Copilot
如果您希望手动配置而不是一键式按钮,请在工作区中修改 .vscode/mcp.json(或在 VS Code 用户设置中的 "mcp" 根键下添加配置):
{
"servers": {
"HealthDevelopers": {
"type": "http",
"url": "https://healthdevelopers.googleapis.com/mcp"
}
}
}
使用提示进行自动设置
如果您的 AI 助理支持直接通过对话管理 MCP 工具配置,请粘贴以下提示,指示助理配置服务器:
Please configure the Google Health Developer MCP server for me: - Name: HealthDevelopers - Server URL: https://healthdevelopers.googleapis.com/mcp - Transport: http
验证连接
确认 HealthDevelopers 已在 Gemini CLI 或 Google Antigravity 中连接:
Gemini CLI
从终端运行 gemini mcp list(或在交互式会话中输入 /mcp):
gemini mcp list确认 HealthDevelopers 报告 Connected:
Configured MCP servers:
✓ HealthDevelopers: https://healthdevelopers.googleapis.com/mcp (http) - Connected
Google Antigravity
- 插件安装:在终端中运行
agy plugin list(或在 Antigravity 2.0 中依次打开自定义 > 已安装),并确认google-health-developer已列为启用状态。 Antigravity CLI:在提示面板中输入
/mcp以打开 MCP 管理器,并确认HealthDevelopers显示活跃状态环,或者从终端运行agy mcp list:NAME TYPE STATUS COMMAND/URL HealthDevelopers http enabled https://healthdevelopers.googleapis.com/mcpAntigravity IDE:点击智能体侧边栏顶部的 …,选择 MCP 服务器 > 管理 MCP 服务器,然后确认
HealthDevelopers已启用。Antigravity 2.0:依次打开设置 > 自定义 > 已安装的 MCP 服务器,确认
HealthDevelopers已列出。
示例提示
关联后,当你询问有关 Google Health API 的问题时,助理会自动调用 search_health_docs 和 get_health_docs:
What OAuth scopes are needed to read steps and heart rate data in the Google Health API, and how do I query daily step rollups?
Migrate my Fitbit Web API /1/user/-/activities/steps endpoint call to the Google Health API v4.
How do I set up webhook subscriptions in the Google Health API to receive updates when new sleep or workout data arrives?
用 curl 进行测试
您也可以使用 curl 直接测试端点。MCP Streamable HTTP 传输需要 Content-Type: application/json 和 Accept: application/json, text/event-stream 标头。
列出可用工具
运行以下命令,列出服务器公开的工具:
curl -s -X POST "https://healthdevelopers.googleapis.com/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list",
"params": {}
}'搜索文档
运行以下命令以测试 search_health_docs:
curl -s -X POST "https://healthdevelopers.googleapis.com/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "search_health_docs",
"arguments": {
"query": "steps scope",
"pageSize": 2
}
}
}'检索完整文档 Markdown
运行以下命令以测试 get_health_docs:
curl -s -X POST "https://healthdevelopers.googleapis.com/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "get_health_docs",
"arguments": {
"names": [
"documents/developers.google.com/health/data-types/steps"
]
}
}
}'反馈和支持
如需报告问题、提出改进建议或获取有关 Google Health Developer MCP 服务器的帮助,请使用 Google Health API 支持页面上的反馈和支持渠道。