Get the FREE Ultimate OpenClaw Setup Guide →

librenms

MCP server for LibreNMS management

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mhajder-librenms-mcp uvx librenms-mcp \
  --env LOG_LEVEL="INFO" \
  --env SENTRY_DSN="" \
  --env LIBRENMS_URL="https://domain.tld:8443" \
  --env DISABLED_TAGS="" \
  --env MCP_HTTP_HOST="0.0.0.0" \
  --env MCP_HTTP_PORT="8000" \
  --env MCP_TRANSPORT="stdio" \
  --env LIBRENMS_TOKEN="your-librenms-token" \
  --env READ_ONLY_MODE="false" \
  --env SENTRY_RELEASE="1.2.3" \
  --env LIBRENMS_TIMEOUT="30" \
  --env RATE_LIMIT_ENABLED="false" \
  --env SENTRY_ENVIRONMENT="production" \
  --env LIBRENMS_VERIFY_SSL="true" \
  --env MCP_HTTP_BEARER_TOKEN="" \
  --env RATE_LIMIT_MAX_REQUESTS="100" \
  --env SENTRY_SEND_DEFAULT_PII="true" \
  --env RATE_LIMIT_WINDOW_MINUTES="1" \
  --env SENTRY_TRACES_SAMPLE_RATE="1.0"

How to use

LibreNMS MCP Server provides a programmable API to access and manage LibreNMS resources such as devices, ports, inventory, locations, alerts, and more. The server runs as a Python UV-based MCP server, and you interact with it via the MCP protocol exposed through the configured transport (default stdio, with optional HTTP/SSE/HTTP streaming support). After configuring the required environment variables for your LibreNMS instance, start the server and authenticate requests as needed. The API supports both read and write operations, with the ability to enable read-only mode to prevent any modifications. Key capabilities include querying devices, ports, inventory, locations, logs, alerts, topology, and performance metrics, as well as managing devices, groups, and alert rules when write access is permitted. The included tools cover common operations such as listing devices, retrieving details for a device or port, modifying device metadata, managing groups, and accessing inventory and locations. To use the server, ensure your LibreNMS URL and token are set in the environment, then run the server with the recommended UV runtime or via the installed entry point, and connect clients to the MCP transport as configured.

How to install

Prerequisites:

  • Python 3.11 to 3.14
  • Access to a LibreNMS instance
  • A valid LibreNMS token with appropriate permissions

Install from PyPI (recommended):

# Using UV (recommended)
uvx librenms-mcp

# Or using pip
pip install librenms-mcp

Configure environment variables before running the server:

# Create environment configuration
export LIBRENMS_URL=https://domain.tld:8443
export LIBRENMS_TOKEN=your-librenms-token

If needed, you can also set optional SSL and timeout settings:

export LIBRENMS_VERIFY_SSL=true
export LIBRENMS_TIMEOUT=30

For development or source installation:

# Clone and install from source
git clone https://github.com/mhajder/librenms-mcp.git
cd librenms-mcp
uv sync

# Install editable development version
uv sync --group dev

Run the server (examples):

# Using UV
uv run python run_server.py

# Or directly with Python
python run_server.py

# Or using the installed entry-point
librenms-mcp

Using Docker (optional):

# Normal STDIO image
docker pull ghcr.io/mhajder/librenms-mcp:latest

# MCPO image for Open WebUI integration
docker pull ghcr.io/mhajder/librenms-mcpo:latest

Additional notes

Environment variables drive how the MCP server connects to LibreNMS and how it behaves (e.g., READ_ONLY_MODE to disable writes, RATE_LIMIT settings, and MCP_TRANSPORT for the transport layer). If you encounter authentication issues, verify that LIBRENMS_URL and LIBRENMS_TOKEN are correct and that the token has permissions for the requested operations. For debugging, enable LOG_LEVEL=DEBUG and consult logs. If you use Docker, ensure port exposure matches your MCP_HTTP_PORT if HTTP transport is used, and consider using the MCPO image for UI-based interactions. When upgrading, review any breaking changes in env var names or defaults and adjust the .env or environment accordingly.

Related MCP Servers

Sponsor this space

Reach thousands of developers