GCP MCP Server

GCP MCP Server

Enables 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.

Category
访问服务器

README

This is not a Ready MCP Server

GCP MCP Server

A comprehensive Model Context Protocol (MCP) server implementation for Google Cloud Platform (GCP) services, enabling AI assistants to interact with and manage GCP resources through a standardized interface.

Overview

GCP MCP Server provides AI assistants with capabilities to:

  • Query GCP Resources: Get information about your cloud infrastructure
  • Manage Cloud Resources: Create, configure, and manage GCP services
  • Receive Assistance: Get AI-guided help with GCP configurations and best practices

The implementation follows the MCP specification to enable AI systems to interact with GCP services in a secure, controlled manner.

Supported GCP Services

This implementation includes support for the following GCP services:

  • Artifact Registry: Container and package management
  • BigQuery: Data warehousing and analytics
  • Cloud Audit Logs: Logging and audit trail analysis
  • Cloud Build: CI/CD pipeline management
  • Cloud Compute Engine: Virtual machine instances
  • Cloud Monitoring: Metrics, alerting, and dashboards
  • Cloud Run: Serverless container deployments
  • Cloud Storage: Object storage management

Architecture

The project is structured as follows:

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
└── ...

Key components:

  • Service Modules: Each GCP service has its own module with resources, tools, and prompts
  • Client Instances: Centralized client management for authentication and resource access
  • Core Components: Base functionality for the MCP server implementation

Getting Started

Prerequisites

  • Python 3.10+
  • GCP project with enabled APIs for the services you want to use
  • Authenticated GCP credentials (Application Default Credentials recommended)

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/gcp-mcp-server.git
    cd gcp-mcp-server
    
  2. Set up a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Configure your GCP credentials:

    # Using gcloud
    gcloud auth application-default login
    
    # Or set GOOGLE_APPLICATION_CREDENTIALS
    export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"
    
  5. Set up environment variables:

    cp .env.example .env
    # Edit .env with your configuration
    

Running the Server

Start the MCP server:

python main.py

For development and testing:

# Development mode with auto-reload
python main.py --dev

# Run with specific configuration
python main.py --config config.yaml

Docker Deployment

Build and run with 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

Configuration

The server can be configured through environment variables or a configuration file:

Environment Variable Description Default
GCP_PROJECT_ID Default GCP project ID None (required)
GCP_DEFAULT_LOCATION Default region/zone us-central1
MCP_SERVER_PORT Server port 8080
LOG_LEVEL Logging level INFO

See .env.example for a complete list of configuration options.

Development

Adding a New GCP Service

  1. Create a new file in the services/ directory
  2. Implement the service following the pattern in existing services
  3. Register the service in main.py

See the services README for detailed implementation guidance.

Security Considerations

  • The server uses Application Default Credentials for authentication
  • Authorization is determined by the permissions of the authenticated identity
  • No credentials are hardcoded in the service implementations
  • Consider running with a service account with appropriate permissions

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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

Acknowledgments

  • Google Cloud Platform team for their comprehensive APIs
  • Model Context Protocol for providing a standardized way for AI to interact with services

Using the Server

To use this server:

  1. Place your GCP service account key file as service-account.json in the same directory
  2. Install the MCP package: pip install "mcp[cli]"
  3. Install the required GCP package: pip install google-cloud-run
  4. Run: mcp dev gcp_cloudrun_server.py

Or install it in Claude Desktop:

mcp install gcp_cloudrun_server.py --name "GCP Cloud Run Manager"

MCP Server Configuration

The following configuration can be added to your configuration file for 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"
    }
  }
}

Configuration Details

This configuration sets up an MCP server for Google Cloud Platform tools with the following:

  • Command: Uses uv package manager to run the server
  • Dependencies: Includes various Google Cloud libraries (Artifact Registry, BigQuery, Cloud Build, etc.)
  • Environment Variables:
    • GOOGLE_APPLICATION_CREDENTIALS: Path to your GCP service account credentials
    • GCP_PROJECT_ID: Your Google Cloud project ID
    • GCP_LOCATION: GCP region (us-east1)

Usage

Add this configuration to your MCP configuration file to enable GCP Cloud Tools functionality.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选