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
MCP server

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
All reasons and checks

wiresage/mikrotik-mcp

Install

Manual install

claude mcp add io.github.wiresage/mikrotik-mcp

The client installs mcp-server-mikrotik from PyPI and asks for MIKROTIK_HOST, MIKROTIK_USERNAME and MIKROTIK_PASSWORD.

Access and checks

How we review

Broad 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 nothing

MCP

Transport
stdio, http, sse
Authentication
key is optional

Environment variables

MIKROTIK_HOST required
Router address, defaults to 192.168.88.1
MIKROTIK_USERNAME required
SSH user on the router
MIKROTIK_PASSWORD secret
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.

Russian stack

MCP server for Keenetic routers: the agent lists devices and Wi-Fi, changes rules through the RCI API and installs nothing on the router

MCP serverBroad access29Repository stars
Official

An MCP server for Linux diagnostics: an AI client reads services, logs and network on local and remote hosts, read-only

MCP serverExtended access315Repository stars

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

MCP serverBroad access990Repository stars

Self-hosted MCP server for running commands on remote servers over SSH, with tokens and roles

MCP serverBroad access2Repository stars

A secure MCP runtime through which an agent operates local machines, servers and containers

MCP serverBroad access1.3KRepository stars

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.

README badge

Report a problem

Foxx AIMikroTik MCP
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.