Skip to main content

ceph-mcp

A read-only MCP server for Rook-Ceph clusters running on Kubernetes.

It lets an LLM (Claude, etc.) inspect the health of a Ceph cluster — cluster health, OSD tree, PG status, pool usage, mon quorum, RGW multisite sync — by executing a fixed set of ceph / radosgw-admin commands inside the Rook-Ceph toolbox pod and returning structured JSON.

Why it's safe to hand to an LLM

  • No arbitrary commands. Every tool maps to exactly one hardcoded command template in commands.py. There is no code path that builds a shell command from model input — the model can only pick which tool to call, never what to run.
  • Read-only. Only inspection commands (ceph health, ceph osd tree, ceph df, radosgw-admin sync status, ...) are exposed. Nothing that mutates cluster state.
  • Scoped exec, not a shell. Commands run via the Kubernetes exec API inside the existing rook-ceph-tools pod — the server itself never needs cluster-admin credentials beyond what your kubeconfig already grants.

Tools

Tool Description
get_cluster_health HEALTH_OK/WARN/ERR plus the active health checks and their severity
get_osd_tree Hierarchical host/OSD structure with up/down/in/out state
get_osd_df Per-OSD capacity/usage, useful for spotting imbalance
get_pg_status PG counts by state, plus PG-related health checks
get_pool_usage Per-pool stored/used/available bytes and object counts
get_mon_status Monitor quorum state and mon list
get_rgw_sync_status Per-zone RGW multisite sync state: behind/caught-up/failed
get_cluster_summary Composes all of the above into a single "how's the cluster doing" snapshot

Every tool returns a JSON envelope:

{ "ok": true, "tool": "get_cluster_health", "data": { ... }, "warnings": [] }

or, on failure:

{ "ok": false, "tool": "get_cluster_health", "error": "...", "detail": "..." }

Requirements

  • Python >= 3.14
  • A Kubernetes cluster running Rook-Ceph, with the rook-ceph-tools toolbox pod deployed
  • A working kubeconfig with permission to list/exec pods in the Rook-Ceph namespace

Installation

Once published to PyPI, run it with uvx — no separate install step needed:

uvx ceph-mcp

Or install it into a virtualenv:

uv pip install ceph-mcp

From source

git clone git@github.com:sserkanml/ceph-mcp.git
cd ceph-mcp
uv sync
uv run ceph-mcp

Configuration

Configured entirely through environment variables:

Variable Default Description
CEPH_MCP_NAMESPACE rook-ceph Namespace the toolbox pod lives in
CEPH_MCP_TOOLBOX_LABEL app=rook-ceph-tools Label selector used to find the toolbox pod
CEPH_MCP_KUBECONFIG (default kubeconfig) Path to a specific kubeconfig file
CEPH_MCP_KUBE_CONTEXT (current context) kubeconfig context to use

Usage with Claude Desktop

Config file location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

Published (PyPI) version:

{
  "mcpServers": {
    "ceph-mcp": {
      "command": "uvx",
      "args": ["ceph-mcp"],
      "env": {
        "CEPH_MCP_NAMESPACE": "rook-ceph",
        "CEPH_MCP_TOOLBOX_LABEL": "app=rook-ceph-tools"
      }
    }
  }
}

From a local checkout:

{
  "mcpServers": {
    "ceph-mcp": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/ceph-mcp", "ceph-mcp"],
      "env": {
        "CEPH_MCP_NAMESPACE": "rook-ceph",
        "CEPH_MCP_TOOLBOX_LABEL": "app=rook-ceph-tools"
      }
    }
  }
}

See examples/claude_desktop_config.json for a ready-to-copy version.

Development

Project layout:

src/ceph_mcp/
├── server.py       # MCP server entrypoint + tool registration
├── commands.py     # fixed allowlist: tool name -> ceph/radosgw-admin command
├── config.py       # env var -> Config resolution
├── k8s_exec.py     # finds the toolbox pod, execs commands via the k8s API
└── parsers/        # raw ceph JSON/text -> structured tool output
tests/
├── fixtures/       # captured real ceph/radosgw-admin output, used by parser tests
└── test_*.py

Run the test suite:

uv run pytest

Lint:

uv run ruff check .

Debugging

Since MCP servers communicate over stdio, use the MCP Inspector to interact with the server directly:

npx @modelcontextprotocol/inspector uv --directory /absolute/path/to/ceph-mcp run ceph-mcp

Publishing to PyPI

uv sync
uv build
uv publish

Requires PyPI credentials via UV_PUBLISH_TOKEN (or --token).

License

MIT — see LICENSE.

Author

Serkan (@sserkanml)

Metadata

Release files for ceph-mcp 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ceph-mcp 0.1.0
File Size Uploaded Provenance
ceph_mcp-0.1.0.tar.gz 10.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ceph-mcp 0.1.0
File Interpreter ABI Platform
ceph_mcp-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.2 kB

Release files / ceph_mcp-0.1.0.tar.gz

Download URL ceph_mcp-0.1.0.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1dc97bf99e30535a29baf33b19f4343106aae707c06cabee76dbdd6ff32acaa1
BLAKE2b-256 checksum
How to use checksums
5bc712971cc61b82f5910a48b61415c60a053f1dbdf6ac2f91f71e18729f0c29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / ceph_mcp-0.1.0-py3-none-any.whl

Download URL ceph_mcp-0.1.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2120ca73dd2af9f8819a9a33972825aef032d01df8fdbb8175ee0117275f84ca
BLAKE2b-256 checksum
How to use checksums
87ca75d05d811c59c40bfa83cce7ffdc4d023da9fbe1647fc28a7d698407470d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for ceph-mcp 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page