ceph-mcp

ceph-mcp

MCP server for managing a Ceph cluster, currently implementing note-taking functionality as a placeholder.

Category
访问服务器

README

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)

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选