Kubernetes Natural Language Commander MCP server

Converts natural language requests into valid kubectl commands for Kubernetes cluster management, enabling administrators to interact with their clusters without memorizing complex syntax
Back to servers
Provider
Jess321995
Release date
May 11, 2025
Language
Java
Stats
1 star

Kube Core MCP is a Kubernetes command processing service that converts natural language requests into valid kubectl commands. It integrates with AWS Bedrock for LLM processing and provides security validations to ensure safe execution of Kubernetes operations.

Prerequisites

Before installing Kube Core MCP, ensure you have:

  • Python 3.8 or higher
  • AWS credentials properly configured
  • kubectl installed and configured
  • Node.js and npm (for frontend components)

Installation

Setting Up the Server

  1. Clone the repository and navigate to the project directory:
git clone <repository-url>
cd kube-core-mcp
  1. Create and activate a Python virtual environment:
python3 -m venv venv
source venv/bin/activate  # On Windows: .\venv\Scripts\activate
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Configure your AWS credentials:
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_key
export AWS_REGION=your_region
  1. Start the FastAPI server:
python src/server.py

The server will be available at http://localhost:3000.

Using the MCP Server

Available API Endpoints

Health Check

Verify that the server is running:

curl http://localhost:3000/health

List Available Services

Get information about available services:

curl http://localhost:3000/api/services

Natural Language Command Processing

Submit Kubernetes commands in natural language:

curl -X POST http://localhost:3000/api/nl \
  -H "Content-Type: application/json" \
  -d '{"message": "show me the pods in default namespace"}'

Direct Command Execution

Execute specific kubectl commands:

curl -X POST http://localhost:3000/api/command \
  -H "Content-Type: application/json" \
  -d '{"command": "kubectl get pods -n default"}'

Security Modes

The MCP server operates in two different security modes:

STRICT Mode (Default)

  • Only allows predefined command patterns
  • Validates all commands against allowed patterns
  • Prevents potentially dangerous operations
  • Recommended for production environments

PERMISSIVE Mode

  • Allows more flexible command patterns
  • Maintains basic security checks
  • Useful for development and testing purposes
  • Not recommended for production environments

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