Google Health 開發人員 MCP 伺服器

Google Health Developer Model Context Protocol (MCP) 伺服器可讓 AI 輔助開發工具和代理搜尋及擷取 Google Health API 的最新可靠說明文件,不需設定 API 金鑰或驗證。

MCP 伺服器是 Proxy,介於提供脈絡或資料的外部服務,以及 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 Developer MCP 參考資料。所有內容都嚴格限定在 https://developers.google.com/health/ 代管的公開技術說明文件。

必要條件

如要連線至伺服器,您需要與 MCP 相容的 AI 開發環境或程式開發輔助,例如:

設定用戶端

只要按一下 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/mcp

Google Antigravity

使用 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/mcp

Claude Code

使用 claude mcp add 指令,將伺服器新增至 Claude Code:

claude mcp add HealthDevelopers \
  --transport http https://healthdevelopers.googleapis.com/mcp

Cursor

如果您偏好手動設定,而非使用一鍵按鈕,請將伺服器新增至 ~/.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/mcp

GitHub 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

  • Antigravity CLI:在提示面板中輸入 /mcp 開啟 MCP Manager,並確認 HealthDevelopers 顯示活動狀態環,或在終端機執行 agy mcp list:

    NAME              TYPE  STATUS   COMMAND/URL
    HealthDevelopers  http  enabled  https://healthdevelopers.googleapis.com/mcp
    
  • Antigravity IDE:按一下代理側邊面板頂端的「...」, 依序選取「MCP 伺服器」>「管理 MCP 伺服器」,然後確認 HealthDevelopers 已啟用。

  • Antigravity 2.0:依序點選「設定」>「自訂」>「已安裝的 MCP 伺服器」,確認 HealthDevelopers 是否列在其中。

提示詞範例

連結後,當您詢問 Google Health API 相關問題時,Google 助理會自動呼叫 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 支援頁面,使用意見回饋和支援管道。