Provides comprehensive management and monitoring of Croit Ceph clusters through their REST API, including services management, maintenance operations, storage pool management, S3 bucket operations, server administration, and cluster monitoring with built-in filtering and token optimization features
MCP Croit Ceph
An MCP (Model Context Protocol) server for interacting with Croit Ceph clusters through their REST API.
Current Status
580 total API endpoints
575 endpoints with x-llm-hints (99.1% coverage)
100% endpoints have summaries
13 tools in hybrid mode (97% reduction)
Full support for all x-llm-hints fields
Features
Automatic Token Optimization
The MCP server automatically optimizes responses to reduce token consumption:
Auto-limits: Adds default limits (10-100 items) to list operations
Smart truncation: Large responses automatically truncated with metadata
Optimization hints: Tool descriptions include token-saving tips
Response metadata: Truncated responses include info on how to get more data
Example: Instead of 500 services (50,000 tokens), you get 25 services + metadata (2,500 tokens)
Built-in Filtering (grep-like search)
Filter API responses locally without multiple calls:
Field filtering:
_filter_status='error'
- exact matchRegex patterns:
_filter_name='~ceph.*'
- pattern matchingNumeric comparisons:
_filter_size='>1000'
- greater thanText search:
_filter__text='timeout'
- search all text fieldsField existence:
_filter__has='error_message'
- has fieldMultiple values:
_filter_status=['error','warning']
- OR logic
Example: Find errors in 500 services with one call:
Hybrid Mode (Default) - 97% Fewer Tools!
The new hybrid mode reduces the tool count from 580 individual endpoint tools to just 13 tools total:
3 Base tools for full API access
10 Category tools for common operations (services, maintenance, s3, pools, etc.)
This dramatic reduction improves:
LLM performance and response times
Tool discovery and usability
Memory efficiency
Startup time
Tool Generation Modes
hybrid
(default): Combines base tools with category tools for optimal balancebase_only
: Only 3 base tools for minimal footprintcategories_only
: Only category tools for simplified operationsendpoints_as_tools
: Legacy mode with 580 individual tools (one per API endpoint)
Dynamic Features
Automatic API Discovery: Fetches OpenAPI spec from your Croit cluster
Permission-Based Filtering: Role-based tool filtering (ADMIN vs VIEWER)
Full x-llm-hints Support: 575+ endpoints with AI optimization hints
Local OpenAPI Support: Use a local OpenAPI spec file for testing/development
Schema Resolution: Handles
$ref
references automatically
Advanced x-llm-hints Integration
The MCP server fully integrates Croit's x-llm-hints into tool descriptions for optimal LLM guidance:
What x-llm-hints provide:
Purpose: Clear description of what each endpoint does
Usage examples: Common use cases and workflow guidance
Failure modes: Expected errors and how to handle them
Rate limits: API throttling information for efficient usage
Retry strategies: How to handle transient failures
Poll intervals: Recommended refresh rates for live data
Cache hints: Response caching strategies
Related endpoints: Cross-references for complex workflows
Examples of integrated hints:
Benefits for LLMs:
Context-aware operations: LLMs understand when and how to use each tool
Error handling: Proactive guidance on handling API errors
Performance optimization: Built-in rate limiting and caching awareness
Workflow intelligence: Understanding of multi-step operations
Installation
⚠️ IMPORTANT: This project requires a virtual environment due to system-managed Python environments.
Note: Always activate the virtual environment (source venv/bin/activate
) before running any Python commands or tests.
Configuration
Set up your environment variables:
Or use a config file at /config/config.json
:
Usage
Basic Usage (Hybrid Mode)
Advanced Options
Tool Modes Explained
Hybrid Mode (Recommended)
Provides the best balance with ~13 tools:
Base Tools:
list_endpoints
- Search and filter API endpointscall_endpoint
- Direct API calls to any endpointget_schema
- Resolve schema references
Category Tools (top 10):
manage_services
- Ceph services operationsmanage_maintenance
- Maintenance tasksmanage_s3
- S3 bucket managementmanage_pools
- Storage pool operationsmanage_servers
- Server managementAnd more...
Each category tool supports actions like: list
, get
, create
, update
, delete
Base Only Mode
Minimal setup with just 3 tools for full API access:
list_api_endpoints
- Discover available endpointscall_api_endpoint
- Make API callsget_reference_schema
- Resolve schemas
Categories Only Mode
Simplified interface with only category tools, no base tools.
Endpoints as Tools Mode (Legacy)
Creates 580 individual tools (one per API endpoint). Not recommended due to:
Performance overhead
Difficult tool discovery
MCP client limitations
Permission-Based Filtering
The server intelligently filters tools based on the API token's role:
Automatic Role Detection: Fetches roles via
/auth/token-info
endpointRole-Based Access:
ADMIN role: Full access to all categories
VIEWER/other roles: All categories except admin-only operations
Invalid token: Server will exit with error (no access)
Category Access Control
Admin-Only Categories:
maintenance
,servers
,ipmi
- System managementconfig
,hooks
,change-requests
- Configuration changesconfig-templates
- Template management
All Other Categories are accessible to VIEWER roles for read operations:
cluster
,status
,stats
- Monitoringlogs
,disks
,services
- Information viewings3
,cephfs
,rbds
,pools
- Storage infoauthentication
,images
,daos
- Read operationsAnd all others not listed as admin-only
This role-based approach is fast and ensures users only see tools they can actually use.
Using Local OpenAPI Spec
For offline development or testing:
MCP Integration
With Claude Desktop
Add to your Claude Desktop config:
With Other MCP Clients
The server implements the standard MCP protocol and works with any compatible client.
Command Line Arguments
Argument | Description | Default |
| Tool generation mode |
|
| Local OpenAPI spec file | None (fetch from server) |
| Skip permission checking | False (check enabled) |
| Max category tools to generate | 10 |
| Don't resolve $ref in spec | False (resolve enabled) |
| Include full spec in list tool | False |
Docker Usage
Build and Run with Docker
Docker Compose
Development
⚠️ Remember: Always activate the virtual environment before development work:
Testing Tool Count
Debug Logging
Testing with Local OpenAPI Spec
Running Tests
License
Apache 2.0
Support
For issues specific to this MCP server, please open an issue in this repository. For Croit-specific questions, contact Croit support.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables interaction with Croit Ceph clusters through their REST API with 580 endpoints, automatic token optimization, built-in filtering, and role-based access control. Features hybrid mode tools that reduce complexity while providing full cluster management capabilities.