
GCP
STDIOMCP server for managing and interacting with Google Cloud Platform services
MCP server for managing and interacting with Google Cloud Platform services
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.
GCP MCP Server provides AI assistants with capabilities to:
The implementation follows the MCP specification to enable AI systems to interact with GCP services in a secure, controlled manner.
This implementation includes support for the following GCP services:
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:
Clone the repository:
git clone https://github.com/yourusername/gcp-mcp-server.git cd gcp-mcp-server
Set up a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies:
pip install -r requirements.txt
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"
Set up environment variables:
cp .env.example .env # Edit .env with your configuration
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
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
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.
services/
directorymain.py
See the services README for detailed implementation guidance.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
To use this server:
service-account.json
in the same directorypip install "mcp[cli]"
pip install google-cloud-run
mcp dev gcp_cloudrun_server.py
Or install it in Claude Desktop:
mcp install gcp_cloudrun_server.py --name "GCP Cloud Run Manager"
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" } } }
This configuration sets up an MCP server for Google Cloud Platform tools with the following:
uv
package manager to run the serverGOOGLE_APPLICATION_CREDENTIALS
: Path to your GCP service account credentialsGCP_PROJECT_ID
: Your Google Cloud project IDGCP_LOCATION
: GCP region (us-east1)Add this configuration to your MCP configuration file to enable GCP Cloud Tools functionality.