Skip to main content
Glama

气相色谱法 (GCP) 气相色谱法

模型上下文协议 (MCP) 服务器,使 Claude 等 AI 助手能够与您的 Google Cloud Platform 环境进行交互。这允许在对话过程中使用自然语言查询和管理您的 GCP 资源。

GCP MCP 演示

特征

  • 🔍 使用自然语言查询和修改 GCP 资源

  • ☁️ 支持多个 GCP 项目

  • 🌐 多区域支持

  • 🔐 安全凭证处理(不会向外部服务公开任何凭证)

  • 🏃‍♂️ 使用您的 GCP 凭据进行本地执行

  • 🔄 自动重试以提高可靠性

Related MCP server: Kubectl MCP Tool

先决条件

  • Node.js

  • Claude 桌面/光标/风帆冲浪

  • 本地配置的 GCP 凭据(应用程序默认凭据)

安装

  1. 克隆存储库:

git clone https://github.com/eniayomi/gcp-mcp
cd gcp-mcp
  1. 安装依赖项:

npm install

配置

克劳德桌面

  1. 打开 Claude 桌面应用程序并转到“设置”->“开发者”->“编辑配置”

  2. 将以下条目添加到您的claude_desktop_config.json中:

通过 npm:

{
  "mcpServers": {
    "gcp": {
      "command": "sh",
      "args": ["-c", "npx -y gcp-mcp"]
    }
  }
}

如果您从源代码安装:

{
  "mcpServers": {
    "gcp": {
      "command": "npm",
      "args": [
        "--silent",
        "--prefix",
        "/path/to/gcp-mcp",
        "start"
      ]
    }
  }
}

如果使用源安装,请将/path/to/gcp-mcp替换为项目目录的实际路径。

光标

  1. 打开 Cursor 并转到“设置”(⌘,)

  2. 导航至 AI -> 模型上下文协议

  3. 添加新的 MCP 配置:

{
  "gcp": {
    "command": "npx -y gcp-mcp"
  }
}

风帆冲浪

  1. 打开~/.windsurf/config.json (如果不存在则创建)

  2. 添加 MCP 配置:

{
  "mcpServers": {
    "gcp": {
      "command": "npx -y gcp-mcp"
    }
  }
}

GCP 设置

  1. 设置 GCP 凭据:

    • 使用gcloud auth application-default login设置应用程序默认凭据

  2. 刷新你的人工智能助手(Claude Desktop/Cursor/Windsurf)

用法

首先选择一个项目或提出以下问题:

  • “列出我有权访问的所有 GCP 项目”

  • “显示项目 X 中的所有 Cloud SQL 实例”

  • “我目前的账单状态是什么?”

  • “显示我的 Cloud Run 服务的日志”

  • “列出 us-central1 中的所有 GKE 集群”

  • “显示项目 X 中的所有 Cloud Storage 存储桶”

  • “us-central1 中部署了哪些云功能?”

  • “列出所有 Cloud Run 服务”

  • “向我展示 BigQuery 数据集和表格”

可用工具

  1. run-gcp-code :使用 TypeScript 代码执行 GCP API 调用

  2. list-projects :列出所有可访问的 GCP 项目

  3. select-project :选择一个 GCP 项目进行后续操作

  4. get-billing-info :获取当前项目的账单信息

  5. get-cost-forecast :获取当前项目的成本预测

  6. get-billing-budget :获取当前项目的计费预算

  7. list-gke-clusters :列出当前项目中的所有 GKE 集群

  8. list-sql-instances :列出当前项目中的所有 Cloud SQL 实例

  9. get-logs :获取当前项目的 Cloud Logging 条目

交互示例

  1. 列出可用项目:

List all GCP projects I have access to
  1. 选择一个项目:

Use project my-project-id
  1. 检查账单状态:

What's my current billing status?
  1. 查看日志:

Show me the last 10 log entries from my project

支持的服务

  • Google 计算引擎

  • 云存储

  • 云函数

  • 云运行

  • BigQuery

  • 云端 SQL

  • 谷歌 Kubernetes 引擎 (GKE)

  • 云日志

  • 云计费

  • 资源管理器

  • 更多内容即将推出...

故障排除

查看日志:

tail -n 50 -f ~/Library/Logs/Claude/mcp-server-gcp.log

常见问题:

  1. 身份验证错误:确保您已运行gcloud auth application-default login

  2. 权限错误:检查您账户的 IAM 角色

  3. API 错误:验证项目中是否启用了所需的 API

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

执照

麻省理工学院

Available Tools

9 tools
get-billing-budgetC

Get billing budgets for the current project

Inputs: projectId.

get-billing-infoC

Get billing information for the current project

Inputs: projectId.

get-cost-forecastB

Get cost forecast for the current project

Inputs: months, projectId.

get-logsB

Get Cloud Logging entries for the current project

Inputs: filter, pageSize.

list-gke-clustersB

List all GKE clusters in the current project

Inputs: location.

list-projectsA

List all GCP projects accessible with current credentials

Inputs: no named parameters.

list-sql-instancesB

List all Cloud SQL instances in the current project

Inputs: no named parameters.

run-gcp-codeD

Run GCP code

Inputs: code (required), reasoning (required), region, projectId.

select-projectB

Selects GCP project to use for subsequent interactions

Inputs: projectId (required), region.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 9 tools

    Disambiguation4/5

    Tools are mostly distinct: billing-related tools (budget, info, forecast) are clearly separate, and list/select tools for different resources are unambiguous. The only potential confusion is 'run-gcp-code' which is vague but still distinct from other tools.

    Naming Consistency5/5

    All tool names follow a consistent verb-noun pattern with hyphens (e.g., get-billing-budget, list-gke-clusters, select-project). The naming convention is uniform and predictable.

    Tool Count5/5

    The server has 9 tools, which is an appropriate size for a focused GCP management server. It covers several key areas without being overwhelming.

    Completeness2/5

    The tool surface is limited to reading and listing operations for select GCP services (billing, logs, GKE, SQL, projects). Missing CRUD operations for resources, compute, storage, IAM, and other common GCP tasks. The vague 'run-gcp-code' tool does not compensate for these gaps.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      A Model Context Protocol server that connects to Google Cloud services, allowing users to query logs, interact with Spanner databases, and analyze Cloud Monitoring metrics through natural language interaction.
      40
      80
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      A Model Context Protocol server that enables AI assistants to interact with Kubernetes clusters through natural language, supporting core Kubernetes operations, monitoring, security, and diagnostics.
      280 npm
      976
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      A Model Context Protocol server allowing Claude AI to interact with AWS resources through natural language, enabling users to query and manage AWS services without using the traditional AWS Console or CLI.
      3
      6
      ISC