Gemini Cloud Assist

官方

一個連接到 Gemini Cloud Assist API 的 MCP 伺服器,讓您能夠使用自然語言管理和疑難排解您的 Google Cloud 環境。

你可以用 Gemini Cloud Assist MCP 做什麼?

  • Ask general Google Cloud questions — Get guidance on best practices, architectures, and operations using ask_cloud_assist.
  • Design and architect infrastructure — Describe your requirements and use design_infra to create infrastructure configurations for Google Cloud.
  • Troubleshoot cloud issues — Run deep investigations to find root causes of problems in your environment with investigate_issue.
  • Manage cloud resources — Create, update, or delete Google Cloud resources directly through invoke_operation when Agent Actions are enabled.
  • Analyze and optimize costs — Get spend breakdowns and identify cost-saving opportunities like idle resources using optimize_costs.
  • Deploy verified infrastructure designs — Use manage_application to deploy a design after validating it with assess_best_practices.

文件

Gemini Cloud Assist MCP 伺服器

[!IMPORTANT] 私人預覽版通知 Gemini Cloud Assist MCP 伺服器 API 目前處於私人預覽階段,並受允許清單限制。請聯絡您的 Google Cloud 客戶團隊以申請存取權。

[!WARNING] 淘汰通知與遷移至遠端 MCP 伺服器

Gemini Cloud Assist MCP 伺服器已從本機 Node.js 架構遷移至遠端 MCP 伺服器架構。舊版的本機 Node.js 伺服器將在未來數個月內停止支援。

若要使用新的遠端 MCP 伺服器,請使用 v0.8.0 或更新版本。如果您希望在過渡期間繼續使用舊版的本機伺服器,請將您的設定固定為較舊的版本。

npm @google-cloud/gemini-cloud-assist-mcp package

此伺服器可將 Model Context Protocol (MCP) 用戶端(例如 Gemini CLI)連接至 Gemini Cloud Assist API。它讓您能夠直接從本機命令列使用自然語言來理解、管理及疑難排解您的 Google Cloud 環境。

[!NOTE] Google Cloud Platform 服務條款(可在 https://cloud.google.com/terms/ 取得)和資料處理與安全條款(可在 https://cloud.google.com/terms/data-processing-terms 取得)不適用於 Gemini Cloud Assist MCP 伺服器軟體的任何組成部分。

若要進一步了解 Gemini Cloud Assist,請參閱 Google Cloud 說明文件中的 Gemini Cloud Assist 總覽

✨ 主要功能

  • 設計基礎架構: 為 Google Cloud 建立並架構基礎架構設定。
  • 疑難排解問題: 執行深入調查,找出 Google Cloud 環境中複雜問題的根本原因。
  • 管理資源: 直接從您的聊天工作流程建立、更新和刪除 Google Cloud 資源(需要代理執行動作)。
  • 最佳化成本: 分析您的支出、追蹤成本,並找出提升效率的機會,例如閒置資源。
  • 取得一般協助: 針對 Google Cloud 最佳做法、架構和操作提出問題並取得指引。

快速入門

開始之前,請確保您已完成以下設定:

  • 已安裝並設定 Google Cloud SDK
  • 一個 Google Cloud 專案
  • 您的使用者帳戶需具備下列 IAM 角色
    • roles/serviceusage.serviceUsageAdmin:啟用 Cloud Assist API 的必要角色。
    • roles/geminicloudassist.user:向 Cloud Assist API 發出請求的必要角色。

步驟 1:向 Google Cloud 進行身分驗證

Gemini Cloud Assist MCP 伺服器使用本機應用程式預設憑證 (ADC) 來安全地向 Google Cloud 進行身分驗證。若要設定 ADC,請執行下列 gcloud 指令:

# Authenticate your user account to the gcloud CLI
gcloud auth login

# Set up Application Default Credentials for the server.
gcloud auth application-default login

設定您的 MCP 用戶端

用戶端代理程式的設定取決於您使用的代理程式。

Gemini CLI

將 MCP 伺服器安裝為 Gemini CLI 擴充功能

gemini extensions install https://github.com/GoogleCloudPlatform/gemini-cloud-assist-mcp

或者,您可以手動將設定新增至您的 ~/.gemini/settings.json

"mcpServers": {
  "gemini_cloud_assist": {
    "httpUrl": "https://geminicloudassist.googleapis.com/mcp",
    "authProviderType": "google_credentials",
    "oauth": {
      "scopes": ["https://www.googleapis.com/auth/cloud-platform"]
    },
    "timeout": 600000
  },
  "application_design_center": {
    "httpUrl": "https://designcenter.googleapis.com/mcp",
    "authProviderType": "google_credentials",
    "oauth": {
      "scopes": ["https://www.googleapis.com/auth/cloud-platform"]
    },
    "timeout": 600000
  }
}

Antigravity

將下列內容新增至您的 mcp_config.json

"mcpServers": {
  "gemini_cloud_assist": {
    "serverUrl": "https://geminicloudassist.googleapis.com/mcp",
    "headers": {},
    "authProviderType": "google_credentials"
  },
  "application_design_center": {
    "serverUrl": "https://designcenter.googleapis.com/mcp",
    "headers": {},
    "authProviderType": "google_credentials"
  }
}

Cursor

  1. 在您的 Google Cloud 專案中,為桌面應用程式建立 OAuth 2.0 用戶端 ID。
  2. URI://anysphere.cursor-mcp/oauth/callback 設定為重新導向網址。
  3. 新增或合併下列設定區塊:
{
  "mcpServers": {
    "gemini_cloud_assist": {
      "url": "https://geminicloudassist.googleapis.com/mcp",
      "auth": {
        "CLIENT_ID": "${env:OAUTH_CLIENT_ID}",
        "CLIENT_SECRET": "${env:OAUTH_CLIENT_SECRET}",
        "scopes": ["https://www.googleapis.com/auth/cloud-platform"]
      }
    },
    "application_design_center": {
      "url": "https://designcenter.googleapis.com/mcp",
      "auth": {
        "CLIENT_ID": "${env:OAUTH_CLIENT_ID}",
        "CLIENT_SECRET": "${env:OAUTH_CLIENT_SECRET}",
        "scopes": ["https://www.googleapis.com/auth/cloud-platform"]
      }
    }
  }
}

Claude

請遵循您特定應用程式的設定說明:

MCP 工具

Gemini Cloud Assist MCP 工具

Gemini Cloud Assist 是一個可透過一組 MCP 工具存取的代理程式。由 MCP 工具呼叫所調用的代理程式會在內部自行對 Google Cloud 進行工具呼叫。系統會發布下列 MCP 工具供代理程式使用:

工具說明
ask_cloud_assistGoogle Cloud 協助和 Gemini Cloud Assist 代理程式的主要介面。所有功能都可透過此工具存取。
design_infra支援在 Google Cloud 上設計和架構基礎架構的工作流程。
investigate_issue支援在 Google Cloud 中進行疑難排解的工作流程。可透過調查資源進行快速或深入的疑難排解。
invoke_operation支援在 Google Cloud 中建立、更新和刪除資源的工作流程。僅在啟用代理執行動作時才能運作。
optimize_costs支援分析、追蹤和最佳化 Google Cloud 成本的工作流程。提供支出明細並找出節省成本的機會。

Application Design Center MCP 工具

Application Design Center MCP 工具通常由 GCA 的 design_infra 工具協調,使用 Application Design Center 管理基礎架構應用程式生命週期,包括範本管理、安全合規性、補救措施和部署。

工具說明
setup_adc初始化 Application Design Center 環境。這是一次性的設定步驟,必須在使用其他 ADC 工具之前執行。
manage_application管理應用程式的部署生命週期。使用此工具透過 Application Design Center 部署已驗證的設計,或擷取現有部署的狀態和詳細資料。這是將您的設計轉換為 Google Cloud 上已部署基礎架構的最後一步。
manage_application_template管理基礎架構設計的基礎架構即程式碼 (IaC) 內容。使用此功能可將設計儲存為 Application Design Center 範本、將設計匯出為 Terraform 檔案,或更新設計(例如元件、參數設定等)。
assess_best_practices在部署前對您的應用程式設計執行全面的安全性和設定稽核。它會根據 Security Command Center 架構和相關控制項驗證設計,並傳回一份包含可行調查結果的報告以供補救。
list_application_templates列出所有可用的應用程式設計。

注意: 這些工具不應被視為穩定的 API。參數可能會因應 Gemini Cloud Assist 不斷發展的功能而重新命名或修改。

代理程式技能

Gemini Cloud Assist MCP 工具利用 SKILL.md 檔案來指示您的代理程式如何正確使用這些工具。這些技能有助於引導您的代理程式將多個工具串聯成一個工作流程、將相關的本機資訊傳遞給 Gemini Cloud Assist,以及啟用明確的調用。

技能說明
designing-and-deploying-infrastructure引導代理程式如何使用 Application Design Center (ADC) 和 Gemini Cloud Assist 工具來設計、評估、部署和疑難排解雲端基礎架構。
operating-google-cloud提供使用專門的 MCP 工具來管理 Google Cloud Platform (GCP) 資源和 Kubernetes 的說明。

貢獻

  • 如果您遇到錯誤,請在我們的 GitHub Issues 頁面上提交問題。
  • 在傳送拉取請求之前,請先檢閱我們的貢獻指南

授權

本專案依據 Apache 2.0 授權條款授權,並以「現狀」提供,不附帶任何明示或暗示的擔保或陳述。詳情請參閱 LICENSE 檔案。