Skip to content
Back to search

gcloud-mcp

gcloud MCP server

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/googleapis--gcloud-mcp/badge.svg)](/listings/googleapis--gcloud-mcp)

HTML

<a href="/listings/googleapis--gcloud-mcp"><img src="/api/listings/googleapis--gcloud-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Gemini CLI and Gemini Code Assist

To integrate MCP servers with Gemini CLI or Gemini Code Assist, run the setup command below from your home directory for MCP server listed in the table. This will install the MCP server as a [Gemini CLI extension](https://github.com/google-gemini/gemini-cli/blob/main/docs/extension.md). for the current user, making it available for all your projects.

npx @google-cloud/[PACKAGE_NAME] init --agent=gemini-cli

For example, for the gcloud-mcp:

npx @google-cloud/gcloud-mcp init --agent=gemini-cli

After the initialization process, you can verify that the gcloud-mcp server is configured correctly by running the following command:

gemini mcp list

> ✓ gcloud: npx -y @google-cloud/gcloud-mcp (stdio) - Connected

For other AI clients

To use MCP servers in this repo with other clients, add the following snippet to their respective JSON configuration files for each MCP server:

"[SERVER_NAME]": {
  "command": "npx",
  "args": ["-y", "@google-cloud/[PACKAGE_NAME]"]
}

For example, for gcloud:

"gcloud": {
  "command": "npx",
  "args": ["-y", "@google-cloud/gcloud-mcp"]
}

Instructions for popular tools:

- **Claude Desktop:** Open **Claude > Settings > Developer > Edit Config** and edit `claude_desktop_config.json`. - **Cline:** Click the MCP Servers icon, then **Configure MCP Servers** to edit `cline_mcp_settings.json`. - **Cursor:** Edit `.cursor/mcp.json` for a single project or `~/.cursor/mcp.json` for all projects. - **Gemini CLI (Manual Setup):** [If not using extensions](#gemini-cli-and-gemini-code-assist), edit `.gemini/settings.json` for a single project or `~/.gemini/settings.json` for all projects.

For **Visual Studio Code** edit the `.vscode/mcp.json` file in your workspace for a single project or your global user settings file for all projects:

"servers": {
  "[SERVER_NAME]": {
    "command": "npx",
    "args": ["-y", "@google-cloud/[PACKAGE_NAME]"]
  }
}

For example, for gcloud and observability:

"servers": {
  "gcloud": {
    "command": "npx",
    "args": ["-y", "@google-cloud/gcloud-mcp"]
  },
  "observability": {
    "command": "npx",
    "args": ["-y", "@google-cloud/observability-mcp"]
  },
}

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 237 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. [![gcloud-mcp Servers CI](https://github.com/googleapis/gcloud-mcp/actions/workflows/presubmit.yml/badge.svg)](https://github.com/googleapis/gcloud-mcp/actions/workflows/presubmit.yml)
  2. [![License](https://img.shields.io/github/license/googleapis/gcloud-mcp)](https://github.com/googleapis/gcloud-mcp/blob/main/LICENSE)
  3. # gcloud MCP Server ☁️
  4. The gcloud
  5. [Model Context Protocol (MCP)](https://modelcontextprotocol.io/docs/getting-started/intro)
  6. server enables AI assistants to easily interact with the Google Cloud
  7. environment using the gcloud CLI. With the gcloud MCP server you can:
  8. - **Interact with Google Cloud using natural language.** Describe the outcome
  9. you want instead of memorizing complex command syntax, flags, and arguments.
  10. - **Automate and simplify complex workflows.** Chain multiple cloud operations
  11. into a single, repeatable command to reduce manual effort and the chance of
  12. error.
  13. - **Lower the barrier to entry for cloud management.** Empower team members who
  14. are less familiar with gcloud to perform powerful actions confidently and
  15. safely.
  16. ## 📡 Available MCP Servers
  17. This repository also hosts other MCP servers in addition to the gcloud MCP
  18. server. An up to date list is below, and links to other Google Cloud MCP
  19. servers hosted outside of this repo are
  20. [here](#-other-google-cloud-mcp-servers).
  21. | MCP Server Name | Description | Package Name | Version |
  22. | :-------------- | :---------------------------------------------------------------------------- | :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------- |
  23. | gcloud | Interact with Google Cloud via the gcloud CLI using natural language prompts. | `gcloud-mcp` | [![Version](https://img.shields.io/npm/v/@google-cloud/gcloud-mcp)](https://www.npmjs.com/package/@google-cloud/gcloud-mcp) |
  24. | observability | Access Google Cloud Observability APIs to query logs, metrics, and traces. | `observability-mcp` | [![Version](https://img.shields.io/npm/v/@google-cloud/observability-mcp)](https://www.npmjs.com/package/@google-cloud/observability-mcp) |
  25. | storage | Interact with Google Cloud Storage for bucket and object management. | `storage-mcp` | [![Version](https://img.shields.io/npm/v/@google-cloud/storage-mcp)](https://www.npmjs.com/package/@google-cloud/storage-mcp) |
  26. | backupdr | Interact with Google Cloud Backup and Disaster Recovery. | `backupdr-mcp` | [![Version](https://img.shields.io/npm/v/@google-cloud/backupdr-mcp)](https://www.npmjs.com/package/@google-cloud/backupdr-mcp) |
  27. ## 🚀 Getting Started
  28. ### Prerequisites
  29. - [Node.js](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm):
  30. version 20 or higher
  31. - [gcloud CLI](https://cloud.google.com/sdk/docs/install)
  32. ## ✨ Set up your MCP server
  33. ### Gemini CLI and Gemini Code Assist
  34. To integrate MCP servers with Gemini CLI or Gemini Code Assist, run the setup
  35. command below from your home directory for MCP server listed in the table. This
  36. will install the MCP server as a
  37. [Gemini CLI extension](https://github.com/google-gemini/gemini-cli/blob/main/docs/extension.md).
  38. for the current user, making it available for all your projects.
  39. ```shell
  40. npx @google-cloud/[PACKAGE_NAME] init --agent=gemini-cli
  41. ```
  42. For example, for the gcloud-mcp:
  43. ```shell
  44. npx @google-cloud/gcloud-mcp init --agent=gemini-cli
  45. ```
  46. After the initialization process, you can verify that the gcloud-mcp server is
  47. configured correctly by running the following command:
  48. ```
  49. gemini mcp list
  50. > ✓ gcloud: npx -y @google-cloud/gcloud-mcp (stdio) - Connected
  51. ```
  52. ### For other AI clients
  53. To use MCP servers in this repo with other clients, add the following snippet
  54. to their respective JSON configuration files for each MCP server:
  55. ```json
  56. "[SERVER_NAME]": {
  57. "command": "npx",
  58. "args": ["-y", "@google-cloud/[PACKAGE_NAME]"]
  59. }
  60. ```
  61. For example, for gcloud:
  62. ```json
  63. "gcloud": {
  64. "command": "npx",
  65. "args": ["-y", "@google-cloud/gcloud-mcp"]
  66. }
  67. ```
  68. Instructions for popular tools:
  69. - **Claude Desktop:** Open **Claude > Settings > Developer > Edit Config** and
  70. edit `claude_desktop_config.json`.
  71. - **Cline:** Click the MCP Servers icon, then **Configure MCP Servers** to edit
  72. `cline_mcp_settings.json`.
  73. - **Cursor:** Edit `.cursor/mcp.json` for a single project or
  74. `~/.cursor/mcp.json` for all projects.
  75. - **Gemini CLI (Manual Setup):** [If not using extensions](#gemini-cli-and-gemini-code-assist),
  76. edit `.gemini/settings.json` for a single project or `~/.gemini/settings.json` for
  77. all projects.
  78. For **Visual Studio Code** edit the `.vscode/mcp.json` file in your workspace
  79. for a single project or your global user settings file for all projects:
  80. ```json
  81. "servers": {
  82. "[SERVER_NAME]": {
  83. "command": "npx",
  84. "args": ["-y", "@google-cloud/[PACKAGE_NAME]"]
  85. }
  86. }
  87. ```
  88. For example, for gcloud and observability:
  89. ```json
  90. "servers": {
  91. "gcloud": {
  92. "command": "npx",
  93. "args": ["-y", "@google-cloud/gcloud-mcp"]
  94. },
  95. "observability": {
  96. "command": "npx",
  97. "args": ["-y", "@google-cloud/observability-mcp"]
  98. },
  99. }
  100. ```
  101. ## 🛠 Local Development
  102. For more information regarding installing the repository locally, please see
  103. [development.md](doc/DEVELOPMENT.md)
  104. ## 🧰 Available MCP Tools
  105. | MCP Server | Tool | Description |
  106. | :------------ | :------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |
  107. | gcloud | `run_gcloud_command` | Executes a gcloud command. Some commands have been restricted from execution by the agent. See [MCP Permissions](#-mcp-permissions) for more information. |
  108. | observability | `list_log_entries` | Lists log entries from a project. |
  109. | | `list_log_names` | Lists log names from a project. |
  110. | | `list_buckets` | Lists log buckets from a project. |
  111. | | `list_views` | Lists log views from a project. |
  112. | | `list_sinks` | Lists log sinks from a project. |
  113. | | `list_log_scopes` | Lists log scopes from a project. |
  114. | | `list_metric_descriptors` | Lists metric descriptors for a project. |
  115. | | `list_time_series` | Lists time series data for a given metric. |
  116. | | `list_alert_policies` | Lists the alert policies in a project. |
  117. | | `list_traces` | Searches for traces in a project. |
  118. | | `get_trace` | Gets a specific trace by id in a project. |
  119. | | `list_group_stats` | Lists the error groups for a project. |
  120. | storage | `list_objects` | Lists objects in a GCS bucket. |
  121. | | `read_object_metadata` | Reads comprehensive metadata for a specific object. |
  122. | | `read_object_content` | Reads the content of a specific object. |
  123. | | `delete_object` | Deletes a specific object from a bucket. |
  124. | | `write_object` | Writes a new object to a bucket. |
  125. | | `update_object_metadata` | Updates the custom metadata of an existing object. |
  126. | | `copy_object` | Copies an object from one bucket to another. |
  127. | | `move_object` | Moves an object from one bucket to another. |
  128. | | `upload_object` | Uploads a file to a GCS bucket. |
  129. | | `download_object` | Downloads an object from GCS to a local file. |
  130. | | `list_buckets` | Lists all buckets in a project. |
  131. | | `create_bucket` | Creates a new bucket. |
  132. | | `delete_bucket` | Deletes a bucket. |
  133. | | `get_bucket_metadata` | Gets comprehensive metadata for a specific bucket. |
  134. | | `update_bucket_labels` | Updates labels for a bucket. |
  135. | | `get_bucket_location` | Gets the location of a bucket. |
  136. | | `view_iam_policy` | Views the IAM policy for a bucket. |
  137. | | `check_iam_permissions` | Tests IAM permissions for a bucket. |
  138. | | `get_metadata_table_schema` | Checks if GCS insights service is enabled and returns the BigQuery table schema for a given insights dataset configuration. |
  139. | | `execute_insights_query` | Executes a BigQuery SQL query against an insights dataset and returns the result. |
  140. | | `list_insights_configs` | Lists the names of all Storage Insights dataset configurations for a given project. |
  141. | backupdr | `list_backup_vaults` | Lists all backup vaults in a given project and location. |
  142. | | `get_backup_vault` | Gets details of a specific backup vault. |
  143. | | `list_backup_plans` | Lists all backup plans in a given project and location. |
  144. | | `get_backup_plan` | Gets details of a specific backup plan. |
  145. | | `list_backup_plan_associations` | Lists all associations between backup plans and resources. |
  146. | | `get_backup_plan_association` | Gets details of a specific backup plan association. |
  147. | | `list_datasources` | Lists all data sources within a backup vault. |
  148. | | `get_datasource` | Gets details of a specific data source. |
  149. | | `list_backups` | Lists all backups for a given data source. |
  150. | | `get_backup` | Gets details of a specific backup. |
  151. | | `find_protectable_resources` | Discovers resources (VMs, Disks, SQL) that can be protected. |
  152. | | `get_backupdr_operation` | Retrieves the status of a long-running BackupDR operation. |
  153. | | `get_csql_operation` | Retrieves the status of a long-running Cloud SQL operation. |
  154. | | `create_backup_vault` | Creates a new backup vault in a specified location. |
  155. | | `create_backup_plan` | Creates a new backup plan with defined rules and retention. |
  156. | | `update_backup_plan` | Modifies an existing backup plan. |
  157. | | `create_backup_plan_association` | Associates a resource with a backup plan to start protection. |
  158. | | `restore_backup` | Restores a backup to a target Compute Engine instance or disk. |
  159. | | `csql_restore` | Restores a Cloud SQL backup to a target instance. |
  160. | | `delete_backup_vault` | **Deletes** a backup vault. |
  161. | | `delete_backup_plan` | **Deletes** a backup plan. |
  162. | | `delete_backup_plan_association` | **Removes** protection from a resource by deleting its association. |
  163. | | `delete_backup` | **Deletes** a specific backup from a vault. |
  164. ## 🔑 MCP Permissions
  165. The permissions of the gcloud MCP are directly tied to the permissions of the active
  166. gcloud account. To restrict permissions and operate with the principle of least
  167. privilege, you can
  168. [authorize as a service account using impersonation](https://cloud.google.com/sdk/docs/authorizing#impersonation) and
  169. assign the service account a
  170. [role with limited permissions](https://cloud.google.com/iam/docs/roles-overview).
  171. By default, the gcloud MCP prevents execution of gcloud commands that don't
  172. make sense for AI agents. This is done to restrict commands that can run
  173. arbitrary inputs and initiate interactive sessions. See
  174. [here](https://github.com/googleapis/gcloud-mcp/blob/ed743f04272744e57aa4990f5fcd9816a05b03ba/packages/gcloud-mcp/src/index.ts#L29)
  175. for the list of denied commands.
  176. ## 💫 Other Google Cloud MCP Servers
  177. Google Cloud offers these other servers:
  178. - [Firebase MCP](https://firebase.google.com/docs/cli/mcp-server)
  179. - [Google Analytics MCP](https://github.com/googleanalytics/google-analytics-mcp)
  180. - [Google Cloud Genmedia MCP](https://github.com/GoogleCloudPlatform/vertex-ai-creative-studio/tree/main/experiments/mcp-genmedia)
  181. - [Google Cloud Run MCP](https://github.com/GoogleCloudPlatform/cloud-run-mcp)
  182. - [Google Kubernetes Engine (GKE) MCP](https://github.com/GoogleCloudPlatform/gke-mcp)
  183. - [Google Security Operations and Threat Intelligence MCP](https://github.com/google/mcp-security)
  184. - [MCP Toolbox for Databases](https://github.com/googleapis/genai-toolbox)
  185. ## 👥 Contributing
  186. We welcome contributions! Whether you're fixing bugs, sharing feedback, or
  187. improving documentation, your contributions are welcome. Please read our
  188. [Contributing Guide](CONTRIBUTING.md) to get started.
  189. ## 📄 Important Notes
  190. This repository is currently in preview and may see breaking changes. This
  191. repository provides a solution, not an officially supported Google product. It
  192. is not covered under [Google Cloud Terms of Service](https://cloud.google.com/terms).
  193. It may break when the MCP specification, other SDKs, or when other solutions
  194. and products change. See also our [Security Policy](SECURITY.md).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.