mcp-librenms
MCP (Model Context Protocol) server that exposes the LibreNMS REST API as MCP tools. Built with FastMCP. Connect AI assistants (Claude Desktop, GitHub Copilot, etc.) to your LibreNMS instance to query and manage monitored devices, ports, alerts, logs, and more.
Features
~40 tools covering:
| Category | Tools |
|---|---|
| System | ping, system_info |
| Devices | list_devices, get_device, add_device, delete_device, update_device_field, rename_device, discover_device, get_device_ports, get_device_ip_addresses, get_device_availability, get_device_outages, get_device_groups, get_device_components, get_device_graphs, get_device_maintenance, set_device_maintenance, add_device_eventlog |
| Alerts | list_alerts, get_alert, ack_alert, unmute_alert, list_alert_rules, get_alert_rule, delete_alert_rule |
| Ports | get_all_ports, search_ports, get_port_info, get_port_ip_info, ports_with_mac, update_port_description |
| Logs | list_eventlog, list_syslog, list_alertlog, list_authlog |
| Locations | list_locations, get_location, add_location, delete_location, edit_location |
| Sensors | list_sensors |
| Device groups | list_devicegroups, get_devicegroup |
| ARP | list_arp |
| Services | list_services |
| Inventory | get_inventory |
Requirements
- Python 3.9+
- A LibreNMS instance with API access
- An API token (LibreNMS web UI: Settings > API > API Settings)
Setup
# 1. Create and activate a virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # Linux/macOS
# 2. Install the package (editable)
pip install -e .
# 3. Configure
copy config.example.yaml config.yaml # Windows
# cp config.example.yaml config.yaml # Linux/macOS
# then edit config.yaml with your LibreNMS URL and API token
Configuration
config.yaml (gitignored — never commit it):
librenms:
url: "http://your-librenms-host" # base URL, no trailing slash
token: "your-api-token" # LibreNMS web UI: Settings > API > API Settings
Running
The server speaks MCP over streamable HTTP by default, bound to 0.0.0.0:5757:
# Console script (foreground)
mcp-librenms --config config.yaml
# Or as a module
python -m mcp_librenms --config config.yaml
Endpoint: http://<IP>:5757/mcp
Options
| Flag | Default | Description |
|---|---|---|
--config FILE |
config.yaml |
Path to YAML config file (CWD, then project root) |
--host IP |
0.0.0.0 |
Bind address |
--port PORT |
5757 |
Bind port |
--daemon |
off | Run in background (detached process) |
--stdio |
off | Use stdio transport instead of HTTP |
Examples:
# Background on a custom address/port
mcp-librenms --config config.yaml --daemon --host 192.168.1.10 --port 8080
# → http://192.168.1.10:8080/mcp
# stdio transport (for MCP clients that spawn the server)
mcp-librenms --config config.yaml --stdio
MCP client configuration
Example for any MCP client that supports streamable HTTP servers:
{
"mcpServers": {
"librenms": {
"url": "http://your-librenms-host:5757/mcp"
}
}
}
For stdio-based clients (Claude Desktop, etc.), spawn the server with --stdio and point --config at your config file:
{
"mcpServers": {
"librenms": {
"command": "D:\\path\\to\\.venv\\Scripts\\mcp-librenms.exe",
"args": ["--config", "D:\\path\\to\\mcp-librenms\\config.yaml", "--stdio"]
}
}
}
Note: the client uses
verify=Falsefor TLS, so it works with LibreNMS instances behind self-signed certificates.
Project structure
mcp-librenms/
├── config.example.yaml # Template for local configuration
├── config.yaml # Your local configuration (gitignored)
├── .gitignore
├── README.md
├── pyproject.toml # Package metadata + console script
├── requirements.txt # Flat dependency list
└── mcp_librenms/
├── __init__.py
├── __main__.py # python -m mcp_librenms
├── client.py # LibreNMS REST API HTTP client
└── server.py # MCP server + tool definitions
License
MIT
Metadata
Release files for mcp-librenms 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mcp_librenms-0.1.0.tar.gz | 10.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mcp_librenms-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.1 kB
Release files / mcp_librenms-0.1.0.tar.gz
| Download URL | mcp_librenms-0.1.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b6da7c781b0fbcc386b7ef2908a31a7273472bb00dd789b67b8c99ab3d442ac
|
|
BLAKE2b-256 checksum How to use checksums |
4d16d3ffece9b200bcd958acb2937d1f7108d8279c6cc111c7139cfd49c20fd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency logRelease files / mcp_librenms-0.1.0-py3-none-any.whl
| Download URL | mcp_librenms-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7aa9bc566aeb2245d4dbf84fd24f72c0562d5a8984a2d6aa0df1eff3070a3fd2
|
|
BLAKE2b-256 checksum How to use checksums |
eb174a7637a5291bfed8169db20cf1b8a4c5ab185d8d97b8b6f4d389c87b88f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.
Transparency log