KDebug (Kubernetes) MCP server

Enables natural language interaction with Kubernetes resources, allowing developers to manage clusters through conversational interfaces instead of complex kubectl commands.
Back to servers
Setup instructions
Provider
Abderrahim Soubai-Elidrisi
Release date
Apr 28, 2025
Language
Go
Stats
16 stars

KDebug is a Kubernetes debugging tool that enables you to interact with your Kubernetes clusters through Claude AI using the Model Control Protocol (MCP). This tool allows Claude to execute Kubernetes commands on your behalf for inspecting resources, viewing logs, checking node status, and monitoring events using natural language.

Installation

Prerequisites

  • Go 1.18+ (if building from source)
  • Kubernetes cluster access configured (~/.kube/config)
  • Claude client with MCP support

Option 1: Download Pre-built Binary

  1. Go to the GitHub releases page:

    https://github.com/soub4i/kdebug-mcp/releases
    
  2. Download the latest release for your platform (macOS, Linux, Windows)

  3. Make the binary executable:

    chmod +x kdebug-mcp
    
  4. Move the binary to a location in your PATH:

    mv kdebug-mcp /usr/local/bin/kdebug-mcp
    # or 
    mv kdebug-mcp ~/bin/kdebug-mcp  # If you have ~/bin in your PATH
    

Option 2: Build from Source

  1. Clone the repository:

    git clone https://github.com/soub4i/kdebug-mcp.git
    cd kdebug-mcp
    
  2. Build the binary:

    go build -o bin/server ./cmd/server/main.go
    

Configuration

Configure Claude to Use KDebug

Create or edit the Claude MCP configuration file located at:

  • macOS: ~/Library/Application Support/com.anthropic.claude/config.json
  • Linux: ~/.config/com.anthropic.claude/config.json
  • Windows: %APPDATA%\com.anthropic.claude\config.json

Add the following configuration:

{
    "mcpServers": {
        "kdebug": {
            "command": "/path/to/kdebug-mcp/bin/server"
        }
    }
}

Replace /path/to/kdebug-mcp/bin/server with the actual path to your KDebug binary.

Kubernetes Context

KDebug uses your current Kubernetes context from ~/.kube/config. Make sure your Kubernetes configuration is properly set up.

To switch contexts, you can use:

kubectl config use-context <context-name>

Usage

  1. Start Claude and make sure it's connected to your KDebug MCP server
  2. In your conversation with Claude, ask about your Kubernetes resources

Example Prompts

  • "What's wrong with my cluster.context: minikube. namespace: default."
  • "Show me all pods in the default namespace"
  • "What services are running in the kube-system namespace?"
  • "Get the logs from pod xyz in namespace abc"
  • "List all nodes in my cluster"
  • "Check for recent events in the default namespace"

Available Commands

KDebug provides access to the following Kubernetes resources:

  • nodes: List all nodes in the cluster
  • pods: List pods in a namespace or get a specific pod
  • podLogs: Get logs from a specific pod
  • services: List services in a namespace or get a specific service
  • deployments: List deployments in a namespace or get a specific deployment
  • statefulsets: List stateful sets in a namespace or get a specific stateful set
  • replicasets: List replica sets in a namespace or get a specific replica set
  • daemonsets: List daemon sets in a namespace or get a specific daemon set
  • events: List events in a namespace or related to a specific resource

Troubleshooting

Common Issues

  1. Claude can't connect to KDebug

    • Check that the path in your Claude MCP configuration is correct
    • Ensure the KDebug binary is executable
  2. Permission errors

    • Make sure your Kubernetes configuration (~/.kube/config) has the necessary permissions
    • Try running kubectl get pods to verify your Kubernetes access
  3. Context switching

    • If you have multiple Kubernetes contexts, Claude will ask which context to use
    • Ensure you have access to the context you're trying to use

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "kdebug" '{"command":"/path/to/kdebug-mcp/bin/server"}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

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

{
    "mcpServers": {
        "kdebug": {
            "command": "/path/to/kdebug-mcp/bin/server"
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "kdebug": {
            "command": "/path/to/kdebug-mcp/bin/server"
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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