Model Context Protocol server for Google Cloud Platform services. Provides 16 specialized tools for GCP logging and monitoring with AI assistant integration. Features enterprise-grade security, multi-project support, and comprehensive documentation.
Configuration
View docs{
"mcpServers": {
"jayrajgoyal-gcp-mcp": {
"command": "python3.11",
"args": [
"-m",
"gcp_mcp.cli",
"--credentials",
"/path/to/your/credentials.json"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/your/credentials.json"
}
}
}
}You run a GCP MCP Server to access Cloud Logging and related GCP services through an MCP interface. It lets you query logs, stream data in real time, detect error patterns, and perform root cause analysis across multiple projects, using secure authentication with a service account.
Start the MCP server locally and connect your MCP client to it. Use the provided tools to query Cloud Logging, analyze logs for patterns, and investigate errors across your GCP projects. The server supports running with a service account key or Application Default Credentials, so you can integrate it into your existing cloud workflows.
Prerequisites: you need Python 3.8 or higher. Ensure your GCP project has the necessary APIs enabled and you have a service account with sufficient permissions.
Step 1: Clone the project repository and navigate into it.
git clone https://github.com/JayRajGoyal/gcp-mcp.git
cd gcp-mcpStep 2: Install dependencies.
pip install -r requirements.txtStep 3: Run the MCP server with your credentials.
python -m gcp_mcp.cli --credentials /path/to/your/credentials.jsonIf you prefer running via Claude Code integration, you can add the MCP server configuration to Claude Code so you can start it from the Claude interface.
Authentication supports multiple methods. You can supply a service account key file via the GOOGLE_APPLICATION_CREDENTIALS environment variable, use Application Default Credentials, or authenticate with user credentials using gcloud.
Create a configuration file to set a default project and behavior for log processing. You can customize retention, result limits, and which log names to exclude.
Do not commit service account keys to version control. Use environment variables to configure credentials and follow best practices for securing credentials and access to your GCP resources.
If the server fails to start, verify that Python 3.8+ is installed, the credentials file exists at the specified path, and the service account has enough IAM roles (Logging viewer at minimum). Check the chosen project id and API enablement for Cloud Logging and related services.
The MCP server supports querying Cloud Logging data, real-time log streaming, error pattern detection, multi-project access, and root cause analysis. Planned enhancements include tighter Cloud Monitoring, Error Reporting, and Cloud Trace integrations.
Query GCP Cloud Logging with advanced filters to retrieve relevant log entries for a given project and time range.
Analyze logs to identify patterns, anomalies, and potential issues across services and projects.
Find and analyze error patterns in logs to aid root cause investigations across your GCP projects.