@google-cloud/observability-mcp

中文文档
0.2.3发布于 2026/02/11Apache-2.0ES Module近 30 天下载 25.5万

MCP Server for GCP environment for interacting with various Observability APIs.

原始使用文档
文档目录7 节
  1. 🚀 Getting Started
  2. Authentication
  3. Usage
  4. Tools Reference
  5. 📄 Important Notes
  6. 👥 Contributing
  7. 📝 License

Google Cloud Observability MCP Server ☁️

This server connects Model Context Protocol (MCP) clients (like the Gemini CLI) to Cloud Observability APIs to search for logs, view metrics, return traces and view error reports. It acts as a local bridge, translating natural language commands from your CLI into the appropriate API calls to help you understand, manage, and troubleshoot your Google Cloud environment.

To learn more about the underlying services, see the official documentation:

🚀 Getting Started

For prerequisites and setup instructions, please see the root README.

Authentication

You need to authenticate twice: once for your user account and once for the application itself.

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

# Set up Application Default Credentials for the server.
# This allows the MCP server to securely make Google Cloud API calls on your behalf.
gcloud auth application-default login

Setting the Quota Project

All API requests made by this server require a Google Cloud project for billing and API quota management. This is known as the "quota project". This project will likely already be set in the gcloud CLI. The project selected as the quota project will need to have the APIs you wish to use in Observability enabled or you will see errors when attempting to use their related tools (e.g. you need the Cloud Logging API enabled in the quota project to use the list_log_entries tool).

If you need to control which project is used for quotas, run the following command (https://cloud.google.com/sdk/gcloud/reference/auth/application-default/set-quota-project):

# Set the project to be used for API quotas and billing by ADC
gcloud auth application-default set-quota-project YOUR_QUOTA_PROJECT_ID

This ensures that all API usage from this server is attributed to the correct project.

Usage

Once the server is configured, you can ask your MCP client natural language questions about your Google Cloud environment. Here are a few examples:

  • "Show me all logs with a severity of ERROR."
  • "What is the average CPU utilization for my GCE instances over the last hour?"
  • "List all traces from the past 30 minutes."
  • "Are there any new stack traces in my logs in the last day?"

Your MCP client will translate these questions into the appropriate tool calls to fetch the data from Google Cloud.

Tools Reference

The server exposes the following tools:

ServiceToolDescription
Logginglist_log_entriesLists log entries from a project.
list_log_namesLists log names from a project.
list_bucketsLists log buckets from a project.
list_viewsLists log views from a project.
list_sinksLists log sinks from a project.
list_log_scopesLists log scopes from a project.
Monitoringlist_metric_descriptorsLists metric descriptors for a project.
list_time_seriesLists time series data for a given metric.
list_alert_policiesLists the alert policies in a project.
Tracelist_tracesSearches for traces in a project.
get_traceGets a specific trace in a project.
Error Reportinglist_group_statsLists the error groups for a project.

📄 Important Notes

This repository is currently in preview and may see breaking changes. This repository provides a solution, not an officially supported Google product. It is not covered under Google Cloud Terms of Service. It may break when the MCP specification, other SDKs, or when other solutions and products change. See also our Security Policy.

👥 Contributing

Please read our Contributing Guide to get started.

📝 License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

版本与发布记录

@google-cloud/observability-mcp 共发布 7 个版本,首次发布于 2025/09/10;过去 12 个月发布了 3 个版本。

版本发布日期距今
0.2.3latest2026/02/119 个月前
0.2.22026/01/0610 个月前
0.2.12025/12/1611 个月前
0.2.02025/11/141 年前
0.1.22025/09/301.1 年前
0.1.12025/09/111.2 年前

关于 @google-cloud/observability-mcp 的常见问题

@google-cloud/observability-mcp 是什么?

MCP Server for GCP environment for interacting with various Observability APIs.

如何安装 @google-cloud/observability-mcp?

在项目目录运行 npm install @google-cloud/observability-mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 observability-mcp,可以用 npx observability-mcp 直接运行。

@google-cloud/observability-mcp 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/google-cloud__observability-mcp 是否存在。

@google-cloud/observability-mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@google-cloud/observability-mcp 可以商用吗?

@google-cloud/observability-mcp 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@google-cloud/observability-mcp 的下载量有多少?

根据 npm 官方下载统计,@google-cloud/observability-mcp 在 2026/10/17 – 2026/11/15 这 30 天内被下载 255,414 次,日均约 8,514 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@google-cloud/observability-mcp 还在维护吗?

最新版本 0.2.3 发布于 2026/02/11(9 个月前);至今共发布 7 个版本,其中过去 12 个月发布了 3 个;首次发布于 2025/09/10。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。