Centreon Web RestAPI v2 - MCP
Centreon MCP Server
Model Context Protocol (MCP) server implementation for Centreon Web REST API v2.
Author: 0xEkho
License: MIT
Features
This MCP server provides comprehensive access to Centreon's monitoring infrastructure through the REST API v2, including:
- Authentication: Token-based authentication with Centreon
- Host Management: List, create, update, and delete hosts
- Service Management: Manage services and their configurations
- Acknowledgements: Acknowledge host and service issues
- Downtimes: Schedule and manage maintenance windows
- Monitoring: Real-time monitoring status and metrics
- Configuration: Manage host groups, service groups, categories, severities
- Resources: Query and filter monitoring resources
- Commands: Execute monitoring commands
- Time Periods: Manage time periods for monitoring schedules
- Contact Groups: Manage notification contacts and groups
- Administration: Platform configuration and settings
Installation
From Source
git clone <repository-url>
cd CENTREON-MCP
pip install -e .
From PyPI
pip install centreon-mcp-server
Configuration
Environment Variables
Create a .env file or set the following environment variables:
CENTREON_URL=https://your-centreon-server.com
CENTREON_USERNAME=your-username
CENTREON_PASSWORD=your-password
MCP Settings Configuration
Add to your MCP settings file (e.g., mcp-settings.json):
{
"mcpServers": {
"centreon": {
"command": "centreon-mcp-server",
"env": {
"CENTREON_URL": "https://your-centreon-server.com",
"CENTREON_USERNAME": "your-username",
"CENTREON_PASSWORD": "your-password"
}
}
}
}
Usage
Running the Server
centreon-mcp-server
Available Tools
The server exposes the following MCP tools:
Authentication
login- Authenticate and obtain API tokenlogout- Invalidate current session
Hosts
list_hosts- List all hosts with filtering optionsget_host- Get detailed information about a specific hostcreate_host- Create a new hostupdate_host- Update host configurationdelete_host- Delete a hostlist_host_groups- List host groupslist_host_categories- List host categorieslist_host_severities- List host severitieslist_host_templates- List host templates
Services
list_services- List all services with filteringget_service- Get service detailscreate_service- Create a new serviceupdate_service- Update service configurationdelete_service- Delete a servicedeploy_host_services- Deploy services based on host templateslist_service_groups- List service groupslist_service_categories- List service categorieslist_service_severities- List service severities
Acknowledgements
acknowledge_host- Acknowledge a host problemacknowledge_service- Acknowledge a service problemlist_host_acknowledgements- List host acknowledgementslist_service_acknowledgements- List service acknowledgements
Downtimes
schedule_host_downtime- Schedule maintenance for a hostschedule_service_downtime- Schedule maintenance for a servicelist_host_downtimes- List active host downtimeslist_service_downtimes- List active service downtimescancel_downtime- Cancel a scheduled downtime
Monitoring
get_resources- Query monitoring resources with filterscount_resources- Count resources matching criteriaexport_resources- Export resources to CSVget_host_status- Get host monitoring statusget_service_status- Get service monitoring statuslist_monitoring_servers- List monitoring servers
Configuration
generate_config- Generate monitoring configurationreload_config- Reload monitoring configurationgenerate_and_reload_config- Generate and reload in one operationlist_commands- List available commandslist_time_periods- List time periodslist_contact_groups- List contact groups
Meta Services
list_meta_services- List meta servicesget_meta_service- Get meta service detailsget_meta_service_metrics- Get metrics for a meta service
Advanced
get_dashboard_metrics- Get dashboard performance metricsget_top_metrics- Get top metrics by resourcelist_media- List media filesget_user_filters- Get user-defined filters
Docker Deployment
Using Docker Compose
- Clone the repository:
git clone https://github.com/0xEkho/CENTREON-MCP.git
cd CENTREON-MCP/deploy
- Create
.envfile from template:
cp .env.example .env
# Edit .env with your Centreon credentials
- Build and start:
docker-compose up -d
- Verify:
curl http://localhost:8084/healthz
Docker Configuration
The server runs on port 8084 and exposes:
/healthz- Health check endpoint/tools- List available MCP tools/tools/call- Execute MCP tools via REST API
Example REST API call:
curl -X POST http://localhost:8084/tools/call \
-H "Content-Type: application/json" \
-d '{
"tool": "list_hosts",
"arguments": {
"limit": 10
}
}'
Examples
See the examples directory for detailed usage examples:
- 01_list_hosts.md - Listing and filtering hosts
- 02_acknowledge_service.md - Acknowledging service issues
- 03_schedule_downtime.md - Scheduling maintenance windows
- 04_get_resources.md - Querying monitoring resources
- And many more...
Development
Setup Development Environment
pip install -e ".[dev]"
Running Tests
pytest
Code Formatting
black src/
ruff check src/
API Version
This server implements the Centreon Web REST API v2.
For complete API documentation, see:
- Centreon API Docs: https://docs-api.centreon.com/api/centreon-web/
- OpenAPI Specification: docs/centreon-api.yaml
- Project Documentation: docs/
Documentation
- README.md - Main documentation (this file)
- TOOLS.md - Complete MCP tools reference
- docs/ - API specifications and technical docs
- examples/ - Usage examples
- deploy/ - Docker deployment guide
- CONTRIBUTING.md - Contribution guidelines
- CHANGELOG.md - Version history
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Author
Created by 0xEkho
Support
For issues and questions:
- GitHub Issues: https://github.com/0xEkho/CENTREON-MCP/issues
- Centreon Documentation: https://docs.centreon.com/
- Centreon Community: https://thewatch.centreon.com/