VOOZH about

URL: https://glama.ai/mcp/servers/ali-master/mikrotik-mcp

โ‡ฑ mikrotik-mcp by ali-master | Glama



@usex/mikrotik-mcp exposes MikroTik RouterOS as 310 Model Context Protocol tools across 31 modules, so an AI client (Claude Desktop, Claude Code, any MCP client) can read and configure your router in plain language. It speaks to the device over SSH โ€” no agent, no API package to install on RouterOS โ€” runs on Bun, and validates every tool call against a Zod schema.

Every tool is risk-annotated (read / write / destructive) so clients can gate what runs, and risky changes can be wrapped in Safe Mode โ€” RouterOS holds them in memory and auto-reverts if your session drops, so you can't lock yourself out.

// claude_desktop_config.json
{
 "mcpServers": {
 "mikrotik": {
 "command": "mikrotik-mcp",
 "env": {
 "MIKROTIK_HOST": "192.168.88.1",
 "MIKROTIK_USERNAME": "admin",
 "MIKROTIK_PASSWORD": "your-password"
 }
 }
 }
}

"Show me the firewall input chain, then block SSH from the WAN under safe mode." "Build an IKEv2 site-to-site tunnel to 203.0.113.5 for 192.168.20.0/24." "Why can't VLAN 50 reach the internet?"

Why it's different

  • ๐Ÿงฐ Breadth โ€” 310 tools covering the whole device: L2 (bridge, VLAN, wireless, PoE), L3 (addressing, routing, DHCP, DNS), security (firewall, NAT, address-lists, certificates), QoS (queues), and system ops (users, logs, backups, scheduler).

  • ๐Ÿ” A complete VPN suite โ€” WireGuard, IPsec (IKEv1/IKEv2), L2TP, PPTP, SSTP, OpenVPN, plus GRE/IPIP/EoIP/VXLAN tunnels. With a choose-vpn-solution prompt that picks the right one for you. See the VPN guide.

  • ๐Ÿ›Ÿ Safe Mode โ€” a real transactional window (enable_safe_mode โ†’ changes โ†’ commit_safe_mode/rollback_safe_mode) backed by a persistent SSH session. Auto-reverts on disconnect.

  • ๐Ÿšฆ Risk-annotated tools โ€” readOnlyHint / destructiveHint let clients auto-approve reads and prompt on writes.

  • ๐Ÿงฑ Injection-safe by construction โ€” a command builder quotes/escapes every value, so a hostname like LAN; /system reset can never split into a second command.

  • ๐Ÿ” Drop-in for the Python server โ€” the MIKROTIK_* environment variables are byte-for-byte compatible; swap the binary, keep your config.

  • ๐Ÿค– Guided prompts โ€” 8 built-in workflows (harden, diagnose, guest Wi-Fi, VPNs, backup & document) that turn an intent into the right sequence of tool calls.

Related MCP server: RouterOS MCP Server

Quickstart

# 1. Install (requires Bun โ‰ฅ 1.3 โ€” https://bun.sh)
bun add -g @usex/mikrotik-mcp

# 2. Point it at your router and verify SSH connectivity
MIKROTIK_HOST=192.168.88.1 MIKROTIK_USERNAME=admin MIKROTIK_PASSWORD=โ€ขโ€ขโ€ขโ€ข \
 mikrotik-mcp auth-check

# 3. List the catalog (name ยท risk ยท title)
mikrotik-mcp tools

# 4. Run it (stdio by default โ€” wire it into your MCP client)
mikrotik-mcp serve

Prefer SSH keys over a password? Point the server at a key file instead โ€” and add a passphrase if the key is encrypted:

MIKROTIK_HOST=192.168.88.1 MIKROTIK_USERNAME=admin \
MIKROTIK_KEY_FILENAME=~/.ssh/id_ed25519 \
MIKROTIK_KEY_PASSPHRASE=โ€ขโ€ขโ€ขโ€ข \
 mikrotik-mcp auth-check # prints "Auth mode: SSH key"

The key (file via --key-filename or inline PEM via --private-key) takes precedence over a password. Full configuration reference: docs/configuration.md.

From source

git clone https://github.com/ali-master/mikrotik-mcp && cd mikrotik-mcp
bun install
bun run start # serve from source
bun run build # bundle to dist/

The tool catalog

310 tools across 31 modules. Full, always-current reference (parameters + risk per tool) is generated from source: docs/tools-reference.md.

Group

Tools

Modules

Interfaces

41

interfaces, VLAN, bridge, wireless, PoE

Addressing & Routing

46

IP addresses, IP pools, routing, DHCP, DNS

Security

34

firewall filter, NAT, address-lists, certificates, IP services

VPN & Tunneling

96

WireGuard, IPsec, PPP, L2TP, PPTP, SSTP, OpenVPN, GRE/IPIP/EoIP/VXLAN

QoS

19

queue types, queue trees, simple queues

System & Ops

74

system, network tools, scheduler/scripts, users, logs, backup, Safe Mode

VPN & tunneling โ€” expert coverage

Every MikroTik VPN technology, modeled the way RouterOS actually layers them (the PPP-based VPNs share one /ppp backend for users and addressing):

Need

Use

Build it with

MikroTik โ†” MikroTik, modern clients

WireGuard

create_wireguard_interface, add_wireguard_peer, generate_wireguard_client_config

Interop site-to-site / native IKEv2

IPsec

create_ipsec_{profile,peer,identity,proposal,policy}, get_ipsec_active_peers

Built-in OS VPN clients

L2TP/IPsec

set_l2tp_server, create_ppp_secret, create_ppp_profile

Through restrictive firewalls

SSTP (TLS)

set_sstp_server, create_sstp_client

Cross-platform OpenVPN

OpenVPN

set_ovpn_server, create_ovpn_client

Route / L2-bridge between sites

GRE/IPIP/EoIP/VXLAN

create_gre_tunnel, create_eoip_tunnel, create_vxlan_tunnel

Not sure which? Invoke the choose-vpn-solution prompt and the server recommends one and outlines the build. Details: docs/vpn-guide.md.

Built-in prompts

MCP prompts are one-click guided workflows. This server ships 8 โ€” authored as Markdown in prompts/, so you can edit or add your own without touching code:

harden-router ยท diagnose-connectivity ยท setup-guest-wifi ยท choose-vpn-solution ยท setup-wireguard-vpn ยท setup-ipsec-site-to-site ยท setup-l2tp-ipsec-roadwarrior ยท backup-and-document

See docs/prompts.md.

Transports

Transport

When

Run

stdio (default)

Claude Desktop, local MCP clients

mikrotik-mcp serve

streamable-http

Remote / shared, behind a proxy

mikrotik-mcp serve --transport streamable-http --mcp-port 8000

sse

Legacy HTTP clients

mikrotik-mcp serve --transport sse

HTTP transports expose POST /mcp and a GET /health check, with DNS-rebinding protection that reconciles with your bind host automatically. See docs/transports.md.

Safe Mode

enable_safe_mode โ†’ (make changes) โ†’ commit_safe_mode # persist
 โ†’ rollback_safe_mode # discard

While active, every change is held in memory; if the SSH session drops (e.g. a firewall rule that locks you out), RouterOS reverts everything automatically. Commands issued during the window are routed through the same persistent session. See docs/safe-mode.md.

Configuration

Connection and transport settings come from MIKROTIK_* env vars or matching CLI flags (highest precedence last: defaults โ†’ env โ†’ flags).

Variable

Flag

Default

Purpose

MIKROTIK_HOST

--host

127.0.0.1

RouterOS host

MIKROTIK_USERNAME

--username

admin

SSH user

MIKROTIK_PORT

--port

22

SSH port

MIKROTIK_PASSWORD

--password

โ€”

SSH password (or use a key โ†’)

MIKROTIK_KEY_FILENAME

--key-filename

โ€”

SSH private-key file path

MIKROTIK_PRIVATE_KEY

--private-key

โ€”

Inline private key (PEM)

MIKROTIK_KEY_PASSPHRASE

--key-passphrase

โ€”

Passphrase for an encrypted key

MIKROTIK_MCP__TRANSPORT

--transport

stdio

stdio / streamable-http / sse

MIKROTIK_MCP__PORT

--mcp-port

8000

HTTP bind port

Full table (incl. HTTP host, allow-lists, timeouts, MIKROTIK_LOG_LEVEL): docs/configuration.md.

Schemas

schemas/ ships machine-readable JSON Schemas, generated from the TypeScript source (bun run gen:schemas) so they can never drift:

  • schemas/tool-catalog.json โ€” all 310 tools with risk, description, and input schema

  • schemas/tools/<name>.json โ€” per-tool input schema

  • schemas/config.schema.json โ€” the runtime configuration

Migrating from the Python server

This is a from-scratch rewrite of mcp-server-mikrotik in Bun + TypeScript. All 169 original tools are ported 1:1 (same names, same parameters), plus 141 new ones (the full VPN suite, system/network tools, bridge, address-lists, scheduler, certificates, IP services). Because the MIKROTIK_* environment variables are identical, migration is usually just swapping the command. The legacy Python source remains in mikrotik-mcp/ for reference.

Documentation

Doc

Getting started

Install, verify, first run

Configuration

Every env var & flag

Connecting clients

Claude Desktop, stdio, HTTP

Transports

stdio / HTTP / SSE, DNS-rebinding

Safe Mode

Transactional changes

VPN guide

Every tunnel type + how to build it

Prompts

The 8 guided workflows

Architecture

How it's built

Security

Credentials, risk gating

Tool reference

All 310 tools

Development ยท Docker

Build, test, deploy

Development

bun run test:types # tsc --noEmit
bun test # unit tests
bun run gen # regenerate schemas/ + docs/tools-reference.md from source
bun run build # bundle to dist/

See docs/development.md and CONTRIBUTING.md.

Security

Talks to RouterOS over SSH using credentials you supply; nothing is sent anywhere else. Tool values are quoted/escaped to prevent console-command injection. Destructive and dangerous tools are annotated so clients can require confirmation, and a plaintext-password-in-a-container warning nudges you toward key files or secrets. Details: docs/security.md. Only point this at devices you're authorized to manage.

License

MIT. Reuse freely. No warranty.


A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

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

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/ali-master/mikrotik-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server