# 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:
```bash
pip install -e .
```
2. Configure Kubernetes access:
**Option A: Using Environment Variables (Recommended for specific cluster)**
```bash
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:**
```bash
# 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
```bash
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
Raw data
{
"_id": null,
"home_page": null,
"name": "mareana-k8s-mcp-server",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "dashboard, devops, k8s, kubernetes, mcp, monitoring, pod",
"author": null,
"author_email": "Shashanka G <shashanka.g@mareana.com>",
"download_url": "https://files.pythonhosted.org/packages/b0/f7/a1af47002ed9a681d108b91bd8102f477a4820332203d5475095af5d191f/mareana_k8s_mcp_server-0.1.1.tar.gz",
"platform": null,
"description": "# Kubernetes MCP Server\n\nAn MCP server for fetching Kubernetes pod logs. This server provides AI assistants with the ability to list namespaces, pods, and access pod logs.\n\n## Features\n\n- List available namespaces\n- List pods in a namespace\n- Get pod logs (with optional container selection and line limiting)\n- Stream pod logs in real-time\n\n## Setup\n\n1. Install dependencies:\n```bash\npip install -e .\n```\n\n2. Configure Kubernetes access:\n\n **Option A: Using Environment Variables (Recommended for specific cluster)**\n ```bash\n export K8S_API_SERVER=\"https://your-k8s-api-server\"\n export K8S_TOKEN=\"your-service-account-token\"\n ```\n\n **Option B: Using Local Kubeconfig**\n - The server will automatically try to use in-cluster configuration if running inside Kubernetes\n - Otherwise, it will fall back to using your local kubeconfig file\n\n **For the Mareana dashboard cluster:**\n ```bash\n # Use the provided configuration\n source config.example.sh\n \n # Or set manually:\n export K8S_API_SERVER=\"https://dashboard-dev.mareana.com/api/v1\"\n export K8S_TOKEN=\"test-dummy-token\"\n export K8S_VERIFY_SSL=\"true\"\n ```\n\n Make sure you have the necessary permissions to access pod logs with your service account.\n\n## Running the Server\n\n```bash\npython -m k8s_mcp_server.server\n```\n\n## Available Resources\n\nThe server provides the following resources:\n\n1. Namespaces:\n ```\n namespace/{namespace_name}\n ```\n\n2. Pods:\n ```\n pod/{namespace_name}/{pod_name}\n ```\n\n## Available Tools\n\n1. Get Pod Logs:\n - Tool: `get_pod_logs`\n - Parameters:\n - `namespace`: Kubernetes namespace\n - `pod_name`: Name of the pod\n - `container`: (optional) Container name\n - `tail_lines`: (optional) Number of lines to return from the end\n\n2. List Namespace Pods:\n - Tool: `list_namespace_pods`\n - Parameters:\n - `namespace`: Kubernetes namespace ",
"bugtrack_url": null,
"license": "MIT",
"summary": "Kubernetes MCP Server for pod management and monitoring via Dashboard API",
"version": "0.1.1",
"project_urls": {
"Documentation": "https://github.com/mareana/k8s-mcp-server/blob/main/README.md",
"Homepage": "https://github.com/mareana/k8s-mcp-server",
"Issues": "https://github.com/mareana/k8s-mcp-server/issues",
"Repository": "https://github.com/mareana/k8s-mcp-server"
},
"split_keywords": [
"dashboard",
" devops",
" k8s",
" kubernetes",
" mcp",
" monitoring",
" pod"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "b2be23596ae592a9d7d4759248672bf9c415c36d79199178d26f632682584515",
"md5": "294f221b7c2e7e0367965f737d3c5f05",
"sha256": "7a74b21371f2662763809d7a4dc7c8584e1a669f955b8fecff85fc7eee8ebdb4"
},
"downloads": -1,
"filename": "mareana_k8s_mcp_server-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "294f221b7c2e7e0367965f737d3c5f05",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 6300,
"upload_time": "2025-07-16T11:34:12",
"upload_time_iso_8601": "2025-07-16T11:34:12.856589Z",
"url": "https://files.pythonhosted.org/packages/b2/be/23596ae592a9d7d4759248672bf9c415c36d79199178d26f632682584515/mareana_k8s_mcp_server-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b0f7a1af47002ed9a681d108b91bd8102f477a4820332203d5475095af5d191f",
"md5": "816904a363d7baf1fbca6a0eda56c944",
"sha256": "2d641fecd9e0dbef8d870a8547152937c336a762cd96df896ac53be0bf44c0eb"
},
"downloads": -1,
"filename": "mareana_k8s_mcp_server-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "816904a363d7baf1fbca6a0eda56c944",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 62328,
"upload_time": "2025-07-16T11:34:14",
"upload_time_iso_8601": "2025-07-16T11:34:14.338854Z",
"url": "https://files.pythonhosted.org/packages/b0/f7/a1af47002ed9a681d108b91bd8102f477a4820332203d5475095af5d191f/mareana_k8s_mcp_server-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-16 11:34:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mareana",
"github_project": "k8s-mcp-server",
"github_not_found": true,
"lcname": "mareana-k8s-mcp-server"
}