Skip to main content

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 namespaces
  • list_deployments: List all deployments in a specified namespace
  • list_services: List all services in a namespace or across all namespaces
  • list_namespaces: List all namespaces in the cluster
  • get_events: Get Kubernetes events from the cluster
  • get_pod_logs: Get logs from a specific pod
  • get_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

  1. "Get list of pods from my kubernetes cluster"
  2. "Are there any failing pods? Debug why they are failing"
  3. "Show me the logs from the nginx deployment"
  4. "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


Download files

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

Source Distribution

kubernetes_readonly_mcp-0.1.2.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

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

kubernetes_readonly_mcp-0.1.2-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

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

Hashes for kubernetes_readonly_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9598a1ed81d68082a613909e74a39a36be882554b38f5f5342413d64c6ccd491
MD5 ce641d5c69a8a523ec1082af50c25c1e
BLAKE2b-256 cb16e0c75a90d2bffd4c807179a9702f12d80b75f1c41378cea96a714411bef3

See more details on using hashes here.

File details

Details for the file kubernetes_readonly_mcp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for kubernetes_readonly_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6ffcf98980a58253633a213e103de534ef1297b20dbc05508fb82e23fce5c9c8
MD5 9e13d530940c4b98fcf3a3134d7a0181
BLAKE2b-256 ccf7c3808d83179d1c51a7917035020d7c85dadb9f0922ae666c0fcaa4384d1e

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