MikroTik MCP
An MCP server for MikroTik routers: the agent reads and changes RouterOS configuration over SSH on a chat request
- 309 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- The agent changes router configuration: firewall and NAT rules, users, VLANs, routes
- The SSH login and password live in environment variables or the client config
- In HTTP mode the server listens on all interfaces by default, so restrict access with the allowed-ips option
Install
- Works in
Manual install
claude mcp add io.github.wiresage/mikrotik-mcpThe client installs mcp-server-mikrotik from PyPI and asks for MIKROTIK_HOST, MIKROTIK_USERNAME and MIKROTIK_PASSWORD.
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The agent changes router configuration: firewall and NAT rules, users, VLANs, routes
- The SSH login and password live in environment variables or the client config
- In HTTP mode the server listens on all interfaces by default, so restrict access with the allowed-ips option
This is third-party code. Review the repository files before installing.
What it does
MikroTik MCP connects an AI agent to RouterOS devices. The agent gets 162 tools covering almost every RouterOS area, from VLANs and the firewall to WireGuard and PoE. The server reaches the router over SSH. Since version 0.14.0 the server handles a fleet: routers are described in an inventory file, and the agent picks one by name, region or tag. Run it in stdio mode for an editor or as an HTTP server in a Docker container. For careful work there is a read-only mode that keeps only tools without writes. The `--sensitive-hiding` flag hides passwords and keys in tool responses.
Who it is for. For network admins and engineers who run MikroTik routers and want to hand the agent routine work and config reviews.
Good fit when
- You want to create a VLAN and a DHCP pool on a router in one sentence without recalling RouterOS syntax
- You need to review firewall and NAT rules and find duplicates or leftovers
- You keep a fleet of routers in a shared inventory file and want to compare settings between devices
- A client needs a WireGuard config and the agent should issue it with the generate_wireguard_client_config tool
- You need regular config audits: the agent compares current rules with the expected ones and reports differences
Not a fit when
- You need hard write protection: read-only mode only removes write tools from the list, and real restriction comes from a RouterOS account with minimal rights
- You use a model with a 32 thousand token window: the schemas of 162 tools will not fit without trimming
- The device cannot be reached over SSH: the server connects to a router only that way
- Your fleet runs other network gear: the server is written for MikroTik and RouterOS only
Example request
Show the firewall rules on the router and find duplicates, change nothingMCP
- Transport
- stdio, http, sse
- Authentication
- key is optional
Environment variables
MIKROTIK_HOSTrequired- Router address, defaults to 192.168.88.1
MIKROTIK_USERNAMErequired- SSH user on the router
MIKROTIK_PASSWORDsecret- SSH password; a key can be given with --key-filename instead
MIKROTIK_READ_ONLY- Set to true to keep only tools that do not write
Limitations
You need Python 3.10 or newer, SSH access to the device and an account on the router. The `--sensitive-hiding` flag hides known passwords and keys but does not find arbitrary secrets in free text of logs and comments. With this flag the download_file and generate_wireguard_client_config tools are disabled. The server keeps no rollback log: whatever the agent wrote to RouterOS is reverted by hand or from a backup. The ready Docker image is built for linux/amd64 and linux/arm64.
How to disable. Remove the server entry from the MCP client configuration and stop the container if you ran Docker. Changes the agent already made stay on the router.
FAQ
How do I connect a MikroTik router to Claude Code?
Run `claude mcp add io.github.wiresage/mikrotik-mcp`. The client takes the server description from the MCP registry, installs the mcp-server-mikrotik package from PyPI and asks for MIKROTIK_HOST, MIKROTIK_USERNAME and MIKROTIK_PASSWORD.
How do I give an agent read-only access to a router?
Start the server with `--read-only` or set MIKROTIK_READ_ONLY=true: only tools that do not modify RouterOS or its files stay in the list. The author also advises creating a minimal-rights account on the router, because the filter works at the tool-list level only.
Can I manage several routers at once?
Yes, list the devices in a YAML inventory file: title, host, port, username, password or key_filename, region and tags. The MIKROTIK_INVENTORY_FILE variable gives the path, and in Docker the file is mounted as a volume, so passwords do not show up in docker inspect.
How do I run MikroTik MCP in Docker?
Pull the image with `docker pull ghcr.io/wiresage/mikrotik-mcp:latest`. For an editor run it with `--rm -i` and the MIKROTIK_* variables. For network access set MIKROTIK_MCP__TRANSPORT=streamable-http: the address is http://localhost:8000/mcp and the health check answers GET /health.
Why does MikroTik MCP use so much context?
The server exposes 162 tools. The author cut descriptions from 209 to 51 characters on average and added short titles, but the schemas still take about 48 thousand tokens. If you need only part of the features, you can comment out unused scope imports in app.py.
Discussion
No questions or reviews yet.
Related
MCP serverskeenetic-mcp: Keenetic router control
keenetic-mcp
MCP server for Keenetic routers: the agent lists devices and Wi-Fi, changes rules through the RCI API and installs nothing on the router
An MCP server for Linux diagnostics: an AI client reads services, logs and network on local and remote hosts, read-only
SSH MCP Server (classfang): remote commands over SSH
SSH MCP Server (classfang)
An SSH MCP server: the agent runs commands, reads and writes files over SFTP, transfers files and starts long jobs while credentials stay with you
Self-hosted MCP server for running commands on remote servers over SSH, with tokens and roles
Tmux MCP Server: agent access to tmux sessions
Tmux MCP Server
An MCP server that lets an agent read tmux panes, run commands in them and create sessions while you watch the output
A secure MCP runtime through which an agent operates local machines, servers and containers
README in short
The front page describes the project briefly and shows three demo videos: Claude Desktop, MCP Inspector and the device inventory. Installation, the RouterOS reference and examples live in the docs folder and on the project site.