{"id":32594094,"url":"https://github.com/mhajder/librenms-mcp","last_synced_at":"2026-02-18T19:03:30.002Z","repository":{"id":319464460,"uuid":"1034977512","full_name":"mhajder/librenms-mcp","owner":"mhajder","description":"MCP server for LibreNMS management","archived":false,"fork":false,"pushed_at":"2026-02-11T21:59:41.000Z","size":743,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-12T04:02:17.774Z","etag":null,"topics":["librenms","mcp","mcp-server","mcp-tools"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhajder.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-09T11:47:18.000Z","updated_at":"2026-02-11T21:59:30.000Z","dependencies_parsed_at":"2025-10-19T07:00:25.608Z","dependency_job_id":"d71fe702-4a16-47ca-92c0-bc5bfeab0219","html_url":"https://github.com/mhajder/librenms-mcp","commit_stats":null,"previous_names":["mhajder/librenms-mcp"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/mhajder/librenms-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhajder%2Flibrenms-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhajder%2Flibrenms-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhajder%2Flibrenms-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhajder%2Flibrenms-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhajder","download_url":"https://codeload.github.com/mhajder/librenms-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhajder%2Flibrenms-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29590685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T18:54:29.675Z","status":"ssl_error","status_checked_at":"2026-02-18T18:50:50.517Z","response_time":162,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["librenms","mcp","mcp-server","mcp-tools"],"created_at":"2025-10-30T02:02:48.315Z","updated_at":"2026-02-18T19:03:24.980Z","avatar_url":"https://github.com/mhajder.png","language":"Python","funding_links":[],"categories":["Monitoring \u0026 Observability","📦 Other"],"sub_categories":["Video"],"readme":"# LibreNMS MCP Server\n\n\u003c!-- mcp-name: io.github.mhajder/librenms-mcp --\u003e\n\nLibreNMS MCP Server is a Python-based Model Context Protocol (MCP) server designed to provide advanced, programmable access to LibreNMS network monitoring data and management features. It exposes a modern API for querying, automating, and integrating LibreNMS resources such as devices, ports, alerts, inventory, locations, logs, and more. The server supports both read and write operations, robust security features, and is suitable for integration with automation tools, dashboards, and custom network management workflows.\n\n## Features\n\n### Core Features\n\n- Query LibreNMS devices, ports, inventory, locations, logs, and alerts with flexible filtering\n- Retrieve network topology, device status, and performance metrics\n- Access and analyze alert history, event logs, and system health\n- Monitor interface statistics, port status, and traffic data\n- Track endpoints and connected devices by MAC or IP address\n- Retrieve and manage device groups, port groups, and poller groups\n- Get detailed information about network services and routing\n\n### Management Operations\n\n- Create, update, and delete devices, ports, and groups (if enabled)\n- Manage alert rules, notifications, and device metadata\n- Configure read-only mode to restrict all write operations for safe monitoring\n- Support for bulk operations on devices and ports\n\n### Advanced Capabilities\n\n- Rate limiting and API security features\n- Real-time network monitoring and health tracking\n- Comprehensive logging and audit trails\n- SSL/TLS support and configurable timeouts\n- Extensible with custom middlewares and utilities\n\n## Installation\n\n### Prerequisites\n\n- Python 3.11 to 3.14\n- Access to a LibreNMS\n- Valid LibreNMS token with appropriate permissions\n\n### Quick Install from PyPI\n\nThe easiest way to get started is to install from PyPI:\n\n```sh\n# Using UV (recommended)\nuvx librenms-mcp\n\n# Or using pip\npip install librenms-mcp\n```\n\nRemember to configure the environment variables for your LibreNMS instance before running the server:\n\n```sh\n# Create environment configuration\nexport LIBRENMS_URL=https://domain.tld:8443\nexport LIBRENMS_TOKEN=your-librenms-token\n```\n\nFor more details, visit: https://pypi.org/project/librenms-mcp/\n\n### Install from Source\n\n1. Clone the repository:\n\n```sh\ngit clone https://github.com/mhajder/librenms-mcp.git\ncd librenms-mcp\n```\n\n2. Install dependencies:\n\n```sh\n# Using UV (recommended)\nuv sync\n\n# Or using pip\npip install -e .\n```\n\n3. Configure environment variables:\n\n```sh\ncp .env.example .env\n# Edit .env with your LibreNMS url and token\n```\n\n4. Run the server:\n\n```sh\n# Using UV\nuv run python run_server.py\n\n# Or directly with Python\npython run_server.py\n\n# Or using the installed script\nlibrenms-mcp\n```\n\n### Using Docker\n\nA Docker images are available on GitHub Packages for easy deployment.\n\n```sh\n# Normal STDIO image\ndocker pull ghcr.io/mhajder/librenms-mcp:latest\n\n# MCPO image for usage with Open WebUI\ndocker pull ghcr.io/mhajder/librenms-mcpo:latest\n```\n\n### Development Setup\n\nFor development with additional tools:\n\n```sh\n# Clone and install with development dependencies\ngit clone https://github.com/mhajder/librenms-mcp.git\ncd librenms-mcp\nuv sync --group dev\n\n# Run tests\nuv run pytest\n\n# Run with coverage\nuv run pytest --cov=src/\n\n# Run linting and formatting\nuv run ruff check .\nuv run ruff format .\n\n# Setup pre-commit hooks\nuv run pre-commit install\n```\n\n## Configuration\n\n### Environment Variables\n\n```env\n# LibreNMS Connection Details\nLIBRENMS_URL=https://domain.tld:8443\nLIBRENMS_TOKEN=your-librenms-token\n\n# SSL Configuration\nLIBRENMS_VERIFY_SSL=true\nLIBRENMS_TIMEOUT=30\n\n# Read-Only Mode\n# Set READ_ONLY_MODE true to disable all write operations (put, post, delete)\nREAD_ONLY_MODE=false\n\n# Disabled Tags\n# Comma-separated list of tags to disable tools for (empty by default)\n# Example: DISABLED_TAGS=alert,bills\nDISABLED_TAGS=\n\n# Logging Configuration\nLOG_LEVEL=INFO\n\n# Rate Limiting (requests per minute)\n# Set RATE_LIMIT_ENABLED true to enable rate limiting\nRATE_LIMIT_ENABLED=false\nRATE_LIMIT_MAX_REQUESTS=100\nRATE_LIMIT_WINDOW_MINUTES=1\n\n# Sentry Error Tracking (Optional)\n# Set SENTRY_DSN to enable error tracking and performance monitoring\n# SENTRY_DSN=https://your-key@o12345.ingest.us.sentry.io/6789\n# Optional Sentry configuration\n# SENTRY_TRACES_SAMPLE_RATE=1.0\n# SENTRY_SEND_DEFAULT_PII=true\n# SENTRY_ENVIRONMENT=production\n# SENTRY_RELEASE=1.2.3\n# SENTRY_PROFILE_SESSION_SAMPLE_RATE=1.0\n# SENTRY_PROFILE_LIFECYCLE=trace\n# SENTRY_ENABLE_LOGS=true\n\n# MCP Transport Configuration\n# Transport type: 'stdio' (default), 'sse' (Server-Sent Events), or 'http' (HTTP Streamable)\nMCP_TRANSPORT=stdio\n\n# HTTP Transport Settings (used when MCP_TRANSPORT=sse or MCP_TRANSPORT=http)\n# Host to bind the HTTP server (default: 0.0.0.0 for all interfaces)\nMCP_HTTP_HOST=0.0.0.0\n# Port to bind the HTTP server (default: 8000)\nMCP_HTTP_PORT=8000\n# Optional bearer token for authentication (leave empty for no auth)\nMCP_HTTP_BEARER_TOKEN=\n```\n\n## Available Tools\n\n### Device \u0026 Inventory Tools\n\n- `devices_list`: List all devices (with optional filters)\n- `device_get`: Get details for a specific device\n- `device_add`: Add a new device\n- `device_update`: Update device metadata\n- `device_delete`: Remove a device\n- `device_ports`: List all ports for a device\n- `device_ports_get`: Get details for a specific port on a device\n- `device_availability`: Get device availability\n- `device_outages`: Get device outages\n- `device_set_maintenance`: Set device maintenance mode\n- `inventory_device`: Get inventory for a device\n- `inventory_device_flat`: Get flat inventory for a device\n- `devicegroups_list`: List device groups\n- `devicegroup_add`: Add a device group\n- `devicegroup_update`: Update a device group\n- `devicegroup_delete`: Delete a device group\n- `devicegroup_devices`: List devices in a device group\n- `devicegroup_set_maintenance`: Set maintenance for a device group\n- `devicegroup_add_devices`: Add devices to a device group\n- `devicegroup_remove_devices`: Remove devices from a device group\n- `locations_list`: List all locations\n- `location_add`: Add a location\n- `location_edit`: Edit a location\n- `location_delete`: Delete a location\n- `location_get`: Get details for a location\n\n### Port \u0026 Port Group Tools\n\n- `ports_list`: List all ports (with optional filters)\n- `port_groups_list`: List port groups\n- `port_group_add`: Add a port group\n- `port_group_list_ports`: List ports in a port group\n- `port_group_assign`: Assign ports to a port group\n- `port_group_remove`: Remove ports from a port group\n\n### Alerting \u0026 Logging Tools\n\n- `alerts_get`: List current and historical alerts\n- `alert_get_by_id`: Get details for a specific alert\n- `alert_acknowledge`: Acknowledge an alert\n- `alert_unmute`: Unmute an alert\n- `alert_rules_list`: List alert rules\n- `alert_rule_get`: Get details for a specific alert rule\n- `alert_rule_add`: Add an alert rule\n- `alert_rule_edit`: Edit an alert rule\n- `alert_rule_delete`: Delete an alert rule\n- `logs_eventlog`: Get event log for a device\n- `logs_syslog`: Get syslog for a device\n- `logs_alertlog`: Get alert log for a device\n- `logs_authlog`: Get auth log for a device\n- `logs_syslogsink`: Add a syslog sink\n\n### Billing Tools\n\n- `bills_list`: List bills\n- `bill_get`: Get details for a bill\n- `bill_graph`: Get bill graph\n- `bill_graph_data`: Get bill graph data\n- `bill_history`: Get bill history\n- `bill_history_graph`: Get bill history graph\n- `bill_history_graph_data`: Get bill history graph data\n- `bill_create_or_update`: Create or update a bill\n- `bill_delete`: Delete a bill\n\n### Network \u0026 Monitoring Tools\n\n- `arp_search`: Search ARP entries\n- `poller_group_get`: Get poller group(s)\n- `routing_ip_addresses`: List all IP addresses from LibreNMS.\n- `services_list`: List all services from LibreNMS.\n- `services_for_device`: Get services for a device from LibreNMS.\n- `switching_vlans`: List all VLANs from LibreNMS.\n- `switching_links`: List all links from LibreNMS.\n- `system_info`: Get system info from LibreNMS.\n\n### General Query Tools\n\n- Flexible filtering and search for all major resources (devices, ports, alerts, logs, inventory, etc.)\n\n## Security \u0026 Safety Features\n\n### Read-Only Mode\n\nThe server supports a read-only mode that disables all write operations for safe monitoring:\n\n```env\nREAD_ONLY_MODE=true\n```\n\n### Tag-Based Tool Filtering\n\nYou can disable specific categories of tools by setting disabled tags:\n\n```env\nDISABLED_TAGS=alert,bills\n```\n\n### Rate Limiting\n\nThe server supports rate limiting to control API usage and prevent abuse. If enabled, requests are limited per client using a sliding window algorithm.\n\nEnable rate limiting by setting the following environment variables in your `.env` file:\n\n```env\nRATE_LIMIT_ENABLED=true\nRATE_LIMIT_MAX_REQUESTS=100   # Maximum requests allowed per window\nRATE_LIMIT_WINDOW_MINUTES=1   # Window size in minutes\n```\n\nIf `RATE_LIMIT_ENABLED` is set to `true`, the server will apply rate limiting middleware. Adjust `RATE_LIMIT_MAX_REQUESTS` and `RATE_LIMIT_WINDOW_MINUTES` as needed for your environment.\n\n### Sentry Error Tracking \u0026 Monitoring (Optional)\n\nThe server optionally supports **Sentry** for error tracking, performance monitoring, and debugging. Sentry integration is completely optional and only initialized if configured.\n\n#### Installation\n\nTo enable Sentry monitoring, install the optional dependency:\n\n```sh\n# Using UV (recommended)\nuv sync --extra sentry\n```\n\n#### Configuration\n\nEnable Sentry by setting the `SENTRY_DSN` environment variable in your `.env` file:\n\n```env\n# Required: Sentry DSN for your project\nSENTRY_DSN=https://your-key@o12345.ingest.us.sentry.io/6789\n\n# Optional: Performance monitoring sample rate (0.0-1.0, default: 1.0)\nSENTRY_TRACES_SAMPLE_RATE=1.0\n\n# Optional: Include personally identifiable information (default: true)\nSENTRY_SEND_DEFAULT_PII=true\n\n# Optional: Environment name (e.g., \"production\", \"staging\")\nSENTRY_ENVIRONMENT=production\n\n# Optional: Release version (auto-detected from package if not set)\nSENTRY_RELEASE=1.2.2\n\n# Optional: Profiling - continuous profiling sample rate (0.0-1.0, default: 1.0)\nSENTRY_PROFILE_SESSION_SAMPLE_RATE=1.0\n\n# Optional: Profiling - lifecycle mode for profiling (default: \"trace\")\n# Options: \"all\", \"continuation\", \"trace\"\nSENTRY_PROFILE_LIFECYCLE=trace\n\n# Optional: Enable log capture as breadcrumbs and events (default: true)\nSENTRY_ENABLE_LOGS=true\n```\n\n#### Features\n\nWhen enabled, Sentry automatically captures:\n\n- **Exceptions \u0026 Errors**: All unhandled exceptions with full context\n- **Performance Metrics**: Request/response times and traces\n- **MCP Integration**: Detailed MCP server activity and interactions\n- **Logs \u0026 Breadcrumbs**: Application logs and event trails for debugging\n- **Context Data**: Environment, client info, and request parameters\n\n#### Getting a Sentry DSN\n\n1. Create a free account at [sentry.io](https://sentry.io)\n2. Create a new Python project\n3. Copy your DSN from the project settings\n4. Set it in your `.env` file\n\n#### Disabling Sentry\n\nSentry is completely optional. If you don't set `SENTRY_DSN`, the server will run normally without any Sentry integration, and no monitoring data will be collected.\n\n### SSL/TLS Configuration\n\nThe server supports SSL certificate verification and custom timeout settings:\n\n```env\nLIBRENMS_VERIFY_SSL=true    # Enable SSL certificate verification\nLIBRENMS_TIMEOUT=30         # Connection timeout in seconds\n```\n\n### Transport Configuration\n\nThe server supports multiple transport mechanisms for the MCP protocol:\n\n#### STDIO Transport (Default)\n\nThe default transport uses standard input/output for communication. This is ideal for local usage and integration with tools that communicate via stdin/stdout:\n\n```env\nMCP_TRANSPORT=stdio\n```\n\n#### HTTP SSE Transport (Server-Sent Events)\n\nFor network-based deployments, you can use HTTP with Server-Sent Events. This allows the MCP server to be accessed over HTTP with real-time streaming:\n\n```env\nMCP_TRANSPORT=sse\nMCP_HTTP_HOST=0.0.0.0        # Bind to all interfaces (or specific IP)\nMCP_HTTP_PORT=8000           # Port to listen on\nMCP_HTTP_BEARER_TOKEN=your-secret-token  # Optional authentication token\n```\n\nWhen using SSE transport with a bearer token, clients must include the token in their requests:\n\n```bash\ncurl -H \"Authorization: Bearer your-secret-token\" http://localhost:8000/sse\n```\n\n#### HTTP Streamable Transport\n\nThe HTTP Streamable transport provides HTTP-based communication with request/response streaming. This is ideal for web integrations and tools that need HTTP endpoints:\n\n```env\nMCP_TRANSPORT=http\nMCP_HTTP_HOST=0.0.0.0        # Bind to all interfaces (or specific IP)\nMCP_HTTP_PORT=8000           # Port to listen on\nMCP_HTTP_BEARER_TOKEN=your-secret-token  # Optional authentication token\n```\n\nWhen using streamable transport with a bearer token:\n\n```sh\ncurl -H \"Authorization: Bearer your-secret-token\" \\\n     -H \"Accept: application/json, text/event-stream\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\"}' \\\n     http://localhost:8000/mcp\n```\n\n**Note**: The HTTP transport requires proper JSON-RPC formatting with `jsonrpc` and `id` fields. The server may also require session initialization for some operations.\n\nFor more information on FastMCP transports, see the [FastMCP documentation](https://gofastmcp.com/deployment/running-server#transport-protocols).\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Run tests and ensure code quality (`uv run pytest \u0026\u0026 uv run ruff check .`)\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## License\n\nMIT License - see LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhajder%2Flibrenms-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhajder%2Flibrenms-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhajder%2Flibrenms-mcp/lists"}