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

~51 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_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

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.3

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.3
File Size Uploaded Provenance Actions
mcp_librenms-0.1.3.tar.gz 12.8 kB With provenance Details for mcp_librenms-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 24.7 kB

Release files / mcp_librenms-0.1.3.tar.gz

Download URL mcp_librenms-0.1.3.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
50b23cdb89480d95d24e626a29b104376ed507fddd14da305ffa20cb503413f1
BLAKE2b-256 checksum
How to use checksums
f4e1a778366c1a51540bdb41aa8552f8d675ca523d179d4b70a5b0181df26db0
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.3-py3-none-any.whl

Download URL mcp_librenms-0.1.3-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57d617db589c2bc6f79aba55605f6758189410169567ecd8e8d1650ab6fcaaac
BLAKE2b-256 checksum
How to use checksums
4bbae2535a77762247b254379b4368ef6f9c2e26b4248db13c8b94a85f2703eb
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.3

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.3.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