A read-only Kubernetes MCP server for safely interacting with Kubernetes clusters
Project description
Kubernetes Read-Only MCP Server
A Model Context Protocol (MCP) server for safely interacting with Kubernetes clusters using read-only operations.
This MCP server was created to provide a secure way to interact with Kubernetes clusters without allowing any create, update, or delete operations. It only exposes read-only APIs to ensure your clusters remain safe while still enabling AI assistants to help you monitor and troubleshoot your Kubernetes resources.
Built with FastMCP 2.0 and the official Kubernetes Python client library.
Features
This MCP server provides the following read-only tools:
list_pods: List all pods in a namespace or across all namespaceslist_deployments: List all deployments in a specified namespacelist_services: List all services in a namespace or across all namespaceslist_namespaces: List all namespaces in the clusterget_events: Get Kubernetes events from the clusterget_pod_logs: Get logs from a specific podget_logs: Get logs from pods, deployments, jobs, or resources matching a label selector
Installation
From PyPI
pip install kubernetes-readonly-mcp
From Source
git clone https://github.com/vijaykodam/kubernetes-readonly-mcp.git
cd kubernetes-readonly-mcp
pip install -e .
Usage
Running as a standalone MCP server
kubernetes-readonly-mcp
Adding to your MCP configuration
Add this to your mcp.json:
{
"mcpServers": {
"kubernetes-readonly-mcp": {
"command": "uvx",
"args": ["-y", "kubernetes-readonly-mcp@latest"]
}
}
}
Verify Installation
Verify that your MCP Host/Client is restarted and the kubernetes-readonly-mcp MCP server is visible in the list.
You can use Amazon Q CLI, Claude Desktop, VSCode + Cline, or any other MCP-compatible client.
Example Prompts
- "Get list of pods from my kubernetes cluster"
- "Are there any failing pods? Debug why they are failing"
- "Show me the logs from the nginx deployment"
- "List all services in the default namespace"
Development
To set up the development environment:
pip install -e ".[dev]"
License
Apache License 2.0
Disclaimer
This is an experimental project. Use it at your own risk. This is not production-ready.
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 kubernetes_readonly_mcp-0.1.2.tar.gz.
File metadata
- Download URL: kubernetes_readonly_mcp-0.1.2.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9598a1ed81d68082a613909e74a39a36be882554b38f5f5342413d64c6ccd491
|
|
| MD5 |
ce641d5c69a8a523ec1082af50c25c1e
|
|
| BLAKE2b-256 |
cb16e0c75a90d2bffd4c807179a9702f12d80b75f1c41378cea96a714411bef3
|
File details
Details for the file kubernetes_readonly_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: kubernetes_readonly_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ffcf98980a58253633a213e103de534ef1297b20dbc05508fb82e23fce5c9c8
|
|
| MD5 |
9e13d530940c4b98fcf3a3134d7a0181
|
|
| BLAKE2b-256 |
ccf7c3808d83179d1c51a7917035020d7c85dadb9f0922ae666c0fcaa4384d1e
|