The Google Cloud MCP Server provides a Model Context Protocol server that connects to Google Cloud services, allowing you to interact with your cloud resources through natural language. It supports Logging, Monitoring, and Spanner services, with more integrations in development.
You can set up the Google Cloud MCP server by following these steps:
# Clone the repository
git clone https://github.com/krzko/google-cloud-mcp.git
cd google-cloud-mcp
# Install dependencies
pnpm install
# Build
pnpm build
Before using the server, you need to authenticate with Google Cloud. The server supports two authentication methods:
Authenticate using Google Cloud's CLI:
gcloud auth application-default login
Set the following environment variables directly:
GOOGLE_CLIENT_EMAIL
GOOGLE_PRIVATE_KEY
The server will use the GOOGLE_CLOUD_PROJECT
environment variable if set, otherwise it will attempt to determine the project ID from the authentication credentials.
Configure the MCP server in your client by adding it to your mcpServers
configuration:
{
"mcpServers": {
"google-cloud-mcp": {
"command": "node",
"args": [
"/Users/foo/code/google-cloud-mcp/dist/index.js"
],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/Users/foo/.config/gcloud/application_default_credentials.json"
}
}
}
}
With this service, you can:
This service allows you to:
Interact with Spanner databases to:
If you encounter timeout issues:
debug: true
in your configurationlazyAuth: true
is set to defer authenticationIf authentication fails, ensure:
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.
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"
]
}
}
}
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.
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.