# Kubernetes (MCP Server)

> Native Go MCP server for Kubernetes and OpenShift clusters

- Type: MCP server
- Publisher: containers (Red Hat)
- Categories: DevOps & Cloud
- Website: https://github.com/containers/kubernetes-mcp-server
- Source: https://github.com/containers/kubernetes-mcp-server
- Transport: stdio
- Launch command: npx -y kubernetes-mcp-server@latest
- Sign-in: none
- GitHub stars: 2100
- Listed: 2025-03-01

## About

A Go-based MCP server from the containers project that talks directly to the Kubernetes API, with no kubectl dependency. It supports pod operations, generic resource CRUD, events, namespaces, Helm releases, Tekton pipelines and KubeVirt, with multi-cluster support via kubeconfig.

## Install

1. **Add the server to Codex**

   Codex CLI:

   ```bash
   codex mcp add kubernetes -- npx -y kubernetes-mcp-server@latest
   ```

   config.toml:

   ```toml
   [mcp_servers.kubernetes]
   command = "npx"
   args = ["-y", "kubernetes-mcp-server@latest"]
   ```

   Agents SDK:

   ```python
   from agents import Agent, Runner
   from agents.mcp import MCPServerStdio
   
   async with MCPServerStdio(
       name="Kubernetes",
       params={"command": "npx", "args": ["-y", "kubernetes-mcp-server@latest"]},
   ) as server:
       agent = Agent(name="Assistant", mcp_servers=[server])
       result = await Runner.run(agent, "List pods in the production namespace that are not Running")
       print(result.final_output)
   ```

## Tools

- `pods_list`
- `pods_get`
- `pods_log`
- `pods_exec`
- `resources_list`
- `resources_get`
- `resources_create_or_update`
- `namespaces_list`
- `events_list`
- `helm_install`
- `helm_list`
- `tekton_pipeline_start`

## Example prompts

- "List pods in the production namespace that are not Running"
- "Show the logs for the api pod"
- "What warning events happened in the cluster recently?"
- "Install the redis Helm chart into the cache namespace"

## Related

- [GitHub](https://chatgptplugins.directory/mcp/github.md): Manage repos, issues, pull requests and Actions from your AI agent
- [Sentry](https://chatgptplugins.directory/mcp/sentry.md): Search Sentry errors, issues and traces and debug them with Seer
- [Cloudflare API](https://chatgptplugins.directory/mcp/cloudflare-api.md): Access 2,500+ Cloudflare API endpoints through two Code Mode tools
- [Vercel](https://chatgptplugins.directory/mcp/vercel.md): Manage Vercel projects, deployments, logs and docs from AI tools
- [MCP Toolbox for Databases](https://chatgptplugins.directory/mcp/mcp-toolbox-databases.md): Google's open-source MCP server for 20+ databases
- [AWS Knowledge](https://chatgptplugins.directory/mcp/aws-knowledge.md): Search current AWS docs, API references and regional availability

---
Source: https://chatgptplugins.directory/mcp/kubernetes · Index: https://chatgptplugins.directory/llms.txt · Independent and community-run. Not affiliated with or endorsed by OpenAI. ChatGPT is a trademark of OpenAI.
