LibreNMS MCP Server for Monitoring and Management
Streamline network monitoring and management with the LibreNMS MCP server for centralized alerts, performance insights, and efficient device control.
npx -y @mhajder/librenms-mcpOverview
The LibreNMS MCP Server is a lightweight service that exposes network context and management operations from a LibreNMS installation through a simple HTTP API compatible with Model Context Protocol (MCP) workflows. It centralizes device metadata, alert history, and performance metrics so downstream tools — chatbots, automation services, or observability platforms — can query current network state and trigger safe actions without direct LibreNMS integration logic.
For developers, the server acts as a bridge: it converts LibreNMS API data into structured context bundles and provides action endpoints (for example, rebooting a device or triggering a configuration backup) guarded by API keys and role-based action whitelists. This makes it practical to add network-aware capabilities to AI assistants, runbooks, and automation pipelines while keeping authentication and auditing consolidated.
Features
- Fetches device inventory, alert history, and performance metrics from LibreNMS
- Exposes a consistent MCP-style HTTP API for context retrieval and action invocation
- Action whitelist and rate-limiting to protect device operations
- Polling and caching of common queries to reduce LibreNMS load
- Configurable authentication (API keys / tokens)
- Docker-friendly with an example docker-compose configuration
- Structured logging and configurable verbosity for integration into CI/CD and observability
Installation / Configuration
Prerequisites: Docker and docker-compose are recommended. The repository includes a Dockerfile and docker-compose example to get started quickly. Replace environment values with your LibreNMS instance details.
- Clone the repository:
- Example environment file (.env):
LIBRENMS_URL=
LIBRENMS_API_TOKEN=your_librenms_api_token
MCP_API_KEY=supersecretapikey
SERVER_PORT=8080
POLL_INTERVAL_SECONDS=60
ALLOWED_ACTIONS=reboot,backup-config
LOG_LEVEL=info
- Example docker-compose.yml:
version: "3.8"
services:
mcp-server:
build: .
image: librenms/mcp-server:latest
restart: unless-stopped
env_file:
- .env
ports:
- "${SERVER_PORT:-8080}:8080"
volumes:
- ./config:/app/config
- Start with Docker Compose:
- If running from source, consult the repository for runtime requirements (Node/Python/etc.) and start commands. Typically this means installing dependencies and running the included start script:
# pseudo-example; confirm exact commands in repo
Available Resources
The server exposes REST endpoints for querying context and invoking actions. Below is a representative set of endpoints — consult the repository or the running server’s OpenAPI documentation for exact schemas.
| Endpoint | Method | Description |
|---|---|---|
| /api/health | GET | Health and readiness checks |
| /api/devices | GET | List devices and basic metadata |
| /api/devices/{id} | GET | Full context bundle for a device (interfaces, configs, recent alerts) |
| /api/alerts | GET | Recent alerts (supports filters: severity, device) |
| /api/metrics | GET | Time-series data for selected metrics (CPU, latency, bandwidth) |
| /api/actions | POST | Invoke a permitted action on a device (requires API key) |
Example: fetch a device context
Invoke an action (reboot):
Use Cases
- Enriching AI assistants: Provide detailed device context (interfaces, recent alerts, SLA metrics) to an LLM so it can generate safer, context-aware troubleshooting steps or runbooks.
- Centralized alert handling: Aggregate LibreNMS alerts into a single resource that automation pipelines can poll to prioritize incidents and trigger mitigation actions.
- Automated remediation: Combine detection rules with the server’s action API to run validated remediation (soft reboots, interface shutdown/enable, scheduled config backup) while keeping an audit trail.
- Performance troubleshooting: Pull recent time-series metrics for an endpoint to feed into anomaly-detection models or diagnostic tooling, avoiding direct LibreNMS query load spikes.
- Integration with chatops: Allow chat applications to request a device context or invoke whitelisted actions through the MCP server without exposing LibreNMS credentials to every bot.
Getting Help and Resources
- Source & issues: https://github.com/mhajder/librenms-mcp
- Configuration tips:
- Tune POLL_INTERVAL_SECONDS and cache TTLs to balance freshness vs. LibreNMS API limits.
- Use per-service API keys and narrow ALLOWED_ACTIONS to reduce blast radius
Common Issues & Solutions
The user is suggesting that a project could be a good fit for the awesome-ai-plugins list on GitHub. They are unsure about the process to get it listed.
I ran into this too! I found that integrating with the awesome-ai-plugins list significantly enhances visibility for the project. It allows users to discover the plugin easily within the community. Following the steps to fork the repository and contribute to the README is straightforward and helps maintain consistency in the documentation. To get started, you can install the plugin with the following command: npm install @ChromeDevTools/chrome-devtools-mcp
npm install @ChromeDevTools/chrome-devtools-mcp