Content
# GKE MCP Server and Gemini CLI Extension
Enable MCP-compatible AI agents to interact with Google Kubernetes Engine.
<img src="https://raw.githubusercontent.com/GoogleCloudPlatform/gke-mcp/main/assets/gke-mcp-gemini-cli-demo.gif" alt="A demonstration of using the GKE MCP server with the Gemini CLI" width="600">
## 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](https://github.com/google-gemini/gemini-cli?tab=readme-ov-file#-installation).
2. Install the extension
```sh
gemini extensions install https://github.com/GoogleCloudPlatform/gke-mcp.git
```
### Use in MCP Clients / Other AIs
#### Quick Install (Linux & macOS only)
```sh
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](https://go.dev/doc/install).
Once Go is installed, run the following command to install gke-mcp:
```sh
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](TROUBLESHOOTING.md#gke-mcp-command-not-found-on-macos-or-linux).
### 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, Claude Desktop, and Claude Code, please refer to our dedicated [installation guide](docs/installation_guide/).
### Configuring the Developer Knowledge API
The manifest generation agent (`generate_manifest` tool) can retrieve official GKE documentation, required annotations, and best practices using the Developer Knowledge API.
To enable this capability:
1. **Enable the API:** Enable the **Developer Knowledge API** in your Google Cloud Project (refer to the [Developer Knowledge API documentation](https://developers.google.com/knowledge/api#enable_the_api) for details).
2. **Generate an API Key:** Create an API key with permissions to call the Developer Knowledge API.
3. **Configure the Environment Variable:** Set the `DK_API_KEY` environment variable when starting the MCP server:
- **Gemini CLI / Terminal:**
```sh
export DK_API_KEY="your-api-key-here"
```
- **Cursor / Claude Desktop / Visual Studio Code:** Add the environment variable to your client's MCP configuration. For example, in `claude_desktop_config.json`:
```json
{
"mcpServers": {
"gke-mcp": {
"command": "gke-mcp",
"env": {
"DK_API_KEY": "your-api-key-here"
}
}
}
}
```
Optional configuration:
- `DK_BASE_URL`: The base URL of the Developer Knowledge API (defaults to `https://knowledge.googleapis.com`).
## 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).
- `list_node_pools`: List node pools in a GKE cluster.
- `get_node_pool`: Get details for a GKE node pool.
- `create_node_pool`: Create a new node pool in a GKE cluster.
- `update_node_pool`: Update a GKE node pool.
- `delete_node_pool`: Delete a GKE node pool (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.
- `get_k8s_resource`: Gets one or more Kubernetes resources from a cluster.
- `list_k8s_events`: Retrieves events from a Kubernetes cluster.
- `get_k8s_version`: Retrieves the Kubernetes server version for a given cluster.
- `apply_k8s_manifest`: Applies a Kubernetes manifest to a cluster using server-side apply.
- `get_k8s_logs`: Gets logs from a Kubernetes container in a pod.
- `delete_k8s_resource`: Delete a Kubernetes resource from a cluster.
## 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](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#stdio) transport. Additionally, the [Streamable HTTP](https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#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-host`: server host to use when server-mode is http; defaults to `127.0.0.1`
`--server-port`: server port to use when server-mode is http; defaults to 8080
```sh
gke-mcp --server-mode http --server-host 127.0.0.1 --server-port 8080
```
> [!WARNING]
> By default, the HTTP server binds to `127.0.0.1`, which limits access to the local machine.
> If you explicitly set `--server-host 0.0.0.0` or another non-loopback address, the server may become reachable from other machines on your network.
> Please ensure you have a firewall and/or other security measures in place if the server is not intended to be private.
### 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:
```json
{
"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.
## 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
```sh
rm -rf ~/.gemini/extensions/gke-mcp
```
1. Build the binary from the root of the project:
```sh
go build -o gke-mcp .
```
1. Run the installation command to update the extension manifest:
```sh
./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/](https://cloud.google.com/terms/)) and the Data Processing and Security Terms (available at [https://cloud.google.com/terms/data-processing-terms](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.
Connection Info
You Might Also Like
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
cc-switch
All-in-One Assistant for Claude Code, Codex & Gemini CLI across platforms.
servers
Model Context Protocol Servers
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.