Skip to main content
Glama
pkovitan

MikroTik MCP Server

by pkovitan

MikroTik MCP Server

MCP server for MikroTik RouterOS with:

  • multi-router support

  • environment-based auto-load

  • split read/write architecture

  • selectable runtime modes: readonly, safe-write, full

Current Architecture

Key modules:

Architecture notes:

Related MCP server: MikroTik MCP Server

Runtime Modes

  • readonly

    • registers only read tools

    • read tools auto-connect on first use when routers are pre-defined in env

    • safest mode for AI agents

  • safe-write

    • registers all read tools

    • registers only a small safe write subset: add_router, connect_router, backup_config

  • full

    • registers both read and write tools

Mode reference:

Multi-Router Setup

Recommended approach: set MIKROTIK_ROUTERS once and let the server auto-load routers every time it starts.

Example:

{
  "rb4011": {
    "host": "192.168.100.1",
    "username": "admin",
    "password": "change-me-4011",
    "port": 8728
  },
  "rb2011": {
    "host": "192.168.88.1",
    "username": "admin",
    "password": "change-me-2011",
    "port": 8728
  }
}

More details:

Launching The Server

Recommended subprocess entrypoints:

python -m mikrotik_mcp.entrypoint
python -m mikrotik_mcp.hermes_entrypoint

Set runtime via environment variables such as:

MIKROTIK_MODE=readonly|safe-write|full
MIKROTIK_ROUTERS=<json>

Installation

Setup guide:

Testing

Testing guide:

Quick commands:

python -m pytest -q
python -m pytest -q -m regression
python -m pytest -q -m scenario
python -m pytest -q -m acceptance

Security Guidance

For AI agents:

  1. Prefer readonly mode by default.

  2. Use safe-write only when backup/connect workflows are required.

  3. Use full only for supervised admin workflows.

Tool Coverage

Read surface includes:

  • routers

  • connectivity test

  • system info

  • interfaces

  • IP addresses

  • firewall rules

  • DHCP leases and DHCP info

  • logs, log topics, log summary

  • NAT rules

  • routes

  • users

  • wireless interfaces and registration

Write surface includes:

  • add router

  • connect router

  • add/remove IP

  • add/update/delete/move firewall rules

  • add route

  • update/delete NAT rules

  • backup config

  • run command

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables management of MikroTik routers running RouterOS 6 and 7 via SSH, Telnet, or API with automatic command adaptation. Provides over 46 MCP tools for device management, firewall, DHCP, VPN, configuration profiles, and more.
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server that sends CLI commands to MikroTik RouterOS via SSH. It allows executing any RouterOS CLI command and getting text output back.
    1
    -