home / mcp / google cloud mcp server
🤖 A Model Context Protocol (MCP) server for Google Cloud (GCP)
Configuration
View docs{
"mcpServers": {
"krzko-google-cloud-mcp": {
"command": "node",
"args": [
"/Users/foo/code/google-cloud-mcp/dist/index.js"
],
"env": {
"GOOGLE_PRIVATE_KEY": "YOUR_PRIVATE_KEY",
"GOOGLE_CLIENT_EMAIL": "YOUR_CLIENT_EMAIL",
"GOOGLE_APPLICATION_CREDENTIALS": "/Users/foo/.config/gcloud/application_default_credentials.json"
}
}
}
}This Google Cloud MCP Server lets you connect to Google Cloud services to retrieve context and perform actions on resources such as Billing, IAM, Logging, Monitoring, Spanner, and more. It enables natural-language interactions to query data, run analyses, and execute cloud operations from a single MCP client.
You interact with Google Cloud resources by running natural-language prompts through your MCP client. Start by configuring the server connection in your client with the stdio workflow described here, then ask for concrete tasks like listing Spanner databases, querying IAM policies, or fetching error trends. Use straightforward prompts such as: “Show me billing accounts,” “List Spanner databases in my instance,” or “Analyse costs for project my-app-prod-123 for the last 30 days.” The server translates your natural language into Google Cloud API calls and returns structured results or suggested actions.
Prerequisites you need before installing this MCP server: a current Node.js environment, a JavaScript/TypeScript project setup, and access to Google Cloud credentials.
Install steps you should follow exactly:
Configure authentication so the server can access Google Cloud resources. You have two options: provide a Service Account Key File and set the GOOGLE_APPLICATION_CREDENTIALS environment variable, or export the individual credentials via GOOGLE_CLIENT_EMAIL and GOOGLE_PRIVATE_KEY. The server will also use GOOGLE_CLOUD_PROJECT if you set it.
A concrete example of starting the server locally after building it is shown in the snippet below. It runs the local Node process and points to the built entry script, with credentials supplied via an environment variable.
Two methods are supported to authenticate with Google Cloud. Use a Service Account Key File by setting GOOGLE_APPLICATION_CREDENTIALS to the path of your key file, which is the recommended approach. Alternatively, you can set GOOGLE_CLIENT_EMAIL and GOOGLE_PRIVATE_KEY directly in the environment. The server will use GOOGLE_CLOUD_PROJECT if you set it.
Make sure the service account has the necessary permissions for the actions you plan to perform, and ensure that the credentials are accessible to the environment where the MCP server runs.
If you encounter issues starting or running the server, enable debugging, verify credentials are accessible, and check for authentication-related errors. Common steps include ensuring lazy authentication is configured if you want the server to authenticate only when needed, and confirming the credentials file contents are valid.
List all billing accounts available to your Google Cloud organization or user.
Retrieve detailed information for a specific billing account.
List projects associated with a billing account.
Fetch details about a specific project’s billing configuration.
Show available billing services for a given scope.
List SKUs (pricing components) for billing analysis.
Analyse costs across projects or time ranges to identify optimization opportunities.
Detect unusual cost patterns that may indicate misconfigurations or anomalies.
Provide recommendations to reduce or optimize billing costs.
Break down costs by service within a billing account.
List error groups reported by your Google Cloud projects.
Get detailed information for a specific error group.
Analyse error trends over time across services.
Retrieve the IAM policy for a project.
Test whether you have specific permissions on a project.
Test whether you have permissions on a resource.
Validate if required permissions are in place for deployment.
List services involved in a deployment context.
Identify gaps in permissions necessary for operations.
Query log entries from Google Cloud Logging.
Query logs over a specified time range.
Perform comprehensive log searches with filters.
Execute SQL queries against Spanner databases.
List tables within a Spanner database.
List Spanner instances in your project.
List databases within a Spanner instance.
Query Spanner using natural language prompts.
Return count results for a Spanner query.
Query Google Cloud Monitoring metrics.
List available metric types in a project.
Query monitoring data using natural language.
List CPU/profile data captured by Cloud Profiler.
Analyse performance profiling results.
Compare profiling trends across deployments.
Get details for a distributed trace.
List traces for a project.
Find traces related to specific logs.
Query traces using natural language prompts.