mikrotik-mcp
Provides read-only observability and inspection tools for MikroTik RouterOS v7 via its REST API, covering system resources, interfaces, IP/routing, DHCP leases, firewall rules, and logs.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mikrotik-mcp
Secure, Strictly Read-Only Model Context Protocol (MCP) Server for MikroTik RouterOS v7 REST API.
Features • RouterOS Requirements • Configuration • Client Setup • Docker • Security
📌 Overview
mikrotik-mcp is an official Model Context Protocol (MCP) server that seamlessly connects AI assistants (such as Claude Desktop, Cursor, Antigravity, Cline, or other MCP-compatible clients) to MikroTik RouterOS v7 devices via the native REST API.
Engineered specifically for network observability, performance monitoring, diagnostics, and configuration inspection, this server follows a strict zero-mutation security model to eliminate any risk of accidental router modifications.
🛡️ Zero-Mutation Security Guarantee
100% Read-Only: All exposed tools perform read-only inspection operations (HTTP
GETonly).Hardened HTTP Client: The internal HTTP client enforces
GETrequests exclusively at the source-code level. Methods forPOST,PUT,PATCH, andDELETEdo not exist in the client.No Arbitrary Execution: No arbitrary REST endpoints, CLI command execution, terminal sessions, or script evaluations are exposed.
Least-Privilege Friendly: Requires only
readandrest-apipolicies on the router. It never requireswrite,policy,password, orsensitivepermissions.
Related MCP server: mtik-mcp
⚡ Features & Available Tools
All tools return structured, LLM-friendly JSON output:
Tool Name | Category | Parameters | Description |
| System |
| Retrieves hardware and OS resources: CPU load, free/total RAM, storage, uptime, board name, and RouterOS version. |
| System |
| Fetches RouterBOARD hardware details: model, serial number, current firmware, and factory firmware. |
| System |
| Retrieves the router's identity / hostname. |
| Interfaces |
| Lists network interfaces with their operational status (running/disabled), MAC address, MTU, and Tx/Rx traffic stats. Filterable by type (e.g. |
| Interfaces |
| Returns complete configuration and live stats for a specific interface by name ( |
| IP & Routing |
| Lists all configured IP addresses, subnet masks, and their assigned interfaces. |
| IP & Routing |
| Retrieves routing table entries (static, connected, and dynamic routes). |
| IP & Routing |
| Inspects the ARP table (IP-to-MAC address mapping). |
| DHCP |
| Lists active DHCP server leases: assigned IP, client MAC, host-name, status ( |
| Firewall |
| Lists firewall filter rules with hit counters (packets and bytes) and rule comments. Filterable by chain ( |
| Firewall |
| Lists firewall NAT rules (masquerade, dstnat, srcnat, and port forwardings). |
| Logs |
| Fetches recent router system log entries with optional topic filtering (e.g. |
🚀 MikroTik RouterOS Setup
1. Enable the REST API Service
Ensure the www-ssl service (HTTPS - port 443) or www service (HTTP - port 80) is enabled on your RouterOS v7 device:
# Check service status
/ip service print
# Enable www-ssl (strongly recommended)
/ip service enable www-ssl2. Create a Dedicated Read-Only User (Best Practice)
Create a dedicated group and user restricted to read-only API access:
# 1. Create a group with minimal policies: 'read' and 'rest-api' (or 'api')
/user group add name=mcp-readonly policy=read,api,web,rest-api
# 2. Create a dedicated user for the MCP server
/user add name=mcp-agent group=mcp-readonly password="ReplaceWithStrongPassword123!"⚙️ Configuration
The server can be configured via Environment Variables, CLI arguments, or a .env file (automatically loaded in Node.js 20+):
Variable | CLI Flag | Default | Description |
|
|
| IP address or hostname of the MikroTik router |
|
|
| RouterOS REST API port |
|
|
| MikroTik login username |
|
|
| MikroTik login password |
|
|
| Use HTTPS ( |
|
|
| Allow self-signed internal SSL certificates |
|
|
| Request timeout in milliseconds |
🧩 Client Integration
1. Claude Desktop
Add the server entry to your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"mikrotik": {
"command": "node",
"args": ["/path/to/mikrotik-mcp/dist/index.js"],
"env": {
"MIKROTIK_HOST": "192.168.88.1",
"MIKROTIK_PORT": "443",
"MIKROTIK_USERNAME": "mcp-agent",
"MIKROTIK_PASSWORD": "ReplaceWithStrongPassword123!",
"MIKROTIK_USE_SSL": "true",
"MIKROTIK_ALLOW_INSECURE_SSL": "true"
}
}
}
}2. Cursor / Antigravity / OpenCode / Cline
Add the server block to your MCP client configuration:
{
"mcpServers": {
"mikrotik": {
"command": "npx",
"args": ["-y", "@reyhanfahlevi/mikrotik-mcp"],
"env": {
"MIKROTIK_HOST": "192.168.88.1",
"MIKROTIK_USERNAME": "mcp-agent",
"MIKROTIK_PASSWORD": "ReplaceWithStrongPassword123!"
}
}
}
}Note: If running directly from a local clone before publishing to npm, you can point directly to the local folder:
"command": "npx", "args": ["-y", "/absolute/path/to/mikrotik-mcp"]
🐳 Docker Deployment
The image utilizes a minimal, multi-stage Alpine build without development dependencies and runs under an unprivileged node user.
Build the Image
docker build -t mikrotik-mcp:latest .Run with Security Hardening
docker run -i --rm \
--read-only \
--cap-drop=ALL \
--security-opt=no-new-privileges:true \
-e MIKROTIK_HOST="192.168.88.1" \
-e MIKROTIK_USERNAME="mcp-agent" \
-e MIKROTIK_PASSWORD="ReplaceWithStrongPassword123!" \
mikrotik-mcp:latestUsing Docker Compose
Copy .env.example to .env, adjust your credentials, and start the service:
docker compose run --rm mikrotik-mcp💻 Local Development
# 1. Clone repository
git clone https://github.com/reyhanfahlevi/mikrotik-mcp.git
cd mikrotik-mcp
# 2. Install dependencies
npm install
# 3. Start development server with hot-reload (tsx)
npm run dev
# 4. Build TypeScript to production JavaScript
npm run build📄 License & Maintainer
Author: Reyhan Fahlevi
Repository: https://github.com/reyhanfahlevi/mikrotik-mcp
License: MIT License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only access to your MetaTrader 4 and 5 accounts for AI agents: balances, open positions, trade history with win rate, live quotes, symbol specs and candles. It cannot place, modify or close orders.
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
Read-only discovery of ChatGXT's integration catalog and public MCP capabilities.
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides read-only (with limited address-list management) access to MikroTik RouterOS routers, enabling monitoring of system info, interfaces, DHCP leases, firewall rules, and more via natural language.2MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to audit, inspect, and safely configure MikroTik RouterOS v7 routers through tools for connection testing, system status, security audits, firewall mangle management, routing, DHCP leases, sanitized exports, containers, and adlist queries.30 npmGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to read, query, and safely modify RouterOS 7 devices over the REST API, covering firewall, routing, DHCP, DNS, interfaces, containers, files, and diagnostics, with confirmation gates and a scheduled rollback guard in front of disruptive changes.46 PyPIMIT
- AlicenseAqualityBmaintenanceEnables AI agents and NOC staff to inspect TR-069 devices, tasks, faults, files, presets, and provisions through strictly read-only GenieACS NBI GET calls. Secrets and credentials are redacted, with bounded queries and policy guardrails that block write operations before any network request.828 npmApache 2.0