MikroTik RouterOS MCP
Allows managing MikroTik RouterOS devices, including system info, interfaces, IP addresses, routes, firewall, NAT, DHCP, DNS, bridges, WireGuard, logs, ping, config export, and guarded script execution via API or SSH fallback.
Enables management of WireGuard interfaces and peers on MikroTik RouterOS devices.
Click on "Install 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 RouterOS MCPshow interfaces on home router"
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 RouterOS MCP
An MCP server for MikroTik RouterOS with a lightweight web dashboard for multi-router management. Exposes 24 MCP tools covering transport fallback (API → API-SSL → SSH), read-heavy network inspection, and guarded write access, while the bundled dashboard provides a simple REST-backed UI for viewing routers and common network state.
Quick start
git clone https://github.com/drohi-r/mikrotik-routeros-mcp && cd mikrotik-routeros-mcp
uv sync
# Configure devices
cp devices.yaml.example devices.yaml # then edit with your router details
# Run the MCP server
uv run python -m mikrotik_routeros_mcp.server
# Or run the web dashboard
uv run python -m mikrotik_routeros_mcp.dashboard --host 0.0.0.0 --port 8080The server looks for config in this order: MIKROTIK_ROUTEROS_CONFIG env var → ./devices.yaml → ./devices.yml → ./devices.json.
Related MCP server: MikroTik MCP
Architecture
graph TD
A["MikroTik RouterOS MCP Server<br/><code>mikrotik_routeros_mcp</code><br/>24 tools · safety gate"] --> B
B["Transport Layer<br/>Fallback: API → API-SSL → SSH"] --> C
C["RouterOS Devices<br/>Named targets from devices.yaml"]
D["Multi-Device Config<br/>Named routers · tags · per-device write control"] -.-> A
E["Guarded Write Flow<br/>plan_script_change → apply_script_change"] -.-> A
F["SSH Fallback<br/>Config export · limited-API environments"] -.-> B
style A fill:#1a1a2e,stroke:#2196F3,color:#fff
style B fill:#1a1a2e,stroke:#2196F3,color:#fff
style C fill:#1a1a2e,stroke:#0f3460,color:#fff
style D fill:#0f3460,stroke:#0f3460,color:#fff
style E fill:#0f3460,stroke:#0f3460,color:#fff
style F fill:#0f3460,stroke:#0f3460,color:#fffConfiguration
Device config example:
devices:
- name: home
host: 192.168.88.1
username: admin
password: change-me
transport_order:
- api
- api-ssl
- ssh
allow_writes: false
tags:
- home
- lab
- name: office
host: office-router.example.com
username: admin
password: change-me
fallback_ip: 203.0.113.10
transport_order:
- api-ssl
- ssh
allow_writes: false
tags:
- office
- productionTools
Server and discovery
Tool | What it does |
| Return current MCP server configuration and safety settings |
| List all configured RouterOS devices |
| Return detailed info for a named device |
System and network reads
Tool | What it does |
| Return system identity, version, uptime, and hardware info |
| List all network interfaces with status |
| List IP addresses assigned to interfaces |
| List the routing table |
| List firewall filter rules |
| List NAT rules |
| Return DNS configuration |
| List DHCP server instances |
| List DHCP leases |
| List firewall address list entries |
| List bridge interfaces |
| List bridge port memberships |
| List discovered network neighbors |
| List WireGuard interfaces |
| List WireGuard peers |
| Retrieve system log entries |
| Ping a target from a device |
| Export device configuration |
| Read-only API print for any RouterOS path |
Guarded writes
Tool | What it does |
| Preview a RouterOS script change with risk assessment |
| Apply a planned script change with approval code |
Write access is blocked unless the target device has allow_writes: true. The intended workflow is: plan_script_change → inspect risk level and approval code → apply_script_change only if the plan is acceptable.
Claude Desktop
{
"mcpServers": {
"mikrotik-routeros": {
"command": "uv",
"args": ["run", "--directory", "/path/to/mikrotik-routeros-mcp", "python", "-m", "mikrotik_routeros_mcp.server"],
"env": {
"MIKROTIK_ROUTEROS_CONFIG": "/path/to/devices.yaml"
}
}
}
}VS Code / Cursor
{
"servers": {
"mikrotik-routeros": {
"command": "uv",
"args": ["run", "--directory", "/path/to/mikrotik-routeros-mcp", "python", "-m", "mikrotik_routeros_mcp.server"],
"env": {
"MIKROTIK_ROUTEROS_CONFIG": "/path/to/devices.yaml"
}
}
}
}Codex
Create a codex.json MCP config file:
{
"mcpServers": {
"mikrotik-routeros": {
"command": "uv",
"args": ["run", "--directory", "/path/to/mikrotik-routeros-mcp", "python", "-m", "mikrotik_routeros_mcp.server"],
"env": {
"MIKROTIK_ROUTEROS_CONFIG": "/path/to/devices.yaml"
}
}
}
}Then run Codex with:
codex --mcp-config codex.jsonProduction safety
Device-scoped targeting — the model must choose a named target router explicitly. No ambient "default device" behavior.
Write gating — write access is blocked per-device unless
allow_writes: trueis set in config. Read tools are always available.Guarded write flow —
plan_script_changereturns a risk assessment and approval code.apply_script_changerequires that approval code to proceed.Transport fallback — attempts
api, thenapi-ssl, thensshin order, so the server connects via the best available transport without manual switching.Read-only API guard —
run_api_printblocks mutating RouterOS API paths by design.Input validation — all tools validate parameters before any API call is made. Invalid inputs return structured JSON errors, never raw exceptions.
Development
uv sync
uv run python -m pytest -vLicense
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/drohi-r/mikrotik-routeros-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server