# gemini-cloud-assist-mcp [Official] [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/GoogleCloudPlatform/gemini-cloud-assist-mcp  
**GitHub Stars:** 72  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/gemini-cloud-assist-mcp

## Description
MCP Server for understanding, managing & troubleshooting your GCP environment.

## Tools
Capabilities this server exposes over MCP:

- **ask_cloud_operator** — The AutoCloud Operator Agent manages Google Cloud Platform (GCP) infrastructure across its full lifecycle—architecture design, IaC creation, config review, rollout validation, live monitoring, incident debugging, and cost optimization. It has live awareness of GCP context (resource inventory, App Topology, Cloud Logging, Monitoring, Service Health, Org Policies, and billing) plus a sandbox to validate configs against Google Cloud standards.
`ask_cloud_operator` can handle broad tasks that deal with operating on Google Cloud. Read any relevant local workspace files the operator agent cannot see, then forward the user's request **verbatim** in `userQuery`; **do not** answer Google Cloud questions locally.

**When to use:**
* **Monitoring & Incident Debugging:** Triage outages, latency spikes, or errors across Cloud Logging, Monitoring, traces, App Topology, and Service Health.
* **Cost & FinOps:** Analyze spend, top cost drivers, and idle resources; model rightsizing, Spot VM, or commitment optimizations.
* **Release & Rollout Readiness:** Evaluate deployment plans, diffs, blast radius, canary gating, health checks, and rollback runbooks.
* **Architecture & Design Guidance:** Evaluate GCP service trade-offs (e.g., GKE vs. Cloud Run, Spanner vs. Cloud SQL), topologies, networking, security, and documentation-grounded how-to questions.
* **Infrastructure Creation (Terraform / IaC):** Design architectures and generate validated, production-grade Terraform HCL or deployment configs.
* **Config & Best Practices Review:** Audit Terraform (`*.tf`) or IAM/network configs against Google Cloud best practices and Org Policies.

**Context Sharing & Sessions:**
* **Forward `userQuery` Verbatim & Bundle Local Files:** Pass the user's request **verbatim** in `userQuery` (do not summarize, rephrase, or wrap it in a template, and do not guess the project ID). Because the agent cannot access your local filesystem, read every relevant local file and transitively referenced module (`*.tf`, Kubernetes manifests, configs, diffs, or error logs) and append their full contents after the verbatim request, each preceded by `# <relative/path>`:
  ```
  # ../main.tf
  resource "google_storage_bucket" "assets" {
    name     = "my-app-assets"
    location = "US"
  }
  ```
* **Multi-Turn (`contextId`):** Pass returned `context_id` as `contextId` on follow-ups (with the same `agentId` if set); omit `contextId` for a new session, and omit `agentId` unless specified by the user. Do **not** re-send unchanged local files on follow-ups.
* **Save Returned Code:** Write new files directly to the workspace and apply edits to existing files as reviewable diffs.

**Examples:**
* Example 1 (Caller's personal operator agent):
  ```json
  {
    "project": "projects/my-service-prod",
    "userQuery": "Our checkout client is seeing 504 Gateway Timeouts against payment-service in us-central1 with 'upstream request timeout' after deploying v2.4."
  }
  ```
* Example 2 (Specific agent by short ID):
  ```json
  {
    "project": "projects/my-service-prod",
    "userQuery": "Analyze our Cloud Billing spend over the last 30 days, identify the top cost drivers and any idle or underutilized resources, and recommend rightsizing or commitment optimizations.",
    "agentId": "finops-agent"
  }
  ```
* Example 3 (Regional agent with relative path):
  ```json
  {
    "project": "projects/my-service-prod",
    "userQuery": "Design a multi-region active-active GKE architecture in us-central1 and us-east4 with Cloud Spanner and generate the Terraform code.",
    "agentId": "locations/us-east4/agents/custom-operator"
  }
  ```
* Example 4 (Bundling local file contents & multi-turn session continuation):
  ```json
  {
    "project": "projects/my-service-prod",
    "userQuery": "Review main.tf against our project's Organization Policies and Google Cloud security best practices.\n\n# main.tf\n<code>\n#variable.tf\n<code>\n#networking.tf\n<code>\n}",
    "contextId": "task-session-12345"
  }
  ```

- **search_operator_sessions** — Lists the caller's past sessions with an AutoCloud Operator Agent (the sessions created by `ask_cloud_operator`).
Use this tool to find a previous session to review with `fetch_operator_session` or to resume with `ask_cloud_operator`.

**Parameters & Usage:**
* `project` (string, required): The target GCP project resource name in the format `projects/{project_id}` or `projects/{project_number}`.
* `agent_id` (string, optional): The operator agent whose sessions to list. Accepts the same formats and default as `ask_cloud_operator` (short ID, `locations/{location}/agents/{agent}`, or a full resource name in the same project as `project`, by number or ID).
* `page_size` (integer, optional): Maximum number of sessions to return.
* `page_token` (string, optional): The `next_page_token` from a previous response, to fetch the next page.

**Output:**
Sessions are returned oldest first, by creation time; to find the most recent sessions, page through to the last page.
Each session includes a `context_id`, `session_id`, `title`, `summary`, `status`, `create_time` and `update_time`.
- Pass `context_id` to `ask_cloud_operator` to continue the session.
- Pass `context_id` (or `session_id`) to `fetch_operator_session` to read the session's conversation.

**Example:**
```json
{
  "project": "projects/my-service-prod",
  "page_size": 10
}
```

- **fetch_operator_session** — Gets the details and conversation history of one AutoCloud Operator Agent session.
Use this tool to review what happened in a previous `ask_cloud_operator` session before continuing it.

**Parameters & Usage:**
* `project` (string, required): The target GCP project resource name in the format `projects/{project_id}` or `projects/{project_number}`.
* `session_id` (string, required): The session to fetch. Accepts the `context_id` returned by `ask_cloud_operator` or `search_operator_sessions`, a `session_id` from `search_operator_sessions`, or a full session resource name (`.../agents/{agent}/sessions/{session}`). A full resource name must be in the same project as `project` (by number or ID).
* `agent_id` (string, optional): The operator agent that owns the session. Accepts the same formats and default as `ask_cloud_operator`. Required to locate the session only when `session_id` is a short ID and the session does not belong to the caller's personal agent. If `session_id` is a full resource name, `agent_id` may be omitted; if given, it must name the same agent.
* `page_size` (integer, optional): Maximum number of conversation turns to return.
* `page_token` (string, optional): The `next_page_token` from a previous response, to fetch more turns.

**Output:**
Returns the session summary (including `context_id`), a list of conversation `turns` (each with its state, the user input and the agent's final response), the `active_task_id` if a task is still running, and a `next_page_token` when more turns are available.

**Example:**
```json
{
  "project": "projects/my-service-prod",
  "session_id": "projects/my-service-prod/locations/global/agents/my-custom-agent/sessions/session-12345"
}
```


## Claude Desktop Quick Installation
No confirmed install details yet, so no config is published. Follow the setup steps in the repository above.

## Documentation

## What gemini-cloud-assist-mcp does

gemini-cloud-assist-mcp connects MCP-compatible clients to the Gemini Cloud Assist APIs, specifically the Cloud Operator endpoint at `https://geminicloudassist.googleapis.com/mcp/autocloud`. The endpoint exposes an operator agent that can investigate incidents, review deployment readiness, assess Google Cloud architectures, generate or review Terraform and other infrastructure configuration, analyze spending, and answer documentation-grounded operational questions.

The operator works against a target Google Cloud project and can use project context such as resource inventory, application topology, logging, monitoring, service health, organization policies, and billing. It also has a sandbox for validating configurations against Google Cloud standards.

## How it works

Call `ask_cloud_operator` with a project resource such as `projects/my-service-prod` and place the user’s request in `userQuery`. Requests should be forwarded verbatim. Since the operator cannot inspect the caller’s local filesystem, relevant Terraform files, Kubernetes manifests, configuration files, diffs, and logs should be included in the request with their relative paths and contents.

The tool returns a context identifier for continuing the conversation. Pass that `contextId` on follow-up calls, along with the same `agentId` when one was selected. New tasks omit the context identifier. When the operator produces code or file changes, write new files to the workspace and apply edits as reviewable diffs.

Sessions can be managed with the other two tools. `search_operator_sessions` lists sessions for a project, with pagination and session metadata. `fetch_operator_session` retrieves a session’s summary and conversation turns, using a context ID, session ID, or full session resource name. Session results are ordered oldest first, so finding the newest entries may require paging through the results.

## Setup and configuration

Access requires a Google Cloud project, the Google Cloud SDK, and these IAM roles on the user account:

- `roles/serviceusage.serviceUsageAdmin`, to enable the Cloud Assist APIs
- `roles/geminicloudassist.user`, to call the Cloud Assist APIs

Authentication uses local Application Default Credentials. Configure them with `gcloud auth login` followed by `gcloud auth application-default login`.

The remote MCP endpoint can be configured in supported clients. Antigravity uses a `serverUrl` and Google credentials. Cursor requires a desktop OAuth client, the redirect URI `URI://anysphere.cursor-mcp/oauth/callback`, and the `cloud-platform` scope. The repository also provides a Cloud Operator plugin for Claude Code and ChatGPT Codex; the plugin configures the connection, applies a 30-minute tool timeout, and helps the agent choose when to delegate work.

## Tools and capabilities

- `ask_cloud_operator`: Delegate troubleshooting, root-cause analysis, rollout checks, cost and resource analysis, architecture evaluation, Terraform generation or review, and Google Cloud how-to questions.
- `search_operator_sessions`: List a project’s Cloud Operator sessions with identifiers, titles, summaries, status, and timestamps.
- `fetch_operator_session`: Read the conversation and state of a selected session, including additional paginated turns.

The operator can review Terraform, IAM and network configuration, Kubernetes manifests, Helm-related infrastructure, deployment plans, diffs, and error logs when their contents are supplied in the request.

## Limitations and notes

The Cloud Operator MCP tools are in Private Preview and restricted to allowlisted projects. Their parameters may change as Gemini Cloud Assist evolves. The configurations in this repository expose only the `/mcp/autocloud` tools; other Gemini Cloud Assist tools on `/mcp`, including `ask_cloud_assist`, `design_infra`, `investigate_issue`, `invoke_operation`, and `optimize_costs`, are not reachable through these configurations.

The older local Node.js architecture is being replaced by the Remote MCP Server architecture. Use the latest package line supporting the remote server; legacy local configurations are intended only for transition. Google Cloud authentication, project selection, and IAM permissions remain prerequisites for requests.

_Full upstream README: https://allmcps.com/mcp/gemini-cloud-assist-mcp/readme_

