这不是一个 Ready MCP 服务器
GCP MCP 服务器
针对 Google Cloud Platform (GCP) 服务的全面模型上下文协议 (MCP) 服务器实现,使 AI 助手能够通过标准化界面与 GCP 资源进行交互和管理。
概述
GCP MCP 服务器为 AI 助手提供以下功能:
- 查询 GCP 资源:获取有关您的云基础架构的信息
- 管理云资源:创建、配置和管理 GCP 服务
- 获得帮助:获取有关 GCP 配置和最佳实践的 AI 指导帮助
该实现遵循 MCP 规范,使 AI 系统能够以安全、可控的方式与 GCP 服务交互。
支持的 GCP 服务
此实现包括对以下 GCP 服务的支持:
- Artifact Registry :容器和包管理
- BigQuery :数据仓库和分析
- 云审计日志:日志记录和审计跟踪分析
- Cloud Build :CI/CD 管道管理
- 云计算引擎:虚拟机实例
- 云监控:指标、警报和仪表板
- Cloud Run :无服务器容器部署
- 云存储:对象存储管理
建筑学
该项目结构如下:
关键组件:
- 服务模块:每个 GCP 服务都有自己的模块,其中包含资源、工具和提示
- 客户端实例:集中式客户端管理,用于身份验证和资源访问
- 核心组件:MCP 服务器实现的基本功能
入门
先决条件
- Python 3.10+
- 已启用您要使用的服务的 API 的 GCP 项目
- 经过身份验证的 GCP 凭据(建议使用应用程序默认凭据)
安装
- 克隆存储库:
- 设置虚拟环境:
- 安装依赖项:
- 配置您的 GCP 凭据:
- 设置环境变量:
运行服务器
启动 MCP 服务器:
对于开发和测试:
Docker 部署
使用 Docker 构建并运行:
配置
可以通过环境变量或配置文件来配置服务器:
环境变量 | 描述 | 默认 |
---|---|---|
GCP_PROJECT_ID | 默认 GCP 项目 ID | 无(必填) |
GCP_DEFAULT_LOCATION | 默认区域/地区 | us-central1 |
MCP_SERVER_PORT | 服务器端口 | 8080 |
LOG_LEVEL | 日志级别 | INFO |
请参阅.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 服务器配置
可以将以下配置添加到 GCP Cloud Tools 的配置文件中:
配置详细信息
此配置为 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 功能。
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
使 AI 助手能够通过标准化 MCP 界面与 Google Cloud Platform 资源(包括 Compute Engine、Cloud Run、Storage、BigQuery 和其他 GCP 服务)进行交互并进行管理。
Related MCP Servers
- AsecurityFlicenseAqualityEnables AI assistants to interact with Confluence Cloud for managing spaces, pages, and content via the Model Context Protocol (MCP).Last updated -1115TypeScript
- -securityAlicense-qualityAn MCP server that enables AI assistants to access and interact with Google Classroom data, allowing users to view courses, course details, and assignments through natural language commands.Last updated -7761JavaScriptMIT License
- -securityFlicense-qualityAn MCP Server that provides a natural language interface to Google Cloud Resource Settings API, enabling users to view and manage settings for Google Cloud resources through conversation.Last updated -Python
- -securityFlicense-qualityAn MCP Server that enables interaction with Google's Service Usage API, allowing management and control of which Google Cloud Platform APIs and services are enabled for a project.Last updated -Python