EG

eniayomi/gcp-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

199 stars 31 forks 质量 65 趋势 0MIT

eniayomi/gcp-mcp 是从 https://github.com/eniayomi/gcp-mcp. 导入的 MCP 服务器候选

概览

eniayomi/gcp-mcp 是从 https://github.com/eniayomi/gcp-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

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

特色

  • 🔍 使用自然语言查询和修改GCP资源
  • ☁️ 支持多个GCP项目
  • 🌐 多区域支持
  • 🔐 安全凭证处理(外部服务不泄露凭证)
  • 🏃 ♂️ 用你的GCP凭证进行本地执行
  • 🔄 自动重试以提升可靠性

先修条件

  • Node.js
  • Claude桌面/光标/风帆冲浪
  • GCP 凭据在本地配置(应用默认凭证)

安装

  1. 克隆仓库:

  2. 安装依赖:

配置

克劳德桌面

  1. 打开 Claude 桌面应用,进入设置 -> 开发者 -> 编辑配置

  2. 在你的claude_desktop_config.json中添加以下条目:

通过NPM:

如果你是从源代码安装的:

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

光标

  1. 打开光标并进入设置(⌘,)
  2. 导航至AI->模型上下文协议

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

GCP MCP

A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with your Google Cloud Platform environment. This allows for natural language querying and management of your GCP resources during conversations.

Features

  • 🔍 Query and modify GCP resources using natural language
  • ☁️ Support for multiple GCP projects
  • 🌐 Multi-region support
  • 🔐 Secure credential handling (no credentials are exposed to external services)
  • 🏃‍♂️ Local execution with your GCP credentials
  • 🔄 Automatic retries for improved reliability

Prerequisites

  • Node.js
  • Claude Desktop/Cursor/Windsurf
  • GCP credentials configured locally (application default credentials)

Installation

  1. Clone the repository:
git clone https://github.com/eniayomi/gcp-mcp
cd gcp-mcp
  1. Install dependencies:
npm install

Configuration

Claude Desktop

  1. Open Claude desktop app and go to Settings -> Developer -> Edit Config

  2. Add the following entry to your claude_desktop_config.json:

via npm:

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

If you installed from source:

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

Replace /path/to/gcp-mcp with the actual path to your project directory if using source installation.

Cursor

  1. Open Cursor and go to Settings (⌘,)
  2. Navigate to AI -> Model Context Protocol
  3. Add a new MCP configuration:
{
  "gcp": {
    "command": "npx -y gcp-mcp"
  }
}

Windsurf

  1. Open ~/.windsurf/config.json (create if it doesn’t exist)
  2. Add the MCP configuration:
{
  "mcpServers": {
    "gcp": {
      "command": "npx -y gcp-mcp"
    }
  }
}

GCP Setup

  1. Set up GCP credentials:

    • Set up application default credentials using gcloud auth application-default login
  2. Refresh your AI assistant (Claude Desktop/Cursor/Windsurf)

Usage

Start by selecting a project or asking questions like:

  • “List all GCP projects I have access to”
  • “Show me all Cloud SQL instances in project X”
  • “What’s my current billing status?”
  • “Show me the logs from my Cloud Run services”
  • “List all GKE clusters in us-central1”
  • “Show me all Cloud Storage buckets in project X”
  • “What Cloud Functions are deployed in us-central1?”
  • “List all Cloud Run services”
  • “Show me BigQuery datasets and tables”

Available Tools

  1. run-gcp-code: Execute GCP API calls using TypeScript code
  2. list-projects: List all accessible GCP projects
  3. select-project: Select a GCP project for subsequent operations
  4. get-billing-info: Get billing information for the current project
  5. get-cost-forecast: Get cost forecast for the current project
  6. get-billing-budget: Get billing budgets for the current project
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

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