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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mikrotik-mcp show me the router's CPU load and free memory"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Available Tools
12 toolsmikrotik_get_arp_tableB
Get the ARP (Address Resolution Protocol) table to view IP to MAC address mappings.
Inputs: ipAddress, interfaceName.
mikrotik_get_dhcp_leasesC
List DHCP server leases including active client IP addresses, MAC addresses, hostnames, and expiration times.
Inputs: status, hostname.
mikrotik_get_firewall_filter_rulesB
List firewall filter rules with hit counters (packets, bytes) and configuration.
Inputs: chain.
mikrotik_get_firewall_nat_rulesB
List firewall NAT rules (masquerade, dstnat, srcnat).
Inputs: chain.
mikrotik_get_interface_detailsB
Get detailed configuration and statistics for a specific interface by name or ID.
Inputs: nameOrId (required).
mikrotik_get_ip_addressesB
List all IP addresses configured on the MikroTik router interfaces.
Inputs: interfaceName.
mikrotik_get_ip_routesA
List the routing table entries (static, connected, dynamic routes).
Inputs: activeOnly.
mikrotik_get_system_identityA
Get the MikroTik system identity / hostname.
Inputs: no named parameters.
mikrotik_get_system_logsC
Retrieve recent system log entries from the MikroTik router.
Inputs: limit, topic.
mikrotik_get_system_resourceA
Get MikroTik system resources including CPU load, memory usage, uptime, board name, and RouterOS version.
Inputs: no named parameters.
mikrotik_get_system_routerboardA
Get MikroTik RouterBOARD hardware details, model, serial number, and firmware version.
Inputs: no named parameters.
mikrotik_list_interfacesA
List all network interfaces on the MikroTik router along with their status (running, disabled), type, and basic stats.
Inputs: type.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools map to a distinct resource (identity, routerboard, interfaces, IP addresses, routes, ARP, DHCP leases, filter vs NAT rules, logs). The only mild overlap is between get_system_resource and get_system_routerboard, both of which return hardware/system-level information, though the descriptions do differentiate CPU/memory vs board/serial/firmware.
All tools consistently use the mikrotik_ prefix followed by a verb_noun pattern, which is predictable and readable. The only minor deviation is inconsistent use of get vs list for collection endpoints (mikrotik_list_interfaces but mikrotik_get_ip_addresses), which is semantically meaningful but not strictly uniform.
Twelve tools is well within the ideal 3-15 range and each one targets a concrete, commonly needed piece of router telemetry. No tool feels redundant or padding the surface.
The surface is a coherent read-only inspection set covering system, interfaces, IP, routing, ARP, DHCP, firewall and logs, but it offers zero write operations (no creating/disabling interfaces, adding firewall or NAT rules, IP addresses, or DHCP leases), so any remediation workflow dead-ends. Notable read gaps also exist, such as DNS settings, wireless/registration tables, and interface traffic statistics beyond the details call.
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 Linux server and Docker monitoring for AI assistants: CPU, memory, disk, network.
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.
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.39 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.31 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.820 npmApache 2.0