Kubernetes Eye MCP server

Kubernetes management tool that connects to clusters to list, analyze, and manipulate pods, execute container commands, and retrieve logs directly through conversation interfaces.
Back to servers
Provider
Wenhu Wang
Release date
Mar 18, 2025
Language
Go
Stats
19 stars

The MCP K8s Eye is a powerful tool for managing Kubernetes clusters and analyzing workload status. It provides comprehensive capabilities for resource management, diagnostics, and monitoring of your Kubernetes environment through a Model Context Protocol (MCP) server.

Installation

To install the MCP K8s Eye server:

# Clone the repository
git clone https://github.com/wenhuwang/mcp-k8s-eye.git
cd mcp-k8s-eye

# Build the binary
go build -o mcp-k8s-eye

Make sure you have Go 1.23 or higher installed and kubectl properly configured before installation.

Usage

You can run the MCP K8s Eye server in two different modes:

Stdio Mode

Configure your MCP client with the following settings:

{
  "mcpServers": {
    "k8s eye": {
      "command": "YOUR mcp-k8s-eye PATH",
      "env": {
        "HOME": "USER HOME DIR"
      }
    }
  }
}

Note: env.HOME is required to set the HOME directory where your kubeconfig file is located.

SSE Mode

  1. Start your MCP SSE server
  2. Configure your MCP client with:
{
  "mcpServers": {
    "k8s eye": {
      "url": "http://localhost:8080/sse",
      "env": {}
    }
  }
}

Available Tools

Resource Management Tools

  • resource_get: Retrieve detailed information about a specific resource in a namespace
  • resource_list: List all resources of a specific type in a namespace
  • resource_create_or_update: Create or update resources in a namespace
  • resource_delete: Delete a resource from a namespace
  • resource_describe: Get detailed descriptive information about a resource
  • deployment_scale: Scale a deployment up or down
  • pod_exec: Execute commands inside a pod
  • pod_logs: Retrieve logs from a pod

Diagnostic Tools

  • pod_analyze: Diagnose issues with pods in a namespace
  • deployment_analyze: Analyze deployment status and configuration
  • statefulset_analyze: Diagnose StatefulSet configurations and related resources
  • service_analyze: Check service configurations, selectors, and endpoints
  • cronjob_analyze: Examine CronJob schedules and execution status
  • ingress_analyze: Validate ingress configurations, classes, and related services
  • networkpolicy_analyze: Analyze network policies and affected pods
  • validatingwebhook_analyze: Check validating webhook configurations
  • mutatingwebhook_analyze: Examine mutating webhook setups
  • node_analyze: Diagnose node conditions and status

Monitoring Tools

  • workload_resource_usage: Monitor resource consumption (CPU, memory) for various workload types

Each of these tools can be invoked through your MCP client interface to manage and analyze your Kubernetes clusters effectively.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later