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
- Install dependencies:
pip install -e .
-
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:
-
Namespaces:
namespace/{namespace_name} -
Pods:
pod/{namespace_name}/{pod_name}
Available Tools
-
Get Pod Logs:
- Tool:
get_pod_logs - Parameters:
namespace: Kubernetes namespacepod_name: Name of the podcontainer: (optional) Container nametail_lines: (optional) Number of lines to return from the end
- Tool:
-
List Namespace Pods:
- Tool:
list_namespace_pods - Parameters:
namespace: Kubernetes namespace
- Tool:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d641fecd9e0dbef8d870a8547152937c336a762cd96df896ac53be0bf44c0eb
|
|
| MD5 |
816904a363d7baf1fbca6a0eda56c944
|
|
| BLAKE2b-256 |
b0f7a1af47002ed9a681d108b91bd8102f477a4820332203d5475095af5d191f
|
File details
Details for the file mareana_k8s_mcp_server-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mareana_k8s_mcp_server-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a74b21371f2662763809d7a4dc7c8584e1a669f955b8fecff85fc7eee8ebdb4
|
|
| MD5 |
294f221b7c2e7e0367965f737d3c5f05
|
|
| BLAKE2b-256 |
b2be23596ae592a9d7d4759248672bf9c415c36d79199178d26f632682584515
|