GCP MCP Server
这不是一个 Ready MCP 服务器
GCP MCP 服务器
针对 Google Cloud Platform (GCP) 服务的全面模型上下文协议 (MCP) 服务器实现,使 AI 助手能够通过标准化界面与 GCP 资源进行交互和管理。
概述
GCP MCP 服务器为 AI 助手提供以下功能:
查询 GCP 资源:获取有关您的云基础架构的信息
管理云资源:创建、配置和管理 GCP 服务
获得帮助:获取有关 GCP 配置和最佳实践的 AI 指导帮助
该实现遵循 MCP 规范,使 AI 系统能够以安全、可控的方式与 GCP 服务交互。
Related MCP server: gcloud MCP Cloud Run
支持的 GCP 服务
此实现包括对以下 GCP 服务的支持:
Artifact Registry :容器和包管理
BigQuery :数据仓库和分析
云审计日志:日志记录和审计跟踪分析
Cloud Build :CI/CD 管道管理
云计算引擎:虚拟机实例
云监控:指标、警报和仪表板
Cloud Run :无服务器容器部署
云存储:对象存储管理
建筑学
该项目结构如下:
gcp-mcp-server/
├── core/ # Core MCP server functionality auth context logging_handler security
├── prompts/ # AI assistant prompts for GCP operations
├── services/ # GCP service implementations
│ ├── README.md # Service implementation details
│ └── ... # Individual service modules
├── main.py # Main server entry point
└── ...关键组件:
服务模块:每个 GCP 服务都有自己的模块,其中包含资源、工具和提示
客户端实例:集中式客户端管理,用于身份验证和资源访问
核心组件:MCP 服务器实现的基本功能
入门
先决条件
Python 3.10+
已启用您要使用的服务的 API 的 GCP 项目
经过身份验证的 GCP 凭据(建议使用应用程序默认凭据)
安装
克隆存储库:
git clone https://github.com/yourusername/gcp-mcp-server.git cd gcp-mcp-server设置虚拟环境:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate安装依赖项:
pip install -r requirements.txt配置您的 GCP 凭据:
# Using gcloud gcloud auth application-default login # Or set GOOGLE_APPLICATION_CREDENTIALS export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"设置环境变量:
cp .env.example .env # Edit .env with your configuration
运行服务器
启动 MCP 服务器:
python main.py对于开发和测试:
# Development mode with auto-reload
python main.py --dev
# Run with specific configuration
python main.py --config config.yamlDocker 部署
使用 Docker 构建并运行:
# Build the image
docker build -t gcp-mcp-server .
# Run the container
docker run -p 8080:8080 -v ~/.config/gcloud:/root/.config/gcloud gcp-mcp-server配置
可以通过环境变量或配置文件来配置服务器:
环境变量 | 描述 | 默认 |
| 默认 GCP 项目 ID | 无(必填) |
| 默认区域/地区 |
|
| 服务器端口 |
|
| 日志级别 |
|
请参阅.env.example以获取完整的配置选项列表。
发展
添加新的 GCP 服务
在
services/目录中创建一个新文件按照现有服务的模式实现服务
在
main.py中注册服务
请参阅服务自述文件以获取详细的实施指导。
安全注意事项
服务器使用应用程序默认凭据进行身份验证
授权由已认证身份的权限决定
服务实现中没有硬编码凭证
考虑使用具有适当权限的服务帐户运行
贡献
欢迎贡献代码!欢迎提交 Pull 请求。
分叉存储库
创建你的功能分支(
git checkout -b feature/amazing-feature)提交您的更改(
git commit -m 'Add some amazing feature')推送到分支(
git push origin feature/amazing-feature)打开拉取请求
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
致谢
Google Cloud Platform 团队提供的全面 API
模型上下文协议,为人工智能与服务交互提供标准化方式
使用服务器
要使用此服务器:
将您的 GCP 服务帐户密钥文件作为
service-account.json放在同一目录中安装 MCP 包:
pip install "mcp[cli]"安装所需的 GCP 包:
pip install google-cloud-run运行:
mcp dev gcp_cloudrun_server.py
或者在 Claude Desktop 中安装:
mcp install gcp_cloudrun_server.py --name "GCP Cloud Run Manager"MCP 服务器配置
可以将以下配置添加到 GCP Cloud Tools 的配置文件中:
"mcpServers": {
"GCP Cloud Tools": {
"command": "uv",
"args": [
"run",
"--with",
"google-cloud-artifact-registry>=1.10.0",
"--with",
"google-cloud-bigquery>=3.27.0",
"--with",
"google-cloud-build>=3.0.0",
"--with",
"google-cloud-compute>=1.0.0",
"--with",
"google-cloud-logging>=3.5.0",
"--with",
"google-cloud-monitoring>=2.0.0",
"--with",
"google-cloud-run>=0.9.0",
"--with",
"google-cloud-storage>=2.10.0",
"--with",
"mcp[cli]",
"--with",
"python-dotenv>=1.0.0",
"mcp",
"run",
"C:\\Users\\enes_\\Desktop\\mcp-repo-final\\gcp-mcp\\src\\gcp-mcp-server\\main.py"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "C:/Users/enes_/Desktop/mcp-repo-final/gcp-mcp/service-account.json",
"GCP_PROJECT_ID": "gcp-mcp-cloud-project",
"GCP_LOCATION": "us-east1"
}
}
}配置详细信息
此配置为 Google Cloud Platform 工具设置了以下内容的 MCP 服务器:
命令:使用
uv包管理器运行服务器依赖项:包括各种 Google Cloud 库(Artifact Registry、BigQuery、Cloud Build 等)
环境变量:
GOOGLE_APPLICATION_CREDENTIALS:您的 GCP 服务帐户凭据的路径GCP_PROJECT_ID:您的 Google Cloud 项目 IDGCP_LOCATION:GCP 区域 (us-east1)
用法
将此配置添加到您的 MCP 配置文件以启用 GCP Cloud Tools 功能。
Available Tools
1 tooltest_gcp_authC
Test GCP authentication
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It mentions 'test' but doesn't disclose behavioral traits like what gets tested (e.g., credentials, permissions), whether it's safe/destructive, or what output to expect. This leaves significant gaps for a tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise ('Test GCP authentication') with no wasted words, making it front-loaded and easy to parse. It efficiently conveys the core purpose in minimal text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (simple auth test) but lack of annotations and output schema, the description is incomplete. It doesn't explain what 'test' entails, what success/failure looks like, or any behavioral context, leaving the agent with insufficient information.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description doesn't add param info, but that's acceptable here, meeting the baseline for zero-param tools.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Test GCP authentication' states a clear purpose (testing authentication) but lacks specificity about what resource or system is being tested. It doesn't distinguish from siblings (though none exist), making it somewhat vague but functional.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool, such as during setup, troubleshooting, or validation scenarios. With no siblings, differentiation isn't needed, but general usage context is missing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
- First observed
test_gcp_auth
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion or overlap between tools. The single tool 'test_gcp_auth' has a clear and distinct purpose that cannot be mistaken for any other tool in this set.
The naming pattern is perfectly consistent as there is only one tool. It follows a verb_noun structure ('test_gcp_auth'), and with no other tools to compare, there are no deviations or inconsistencies in naming conventions.
The tool count of 1 is too few for a server named 'GCP MCP Server', which suggests a broad scope covering Google Cloud Platform services. A single authentication test tool is insufficient for meaningful interaction with GCP resources, making this a significant mismatch in scope.
The tool surface is severely incomplete for a GCP server. It only provides an authentication test, lacking any operations for core GCP services like compute, storage, databases, or management. This leaves major gaps that will prevent agents from performing useful tasks in the domain.
Maintenance
Related MCP Connectors
The Google Compute Engine MCP server is a fully-managed Model Context Protocol server that provides tools to manage Google Compute Engine resources through AI agents. It enables capabilities including instance management (creating, starting, stopping, resetting, listing), disk management, handling instance templates and group managers, viewing machine and accelerator types, managing images, and accessing reservation and commitment information. The server operates as a zero-deployment, enterprise-grade endpoint at https://compute.googleapis.com/mcp with built-in IAM-based security.
The Google GKE MCP server is a managed Model Context Protocol server that provides AI applications with tools to manage Google Kubernetes Engine (GKE) clusters and Kubernetes resources. It exposes a structured, discoverable interface that allows AI agents to interact with GKE and Kubernetes APIs, enabling them to inspect cluster configurations, retrieve Kubernetes resource YAMLs, monitor operations like cluster upgrades, diagnose issues, and optimize costs—all without needing to parse text output or use complex kubectl commands.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
The BigQuery remote MCP server is a fully managed service that uses the Model Context Protocol to connect AI applications and LLMs to BigQuery data sources. It provides secure, standardized tools for AI agents to list datasets and tables, retrieve schemas, generate and execute SQL queries through natural language, and analyze data—enabling direct access to enterprise analytics data without requiring manual SQL coding.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables AI assistants to interact with Google Cloud Platform resources through natural language queries. Supports querying and managing GCP services like Compute Engine, Cloud Storage, BigQuery, and more across multiple projects and regions.91,504 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Cloud Platform services through gcloud CLI commands via a Cloud Run deployed MCP server. Supports executing gcloud commands and managing GCP resources through natural language.MIT
- AlicenseBqualityNot gradedmaintenanceEnables AI assistants to interact with and manage Google Cloud Platform resources including Artifact Registry, BigQuery, Cloud Build, Compute Engine, Cloud Run, Cloud Storage, and monitoring services through a standardized MCP interface.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables management of Google Cloud services including BigQuery, Cloud Logging, Cloud Storage, and Compute Engine via MCP tools.MIT