Skip to main content
Glama

MCP Kubernetes Server

A Model Context Protocol (MCP) server for Kubernetes, supporting chunked HTTP streaming, advanced troubleshooting prompts, and full Kubernetes resource/tool coverage.


Prerequisites

  • Node.js v18+ (for local dev/build)

  • Docker (for containerization)

  • Access to a Kubernetes cluster (AKS, EKS, GKE, or local)

  • kubectl configured (for testing and kubeconfig management)


Related MCP server: Kubectl MCP Tool

1. Build and Run Locally

npm install
npm run build
MCP_TRANSPORT=http-chunked npm start
  • By default, the server uses your local kubeconfig (~/.kube/config or C:\Users\<username>\.kube\config).

  • To use a custom kubeconfig, set the KUBECONFIG environment variable:

    export KUBECONFIG=/path/to/your/kubeconfig
    npm start

2. Dockerize the MCP Server

Build the Docker image

docker build -t yourrepo/mcp-server:latest .

Push to your registry

docker push yourrepo/mcp-server:latest

3. Deploy on Kubernetes (AKS, EKS, GKE)

Edit the image name in k8s-mcp-server.yaml:

Replace yourrepo/mcp-server:latest with your image name.

Apply the manifest

kubectl apply -f k8s-mcp-server.yaml
  • This creates a namespace, ServiceAccount, RBAC, Deployment, and Service.

  • By default, the Service is ClusterIP (internal). Change to LoadBalancer or NodePort for external access.


4. Using the MCP Server

HTTP Chunked Endpoint

  • The server exposes /call-tool-chunked on port 3000.

  • Example (using curl):

    curl -X POST http://<server-ip>:3000/call-tool-chunked \
      -H "Content-Type: application/json" \
      -d '{"name": "get_pods", "args": {"namespace": "default"}}'
  • The response will stream progress and results as JSON lines.

Using Prompts

  • To use a prompt, POST to /call-tool-chunked with the prompt name, e.g.:

    curl -X POST http://<server-ip>:3000/call-tool-chunked \
      -H "Content-Type: application/json" \
      -d '{"name": "k8s-pod-crashloop-diagnose", "args": {"podName": "my-pod", "namespace": "default"}}'

5. Kubeconfig and Permissions

  • The MCP server uses the kubeconfig available in the container (default: /root/.kube/config).

  • For in-cluster deployments, it uses the ServiceAccount and RBAC provided in the manifest.

  • To use a custom kubeconfig, mount it as a secret and update the Deployment (see commented lines in the manifest).


6. Security Notes

  • Do not expose the MCP server to the public internet without authentication and TLS.

  • Use network policies, firewalls, or VPNs to restrict access.

  • Use least-privilege RBAC for the ServiceAccount.


7. Extending and Customizing

  • Add new tools, resources, or prompts in the src/ directory.

  • Rebuild and redeploy the Docker image after making changes.


8. Troubleshooting

  • Check logs with kubectl logs -n mcp-server deploy/mcp-server.

  • Ensure the ServiceAccount has the required permissions for your use case.

  • For local testing, ensure your kubeconfig is valid and has cluster access.


License

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • The Google GKE MCP server is a managed Model Context Protocol server that provides AI applications with tools to manage Google Kubernetes Engine (GKE) clusters and Kubernetes resources. It exposes a structured, discoverable interface that allows AI agents to interact with GKE and Kubernetes APIs, enabling them to inspect cluster configurations, retrieve Kubernetes resource YAMLs, monitor operations like cluster upgrades, diagnose issues, and optimize costs—all without needing to parse text output or use complex kubectl commands.

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.

  • Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that enables interaction with Kubernetes/Minikube clusters through natural language, allowing AI agents like Codename Goose to manage Kubernetes resources via the Model Context Protocol.
    2
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that enables AI assistants to interact with Kubernetes clusters through natural language, supporting core Kubernetes operations, monitoring, security, and diagnostics.
    94
    956
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that enables AI assistants to interact with Kubernetes clusters by translating natural language into kubectl and Helm operations. It allows users to query, manage, and diagnose Kubernetes resources and cluster states through a seamless integration.
    20
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    An Model Context Protocol server that lets language models directly manage and visualize Kubernetes clusters through safe, high-level operational tools.
    1
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/siddjoshi/kube-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server