Skip to main content

Kubernetes MCP Server for pod management and monitoring via Dashboard API

Project description

Kubernetes MCP Server

An MCP server for fetching Kubernetes pod logs. This server provides AI assistants with the ability to list namespaces, pods, and access pod logs.

Features

  • List available namespaces
  • List pods in a namespace
  • Get pod logs (with optional container selection and line limiting)
  • Stream pod logs in real-time

Setup

  1. Install dependencies:
pip install -e .
  1. Configure Kubernetes access:

    Option A: Using Environment Variables (Recommended for specific cluster)

    export K8S_API_SERVER="https://your-k8s-api-server"
    export K8S_TOKEN="your-service-account-token"
    

    Option B: Using Local Kubeconfig

    • The server will automatically try to use in-cluster configuration if running inside Kubernetes
    • Otherwise, it will fall back to using your local kubeconfig file

    For the Mareana dashboard cluster:

    # Use the provided configuration
    source config.example.sh
    
    # Or set manually:
    export K8S_API_SERVER="https://dashboard-dev.mareana.com/api/v1"
    export K8S_TOKEN="test-dummy-token"
    export K8S_VERIFY_SSL="true"
    

    Make sure you have the necessary permissions to access pod logs with your service account.

Running the Server

python -m k8s_mcp_server.server

Available Resources

The server provides the following resources:

  1. Namespaces:

    namespace/{namespace_name}
    
  2. Pods:

    pod/{namespace_name}/{pod_name}
    

Available Tools

  1. Get Pod Logs:

    • Tool: get_pod_logs
    • Parameters:
      • namespace: Kubernetes namespace
      • pod_name: Name of the pod
      • container: (optional) Container name
      • tail_lines: (optional) Number of lines to return from the end
  2. List Namespace Pods:

    • Tool: list_namespace_pods
    • Parameters:
      • namespace: Kubernetes namespace

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mareana_k8s_mcp_server-0.1.1.tar.gz (62.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mareana_k8s_mcp_server-0.1.1-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file mareana_k8s_mcp_server-0.1.1.tar.gz.

File metadata

  • Download URL: mareana_k8s_mcp_server-0.1.1.tar.gz
  • Upload date:
  • Size: 62.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for mareana_k8s_mcp_server-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2d641fecd9e0dbef8d870a8547152937c336a762cd96df896ac53be0bf44c0eb
MD5 816904a363d7baf1fbca6a0eda56c944
BLAKE2b-256 b0f7a1af47002ed9a681d108b91bd8102f477a4820332203d5475095af5d191f

See more details on using hashes here.

File details

Details for the file mareana_k8s_mcp_server-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mareana_k8s_mcp_server-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a74b21371f2662763809d7a4dc7c8584e1a669f955b8fecff85fc7eee8ebdb4
MD5 294f221b7c2e7e0367965f737d3c5f05
BLAKE2b-256 b2be23596ae592a9d7d4759248672bf9c415c36d79199178d26f632682584515

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page