Skip to main content

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 monitored devices, ports, alerts, logs, routing, and more. All tools are read-only — they never add, modify, or delete anything in LibreNMS.

Features

~52 read-only tools covering:

Category Tools
System ping, system_info
Devices list_devices, get_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
Alerts list_alerts, get_alert, list_alert_rules, get_alert_rule
Ports get_all_ports, search_ports, get_port_info, get_port_ip_info, ports_with_mac
Logs list_eventlog, list_syslog, list_alertlog, list_authlog
Locations list_locations, get_location
Sensors list_sensors
Device groups list_devicegroups, get_devicegroup
ARP list_arp
Services list_services
Inventory get_inventory
Routing get_routing_table, list_bgp_peers, get_bgp_peer, list_bgp_prefix_counters, list_bgp_prefixes*, list_ospf_neighbors, list_ospf_ports, list_ospfv3_neighbors, list_ospfv3_ports
Health / VLAN / MAC get_device_health, list_vlans, get_device_vlans, list_mac, get_mac, search_mac
Lookup / BGP / Report lookup_device, bgp_session, device_report

* list_bgp_prefixes reads the prefix-level routing table directly from the LibreNMS database (the REST API does not expose it). It requires the optional database section in config.yaml — see config.example.yaml. Without it, the tool returns a clear "not configured" message.

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

Or
# from a local clone of this repository
pipx install mcp-librenms

Or
# or straight from GitHub (replace <your-username>)
pipx install "git+https://github.com/ratnoub/mcp-librenms.git"

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=False for 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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-librenms 0.1.2
File Size Uploaded Provenance Actions
mcp_librenms-0.1.2.tar.gz 15.4 kB With provenance Details for mcp_librenms-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-librenms 0.1.2
File Interpreter ABI Platform Actions
mcp_librenms-0.1.2-py3-none-any.whl Python 3 none any Details for mcp_librenms-0.1.2-py3-none-any.whl

Total release size: 30.5 kB

Release files / mcp_librenms-0.1.2.tar.gz

Download URL mcp_librenms-0.1.2.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
5f38ba9b461914721eff244ff0df05c52288214c49e691a541656f87dac68918
BLAKE2b-256 checksum
How to use checksums
310d5e7fc96746018a7e2c8bf36e9296ab0b23f047023b7fc8db65f6ee9250fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 23, 2026.

Transparency log

Release files / mcp_librenms-0.1.2-py3-none-any.whl

Download URL mcp_librenms-0.1.2-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65ae40b22df82001d00e5a2c20b7adc08a93b0d84729800c6cfb1af6550bee12
BLAKE2b-256 checksum
How to use checksums
57e8f7e94368629db33ae8eaf222f5fe37382919bb652ac8c376e59790092d80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 23, 2026.

Transparency log

Security for mcp-librenms 0.1.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mcp_librenms-0.1.2.tar.gz

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 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page