Enable MCP-compatible AI agents to deploy apps to GKE.
"mcpServers":{
"gke": {
"command": "npx",
"args": ["-y", "https://github.com/GoogleCloudPlatform/cloud-run-mcp"]
}
}Deploy from AI-powered IDEs:
Deploy from AI assistant apps:
Deploy from agent SDKs, like the Google Gen AI SDK or Agent Development Kit.
Note
This is the repository of an MCP server to deploy code to GKE. The server can be hosted on any platform that supports Node.js.
deploy-file-contents: Deploys files to GKE by providing their contents directly.list-clusters: Lists GKE clusters in a given project and region.get-cluster: Gets details for a specific GKE cluster.deploy-local-files*: Deploys files from the local file system to a GKE cluster.deploy-local-folder*: Deploys a local folder to a GKE cluster.list-projects*: Lists available GCP projects.create-project*: Creates a new GCP project and attach it to the first available billing account. A project ID can be optionally specified.
* only available when running locally
Run the GKE MCP server on your local machine using local Google Cloud credentials. This is best if you are using an AI-assisted IDE (e.g. Cursor) or a desktop AI application (e.g. Claude).
-
Install Node.js (LTS version recommended).
-
Install the Google Cloud SDK and authenticate with your Google account.
-
Log in to your Google Cloud account using the command:
gcloud auth login
-
Set up application credentials using the command:
gcloud auth application-default login
-
Install kubectl:
gcloud components install kubectl
-
Update the MCP configuration file of your MCP client with the following:
"gke": { "command": "npx", "args": ["-y", "https://github.com/GoogleCloudPlatform/cloud-run-mcp"] }
Warning
Do not use the remote MCP server without authentication. In the following instructions, we will use IAM authentication to secure the connection to the MCP server from your local machine. This is important to prevent unauthorized access to your Google Cloud resources.
Run the GKE MCP server itself on a GKE cluster with connection from your local machine authenticated via IAM. With this option, you will only be able to deploy code to the same Google Cloud project as where the MCP server is running.
-
Install the Google Cloud SDK and authenticate with your Google account.
-
Log in to your Google Cloud account using the command:
gcloud auth login
-
Set your Google Cloud project ID using the command:
gcloud config set project YOUR_PROJECT_ID -
Create a GKE cluster if you don't have one:
gcloud container clusters create mcp-server-cluster --zone europe-west1-b --num-nodes 1
-
Deploy the MCP server to GKE:
kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/cloud-run-mcp/main/k8s/mcp-server.yaml
-
Set up port forwarding to access the MCP server:
kubectl port-forward service/mcp-server 3000:80
-
Update the MCP configuration file of your MCP client with the following:
"gke": { "url": "http://localhost:3000/sse" }
If your MCP client does not support the
urlattribute, you can use mcp-remote:"gke": { "command": "npx", "args": ["-y", "mcp-remote", "http://localhost:3000/sse"] }
Before using this MCP server, ensure you have:
- A Google Cloud Platform account with billing enabled
- The Google Cloud SDK installed and configured
- kubectl installed and configured
- A GKE cluster created in your project
- The necessary IAM permissions to manage GKE resources
The following Google Cloud APIs must be enabled in your project:
container.googleapis.com(GKE API)iam.googleapis.com(IAM API)storage.googleapis.com(Cloud Storage API)cloudbuild.googleapis.com(Cloud Build API)artifactregistry.googleapis.com(Artifact Registry API)
The MCP server will attempt to enable these APIs automatically if they are not already enabled.