GCP MCP server

Enables developers to manage and interact with Google Cloud Platform resources like Compute Engine, Cloud Run, BigQuery, and Cloud Storage through a unified, tool-driven approach.
Back to servers
Provider
Enes Bol
Release date
Mar 09, 2025
Language
Python
Package
Stats
523 downloads
3 stars

The GCP MCP Server enables AI assistants to interact with Google Cloud Platform services through a standardized Model Context Protocol interface. It allows querying cloud resources, managing GCP services, and receiving AI-guided assistance with cloud configurations.

Installation Requirements

  • Python 3.10 or higher
  • GCP project with enabled APIs for desired services
  • Authenticated GCP credentials

Setting Up the Server

Install the Software

  1. Clone the repository:

    git clone https://github.com/yourusername/gcp-mcp-server.git
    cd gcp-mcp-server
    
  2. Create and activate a virtual environment:

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

    pip install -r requirements.txt
    

Configure Authentication

Set up your GCP credentials using one of these methods:

# Using gcloud command
gcloud auth application-default login

# OR by setting environment variable
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account-key.json"

Configure Environment

Create your environment configuration:

cp .env.example .env
# Edit .env with your specific settings

Running the Server

Standard Execution

Start the MCP server with:

python main.py

Additional Run Options

Development mode with auto-reload:

python main.py --dev

Using a specific configuration file:

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 Options

The server can be configured through environment variables:

Variable Description Default
GCP_PROJECT_ID Your GCP project ID Required
GCP_DEFAULT_LOCATION Default region/zone us-central1
MCP_SERVER_PORT Server port 8080
LOG_LEVEL Logging level INFO

Using the Server

Quick Start Method

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

Installing in Claude Desktop

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

MCP Configuration Integration

Add this to your MCP configuration file to enable 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",
      "PATH_TO_SERVER_MAIN_FILE"
    ],
    "env": {
      "GOOGLE_APPLICATION_CREDENTIALS": "PATH_TO_SERVICE_ACCOUNT_JSON",
      "GCP_PROJECT_ID": "YOUR_GCP_PROJECT_ID",
      "GCP_LOCATION": "PREFERRED_GCP_REGION"
    }
  }
}

Supported Services

The MCP server provides access to these GCP services:

  • Artifact Registry - Container and package management
  • BigQuery - Data warehousing and analytics
  • Cloud Audit Logs - Logging analysis
  • Cloud Build - CI/CD pipeline management
  • Cloud Compute Engine - VM instances
  • Cloud Monitoring - Metrics and alerting
  • Cloud Run - Serverless container deployments
  • Cloud Storage - Object storage

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later