gke-mcp

command module
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

README

GKE MCP Server and Gemini CLI Extension

Enable MCP-compatible AI agents to interact with Google Kubernetes Engine.

A demonstration of using the GKE MCP server with the Gemini CLI

Installation

Choose a way to install the MCP Server and then connect your AI to it.

Use as a Gemini CLI Extension
  1. Install Gemini CLI.

  2. Install the extension

gemini extensions install https://github.com/GoogleCloudPlatform/gke-mcp.git
Use in MCP Clients / Other AIs
Quick Install (Linux & macOS only)
curl -sSL https://raw.githubusercontent.com/GoogleCloudPlatform/gke-mcp/main/install.sh | bash
Manual Install

If you haven't already installed Go, follow these instructions.

Once Go is installed, run the following command to install gke-mcp:

go install github.com/GoogleCloudPlatform/gke-mcp@latest

The gke-mcp binary will be installed in the directory specified by the GOBIN environment variable. If GOBIN is not set, it defaults to $GOPATH/bin and, if GOPATH is also not set, it falls back to $HOME/go/bin.

You can find the exact location by running go env GOBIN. If the command returns an empty value, run go env GOPATH to find the installation directory.

For additional help, refer to the troubleshoot section: gke-mcp: command not found.

Add the MCP Server to your AI

For detailed instructions on how to connect the GKE MCP Server to various AI clients, including cursor, Visual Studio Code, and claude desktop, please refer to our dedicated installation guide.

MCP Tools

  • cluster_toolkit_download: Download the Cluster Toolkit Git repository.
  • list_clusters: List GKE clusters.
  • get_cluster: Get detailed information about a single GKE cluster.
  • create_cluster: Create a new GKE cluster (defaults to Autopilot).
  • get_kubeconfig: Configure kubeconfig for a GKE cluster.
  • update_cluster: Update a GKE cluster.
  • get_node_sos_report: Generate and download an SOS report from a GKE node.
  • delete_cluster: Delete a GKE cluster (if enabled).
  • gke_deploy: Deploy a workload to a GKE cluster using a configuration file.
  • query_logs: Query Google Cloud Platform logs using Logging Query Language (LQL).
  • get_log_schema: Get the schema for a specific GKE log type.
  • list_monitored_resource_descriptors: List monitored resource descriptors for GKE.
  • list_recommendations: List recommendations for GKE clusters.
  • get_k8s_changelog: Get Kubernetes changelog for upgrades.
  • get_gke_release_notes: Get GKE release notes.
  • generate_manifest: Generate a Kubernetes manifest using Vertex AI.

MCP Prompts

Prompts provide guided workflows and expert knowledge templates.

  • gke:cost: Answer natural language questions about GKE-related costs.
  • gke:deploy: Deploys a workload to a GKE cluster using a configuration file.
  • gke:upgrade-risk-report: GKE control plane upgrade risk report, analyzing the potential risks of upgrading from its current version to the target version. Performs pre-upgrade checks, API deprecations scans, and more.
  • gke:upgrades-best-practices-risk-report: GKE control plane upgrade best practices, applied for the specified cluster. Helps making upgrades uneventful.

MCP Context

In addition to the tools above, a lot of value is provided through the bundled context instructions.

  • Cost: The provided instructions allows the AI to answer many questions related to GKE costs, including queries related to clusters, namespaces, and Kubernetes workloads.

  • GKE Known Issues: The provided instructions allows the AI to fetch the latest GKE Known issues and check whether the cluster is affected by one of these known issues.

Supported MCP Transports

By default, gke-mcp uses the stdio transport. Additionally, the Streamable HTTP transport is supported as well.

You can set the transport mode using the following options:

--server-mode: transport to use for the server: stdio (default) or http

--server-port: server port to use when server-mode is http or sse; defaults to 8080

gke-mcp --server-mode http --server-port 8080

[!WARNING] When using the Streamable HTTP transport, the server listens on all network interfaces (e.g., 0.0.0.0), which can expose it to any network your machine is connected to. Please ensure you have a firewall ad/or other security measures in place to restrict access if the server is not intended to be public.

Connecting Gemini CLI to the HTTP Server

To connect Gemini CLI to the gke-mcp HTTP server, you need to configure the CLI to point to the correct endpoint. You can do this by updating your ~/.gemini/settings.json file. For a basic setup without authentication, the file should look like this:

{
  "mcpServers": {
    "gke": {
      "httpUrl": "http://127.0.0.1:8080/mcp"
    }
  }
}

This configuration tells Gemini CLI how to reach the gke-mcp server running on your local machine at port 8080.

Skills

Skills provide specialized capabilities and workflows to your AI agent.

Available Skills
  • custom-golden-image-discovery: Discover golden base images for GKE custom nodes.
  • gke-ai-troubleshooting-skill-creation-guide: Guide for building high-quality GKE troubleshooting skills.
  • gke-ai-troubleshooting-tpu-connection-failure-vbar-oom: Diagnose and prevent TPU connection failures and OOMs.
  • gke-app-onboarding: Workflows for containerizing and deploying applications to GKE.
  • gke-backup-dr: Configure Backup for GKE and disaster recovery.
  • gke-cluster-creator: Create GKE clusters using predefined templates.
  • gke-cluster-lifecycle: Manage lifecycle and upgrades of GKE clusters.
  • gke-compute-class-creator: Create GKE ComputeClass resources.
  • gke-cost-analysis: Answer questions about GKE-related costs.
  • gke-cost-optimization: Optimize costs for GKE clusters.
  • gke-inference-quickstart: Deploy optimized AI/ML inference workloads on GKE.
  • gke-multi-tenancy: Implement multi-tenancy and governance in GKE.
  • gke-networking-edge: Configure edge networking, ingress, and security on GKE.
  • gke-observability: Set up and audit observability on GKE.
  • gke-productionize: Prepare applications and clusters for production.
  • gke-reliability: Ensure high availability and reliability of GKE workloads.
  • gke-storage: Manage storage in GKE clusters.
  • gke-workload-scaling: Scale GKE workloads using HPA and VPA.
  • gke-workload-security: Audit and harden the security of GKE workloads.
Installing Skills

There are several ways to install these skills:

  1. Automatic Detection: When you install the MCP server as a Gemini CLI Extension, the CLI automatically detects and enables all skills located in the skills/ folder.

  2. Standalone Individual Skill: Install a specific skill without the full MCP extension:

    gemini skills install https://github.com/GoogleCloudPlatform/gke-mcp --path skills/<skill-name>
    

    Replace <skill-name> with the name of a skill from the skills/ directory (e.g., gke-cost-analysis).

  3. Standalone Bulk Link: To enable all skills at once without installing the full MCP extension:

    git clone https://github.com/GoogleCloudPlatform/gke-mcp.git
    gemini skills link ./gke-mcp/skills
    

Development

To compile the binary and update the gemini-cli extension with your local changes, follow these steps:

  1. Remove the global gke-mcp configuration

    rm -rf ~/.gemini/extensions/gke-mcp
    
  2. Build the binary from the root of the project:

    go build -o gke-mcp .
    
  3. Run the installation command to update the extension manifest:

    ./gke-mcp install gemini-cli --developer
    

    This will make gemini-cli use your locally compiled binary.

Disclaimers

  • The Google Cloud Platform Terms of Service (available at https://cloud.google.com/terms/) and the Data Processing and Security Terms (available at https://cloud.google.com/terms/data-processing-terms) do not apply to any component of the GKE MCP Server software.
  • This tool is provided for education and experimentation, and is not an officially supported Google product. It is maintained on a best-effort basis, and may change without notice.
  • This project interacts with Large Language Models and comes with inherent risks.
    • Use at Your Own Risk: This software is experimental, non-deterministic, and provided "AS IS" with NO GUARANTEES or warranties.
    • NOT FOR PRODUCTION USE.
    • Data Sensitivity: Avoid using untrusted data. NEVER input secrets, API keys, or sensitive information.
    • Verify Outputs: LLM responses can be unpredictable and may be inaccurate. Always verify results.

Documentation

Overview

Package main provides the gke-mcp CLI entrypoint.

Directories

Path Synopsis
Package cmd wires up the CLI entrypoints for the GKE MCP server.
Package cmd wires up the CLI entrypoints for the GKE MCP server.
pkg
agents/manifestgen
Package manifestgen provides an agent for generating Kubernetes manifests.
Package manifestgen provides an agent for generating Kubernetes manifests.
apps
Package apps registers MCP apps for GKE workflows.
Package apps registers MCP apps for GKE workflows.
apps/charts
Package charts provides an MCP app for rendering Google Cloud Monitoring charts.
Package charts provides an MCP app for rendering Google Cloud Monitoring charts.
apps/dropdown
Package dropdown provides an interactive UI dropdown app.
Package dropdown provides an interactive UI dropdown app.
config
Package config loads configuration derived from local gcloud defaults.
Package config loads configuration derived from local gcloud defaults.
install
Package install provides helpers for installing the MCP server into clients.
Package install provides helpers for installing the MCP server into clients.
llm
Package llm provides a factory for initializing vendor-agnostic LLM clients.
Package llm provides a factory for initializing vendor-agnostic LLM clients.
prompts
Package prompts registers prompt handlers for the MCP server.
Package prompts registers prompt handlers for the MCP server.
prompts/cost
Package cost provides prompt templates for GKE cost analysis.
Package cost provides prompt templates for GKE cost analysis.
prompts/deploy
Package deploy provides prompt templates for GKE deployment guidance.
Package deploy provides prompt templates for GKE deployment guidance.
prompts/upgraderiskreport
Package upgraderiskreport provides prompt templates for upgrade risk reports.
Package upgraderiskreport provides prompt templates for upgrade risk reports.
prompts/upgradesbestpracticesriskreport
Package upgradesbestpracticesriskreport provides prompt templates for upgrade best-practices risk reports.
Package upgradesbestpracticesriskreport provides prompt templates for upgrade best-practices risk reports.
tools
Package tools registers MCP tools for GKE workflows.
Package tools registers MCP tools for GKE workflows.
tools/cluster
Package cluster provides MCP tools for managing GKE clusters.
Package cluster provides MCP tools for managing GKE clusters.
tools/clustertoolkit
Package clustertoolkit provides tools for downloading Cluster Toolkit.
Package clustertoolkit provides tools for downloading Cluster Toolkit.
tools/deploy
Package deploy provides MCP tools for deployment guidance.
Package deploy provides MCP tools for deployment guidance.
tools/giq
Package giq provides tools for GKE Inference Quickstart workflows.
Package giq provides tools for GKE Inference Quickstart workflows.
tools/gkereleasenotes
Package gkereleasenotes provides tools for fetching GKE release notes.
Package gkereleasenotes provides tools for fetching GKE release notes.
tools/k8schangelog
Package k8schangelog provides tools for fetching Kubernetes changelogs.
Package k8schangelog provides tools for fetching Kubernetes changelogs.
tools/logging
Package logging provides MCP tools for querying GCP logging.
Package logging provides MCP tools for querying GCP logging.
tools/monitoring
Package monitoring provides tools for GKE-related monitoring data.
Package monitoring provides tools for GKE-related monitoring data.
tools/params
Package params provide common tool parameter types.
Package params provide common tool parameter types.
tools/recommendation
Package recommendation provides tools for GKE recommendations.
Package recommendation provides tools for GKE recommendations.
Package ui provides embedded UI static file assets for apps.
Package ui provides embedded UI static file assets for apps.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL