MikroMCP

io.github.AliKarami由 GitHub 帳號 AliKarami 發布v1.16.1更新於 Nov 7, 2026

MCP server for MikroTik RouterOS and SwOS: typed tools, dry-run, RBAC, audit logs, and rollback.

概覽

AI 產生的概覽

為助理提供具型別、可稽核的工具,用來檢視、診斷並安全地變更 MikroTik RouterOS 路由器與 SwOS 交換器。

可以做什麼
  • 讀取路由器狀態:系統狀態、時鐘、介面、IP 位址、DHCP 租約、路由、橋接器、WiFi、WireGuard、DNS、防火牆與路由規則、日誌
  • 變更設定:新增、修改、移除或啟停位址、路由、防火牆、mangle、位址清單與路由規則、DNS 記錄與設定、橋接器、WiFi 與 WireGuard 物件
  • 從路由器執行診斷:ping、traceroute、流量快照,以及依條件篩選的日誌讀取
  • 操作裝置:延遲重開機、設定時鐘,以及透過 SSH 執行受策略約束的 RouterOS 主控台指令
  • 以 dry-run 預覽、冪等寫入、確認權杖、快照、變更計畫與回復來控管改動
適用情境
適合讓助理以自然語言協助維運 MikroTik 網路設備,而不是臨時拼湊指令列:檢查路由器健康狀態、稽核防火牆與路由設定,或對路由器與交換器進行經審閱、可回復的變更。
執行需求
以 npm 套件形式在桌面用戶端透過 stdio 本機執行。需要一份路由器登錄 YAML 檔,路徑由 MIKROMCP_CONFIG_PATH 指定(預設位於使用者家目錄下),內含路由器憑證,並須在 RouterOS 上啟用 API 存取;ping 與主控台指令透過 SSH 執行。選用的 MIKROMCP_LOG_LEVEL 與 MIKROMCP_STDIO_IDENTITY 用於控制日誌等級與 stdio 的 RBAC 身分。
安裝前請注意
它控制真實網路設備:寫入、重開機與設定變更影響重大,應先以 dry-run 預覽並核對差異。破壞性操作或批次操作需要確認權杖。路由器憑證存放於設定檔中,應使用最小權限帳號。run_command 可執行任意 RouterOS 主控台指令,僅受允許/拒絕策略限制。SwOS 支援標示為實驗性。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MikroMCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

MikroMCP

[MikroMCP]

AI-native network automation for MikroTik RouterOS and SwOS. MikroMCP exposes RouterOS routers and SwOS switches as a typed, auditable Model Context Protocol server so Claude, Cursor, Codex, and other MCP clients can inspect, diagnose, and safely operate MikroTik gear in natural language.

[CI] [Release] [Version] [License: MIT] [Node.js >= 22] [RouterOS 7.x] [MCP Server] [Tools] [MikroMCP MCP server]

MikroMCP exists because raw router CLI access is the wrong abstraction for AI agents. RouterOS is powerful, but asking an LLM to improvise shell commands against production network gear is risky. MikroMCP gives agents a controlled tool surface: strict schemas, idempotent writes, dry-run previews, per-router circuit breakers, retry policies, RBAC, audit logs, snapshots, and rollback-aware change workflows.

In one sentence: MikroMCP turns MikroTik RouterOS into a production-minded MCP control plane for AI infrastructure, DevOps automation, and modern router management.

[AI assistant connected through MikroMCP to a small MikroTik fleet, with tool calls flowing through validation, audit, and RouterOS REST]


Quick Start

[MikroMCP quick start: npm install -g mikromcp, mikromcp init, then ask Claude Desktop about your router]

That's the whole setup for a single-router stdio deployment. For standalone binaries, Docker, HTTP/SSE mode, the RouterOS API prerequisites, and the full 15-minute walkthrough, see the Getting Started guide.


Feature Showcase

CategoryWhat MikroMCP covers
🧭 Router managementSystem status, clock, reboot, packages, files, scripts, scheduler jobs, containers
🌐 Network operationsInterfaces, VLANs, IP addresses, DHCP leases, DNS static records, bridge ports, WiFi clients
🔥 Firewall and policyFilter/NAT rules, mangle rules, address lists, route tables, routing rules
🛰️ Routing visibilityStatic routes, routing tables, BGP peers, OSPF neighbors
🔀 SwOS switchesExperimental. MikroTik SwOS and SwOS Lite switches (deviceType: "swos") over the reverse-engineered .b HTTP API: port links, PoE, SFP diagnostics, guarded whole-blob writes with a firmware-compatibility check, the whole switch config as one YAML document (export, dry-run, apply), backups and firmware upgrades
🔐 Secure accessHTTP bearer auth, bcrypt token hashes, RBAC, router/tool restrictions, confirmation tokens
🧪 DiagnosticsRouter-originated ping, traceroute, torch, log filtering, guarded SSH command execution
🛡️ Change safetyDry-run, idempotent writes, snapshots, write journal, plan_changes, apply_plan, rollback_change
⚙️ Production behaviorRetries for read tools, per-router circuit breakers, correlation IDs, structured logs, audit logs
🤖 AI-agent fitHuman-readable responses plus structured JSON content for reasoning, chaining, and automation; server advertises an instructions string on MCP initialize so clients self-configure; optional routerId resolved via MIKROMCP_DEFAULT_ROUTER for single-router setups; usage skill for safe, guided tool use in Claude Code
🧩 MCP compatibilitystdio for desktop clients, Streamable HTTP and legacy SSE for remote or service-style clients

133 typed tools in total — browse the full catalog with parameters, defaults, and copy-paste example prompts in Available Tools.


Demo

Usage

[圖片]

Review by Claude

[Claude Reviewed Router Configuration]


Real-World Usage Examples

Router Inspection

text
Use MikroMCP to inspect core-01. Summarize system resources, RouterOS version,running interfaces, active routes, DNS settings, and recent warning/error logs.Flag anything that looks operationally risky.

Firewall Management

text
List firewall filter and NAT rules on edge-01. Identify disabled rules,overlapping port forwards, broad accept rules, and anything without comments.Do not change anything yet.

Safe Static Route Change

text
Dry-run a route on core-01 for 10.20.0.0/16 via 192.168.88.1 in the main table.Show the exact planned diff and tell me whether an existing route conflicts.

WireGuard Operations

text
Show WireGuard peers on branch-02. Sort by last handshake age and flag peersthat have not handshaken recently or have no transfer counters.

Interface Diagnostics

text
Check interface health on edge-01, then run ping and traceroute from the routerto 1.1.1.1. If packet loss is present, use torch on the WAN interface for ashort traffic snapshot.

Plan / Apply / Rollback Workflow

text
Create a change plan that adds a DNS record and a firewall address-list entryon edge-01. Use dry-run first, explain the plan, then wait for approval beforeapplying anything.

Why MikroMCP Is Useful For AI Agents

MCP gives LLMs a standard way to call tools. MikroMCP makes RouterOS a high-quality MCP target by turning network operations into well-described, machine-readable, permission-aware actions.

AI assistants can use MikroMCP to:

  • Investigate router state without memorizing RouterOS command syntax.
  • Chain tool calls across interfaces, routes, firewall rules, logs, and diagnostics.
  • Return both operator-friendly summaries and structured JSON for follow-up reasoning.
  • Preview changes before mutation and explain exactly what would happen.
  • Respect tool-level authorization, router scoping, maintenance windows, and confirmation gates.

FAQ

What is MikroMCP?

MikroMCP is an open-source Model Context Protocol (MCP) server that exposes MikroTik RouterOS as 133 typed, auditable tools — letting AI assistants inspect, diagnose, and safely operate routers in natural language instead of improvising CLI commands.

MikroMCP vs RouterOS API

The RouterOS REST/API exposes raw endpoints. MikroMCP wraps them in schema-validated, idempotent, dry-run-able tools with RBAC, audit logging, snapshots, and rollback — the safety layer an LLM needs before it touches production gear.

MikroMCP vs SSH automation

Instead of brittle SSH scripts that screen-scrape CLI output, MikroMCP returns structured, typed results with confirmation gates and per-router circuit breakers. SSH is used only where REST can't reach — ping and guarded run_command.

MikroMCP for Claude Code

MikroMCP speaks MCP over stdio and HTTP/SSE, so Claude Code and Claude Desktop drive RouterOS directly. Pair it with the bundled usage skill for safe, guided workflows.

MikroMCP for Codex

Codex connects to MikroMCP over the standard MCP protocol — see Connecting to AI Assistants.

MikroMCP for Cursor

Cursor connects to MikroMCP as an MCP server (stdio or HTTP) to inspect and manage MikroTik routers without leaving the editor.

MikroMCP for OpenClaw

Any MCP-compatible client — OpenClaw included — can use MikroMCP; configure it as a stdio or HTTP MCP server.

RouterOS AI Automation Guide

Start with Getting Started to install and connect, then use the usage skill and Available Tools to automate RouterOS safely with an AI assistant.

Best MCP Servers for Network Engineers

MikroMCP is purpose-built for MikroTik/RouterOS operations with production-grade safety — dry-run, rollback, audit, and RBAC — making it a strong MCP choice for network engineers adopting AI tooling.


Documentation

The README stays intentionally short. Everything below is documented in depth in the wiki:

ResourceUse it for
Getting StartedInstall (npm, binary, Docker), configure, and connect in 15 minutes
RouterOS API SetupEnable the REST API, create a user, TLS and firewall
ConfigurationRouter registry, credentials, all environment variables
RunningRun commands, HTTP/SSE transport, troubleshooting
Connecting to Claude DesktopRegister MikroMCP in Claude Desktop
Connecting to AI AssistantsClaude Code, Cursor, Codex, HTTP/Docker/systemd
Using the SkillInstall the MikroMCP usage skill so your assistant drives the tools safely
Available ToolsAll 133 tools — parameters and example prompts
ArchitectureSystem layers, request pipeline, auth model
Error HandlingError categories, retry engine, circuit breaker
SecurityThreat model, hardening checklist, vulnerability reporting
DevelopmentProject structure, tests, MCP Inspector workflow
ContributingAdding tools, coding conventions, PR checklist
Roadmap · ROADMAP.mdShipped milestones and guiding principles

Contributing

Issues, bug reports, tool requests, documentation improvements, and pull requests are welcome.

Good first contributions:

  • Add a read-only tool for an uncovered RouterOS surface.
  • Add screenshots, demo GIFs, or topology diagrams.
  • Expand tests around RouterOS response normalization and idempotency edge cases.
  • Help validate RouterOS version compatibility across real MikroTik devices and CHR.

Development standards:

  • TypeScript strict mode, ESM imports with .js extensions
  • Zod schemas with .strict(), idempotency and dryRun for write tools
  • MikroMCPError for domain errors, focused Vitest coverage for every tool

Please open an issue before large changes so maintainers can align on scope.

Acknowledgements

  • @f0086 — SwOS / SwOS Lite switch support (v1.9.0), which took MikroMCP beyond RouterOS for the first time.
  • @karamble — full SwOS support (v1.14.0): the full-SwOS dialect, whole-switch config apply, backups, firmware upgrades, password changes and switch-bound secrets.

Security

MikroMCP controls real network devices — treat it like an operations system: least-privilege RouterOS users, verified TLS (or pinned fingerprints), credentials only in ~/.mikromcp/.env, scoped RBAC identities, and audit logging for shared use. The full hardening checklist and vulnerability-reporting process are on the Security page.


Community And Support

  • ⭐ Star the repository if MikroMCP helps your MikroTik or MCP workflow.
  • 🍴 Fork it to add RouterOS surfaces your network depends on.
  • 🧵 Open an issue for bugs, feature requests, compatibility notes, or documentation gaps.

License

MikroMCP is released under the MIT License.

來源:README.md,提交 0cbc074

工具

133

get_system_status

Get System Status

Retrieve system status information from a MikroTik router including resource usage, identity, license, routerboard details, health sensors, and clock.

輸入參數routerIdsections

list_interfaces

List Interfaces

List network interfaces on a MikroTik router with optional filtering by type and status. Supports pagination and optional traffic counters.

輸入參數typelimitoffsetstatusrouterIdmacAddressincludeCounters

list_ip_addresses

List IP Addresses

List IPv4 addresses assigned to interfaces on a MikroTik router, including dynamic ones (DHCP client, PPP). Supports filtering by interface and disabled state, with pagination.

輸入參數limitoffsetdisabledrouterIdinterface

manage_ip_address

Manage IP Address

Add, update, or remove an IP address on a MikroTik router interface. Performs idempotency checks for add operations and supports dry-run mode for all actions.

輸入參數action必填dryRunaddress必填commentnetworkdisabledrouterIdinterface必填confirmationToken

list_dhcp_leases

List DHCP Leases

List DHCP leases on a MikroTik router with optional filtering by server, status, lease type (dynamic/static), and MAC address. Supports pagination.

輸入參數limitoffsetserverstatusrouterIdleaseTypemacAddress

manage_dhcp_lease

Manage DHCP Lease

Convert a dynamic DHCP lease to static (make-static) or remove a lease. Idempotent by MAC address.

輸入參數action必填dryRunrouterIdmacAddress必填confirmationToken

list_routes

List Static Routes

List static routes on a MikroTik router with optional filtering by active status and dynamic status. Supports pagination.

輸入參數limitoffsetrouterIdactiveOnlystaticOnly

manage_route

Manage Static Route

Add or remove a static route on a MikroTik router. Performs idempotency checks for add operations and supports dry-run mode for all actions.

輸入參數action必填dryRuncommentgateway必填disableddistancerouterIddstAddress必填routingTableconfirmationToken

list_firewall_rules

List Firewall Rules

List firewall rules from the filter or nat table on a MikroTik router. Supports filtering by chain and disabled state, with pagination.

輸入參數chainlimittableoffsetdisabledrouterId

manage_firewall_rule

Manage Firewall Rule

Add, remove, disable, or enable a firewall rule on a MikroTik router. Matches addresses, ports, protocol, interfaces, interface lists, and connection/NAT state; nat rules take toAddresses/toPorts (e.g. a dst-nat port forward). Uses comment as idempotency key for deduplication and identification: a repeated add returns already_exists only when the match, NAT targets, and disabled state agree, otherwise CONFLICT (use enable/disable when only the disabled state differs). Supports dry-run mode.

輸入參數chain必填tableaction必填dryRuncommentdstPortsrcPorttoPortsdisabledprotocolrouterIddstAddress另有 11 個

ping

Ping

Send ICMP echo requests from the router to a target address. Returns per-packet RTT and summary statistics. 100% packet loss is a valid result, not an error.

輸入參數sizecountaddress必填routerIdroutingTable

traceroute

Traceroute

Trace the network path from the router to a target address. Returns an ordered hop list with RTT per hop. Timeouts and partial results are valid responses. Not auto-retried.

輸入參數countaddress必填maxHopsrouterId

torch

Torch

Capture a real-time traffic snapshot on a router interface. RouterOS runs the capture for `duration` seconds; the tool returns the flows of the final update with their TX/RX rates in bits per second and packets per second. Not auto-retried.

輸入參數durationrouterIdinterface必填dstAddresssrcAddress

get_log

Get Log

Read and filter the system log from a MikroTik router. Supports filtering by topic, message prefix, and a time window (last N minutes) measured against the router's own clock. Entries with unparseable timestamps are included conservatively.

輸入參數limitoffsetprefixtopicsrouterIdsinceMinutes

get_system_clock

Get System Clock

Read the current date, time, and timezone from a MikroTik router. Focused single-purpose alternative to the clock section in get_system_status.

輸入參數routerId

set_system_clock

Set System Clock

Set the system date, time, and/or timezone on a MikroTik router. Idempotent: returns already_set if the values already match. Supports dry-run.

輸入參數datetimedryRunrouterIdtimeZoneNameconfirmationToken

reboot

Reboot

Trigger a controlled router reboot with an optional delay. delay=0 reboots immediately; delay>0 adds a one-shot "mikromcp-reboot" scheduler entry on the router (calling again replaces it; remove it to cancel). Supports dry-run. Use this tool instead of run_command for reboots — run_command's deny list blocks /system reboot*.

輸入參數delaydryRunrouterIdconfirmationToken

run_command

Run Command

Execute an arbitrary RouterOS console command via SSH. Guarded by an allow/deny policy (built-in deny list blocks destructive commands; tighten via cmdAllow in routers.yaml or MIKROMCP_CMD_ALLOW). Prefer dedicated tools (reboot, etc.) where available. Output capped at 4000 characters. Journaled for audit like every write (see list_journal), but never snapshotted: arbitrary commands touch unknown config sections, so it cannot be rolled back via rollback_change — prefer a dedicated tool when one exists, and note the manual undo command in your own records.

輸入參數dryRuncommand必填routerIdconfirmationToken

list_bridges

List Bridges

List bridge interfaces and their port members on a MikroTik router.

輸入參數limitoffsetrouterId

manage_bridge

Manage Bridge Interface

Create or remove a bridge interface on a MikroTik router. Idempotent: create returns already_exists if bridge with same name exists.

輸入參數name必填action必填dryRuncommentdisabledrouterIdconfirmationToken

manage_bridge_port

Manage Bridge Port

Add or remove an interface from a bridge on a MikroTik router. Idempotent: add returns already_exists if the port assignment already exists.

輸入參數action必填bridge必填dryRunrouterIdinterface必填confirmationToken

list_bridge_ports

List Bridge Ports

List bridge port entries (interface membership, PVID, STP role and status) on a MikroTik router. Supports filtering by bridge and interface, with pagination.

輸入參數limitbridgeoffsetrouterIdinterface

list_wifi_interfaces

List WiFi Interfaces

List WiFi/wireless interfaces on a MikroTik router. Uses /interface/wifi on ROS 7.x, /interface/wireless on older versions.

輸入參數limitoffsetrouterId

list_wifi_clients

List WiFi Clients

List currently connected WiFi clients (stations) with signal strength and transfer rates.

輸入參數limitoffsetrouterIdinterface

manage_wifi_interface

Manage WiFi Interface

Enable, disable, or update SSID settings on a WiFi interface. At least one of disabled or ssid must be provided.

輸入參數name必填ssiddryRundisabledrouterIdconfirmationToken

list_wireguard_interfaces

List WireGuard Interfaces

List WireGuard interfaces and their status on a MikroTik router.

輸入參數limitoffsetrouterId

list_wireguard_peers

List WireGuard Peers

List WireGuard peers with last handshake time and transfer statistics.

輸入參數limitoffsetrouterIdinterface

manage_wireguard_peer

Manage WireGuard Peer

Add or remove a WireGuard peer. Add returns already_exists when the public key and explicitly requested endpoint/allowed addresses match; different settings produce CONFLICT without changing the peer. Omitted settings are left unchanged.

輸入參數action必填dryRuncommentendpointrouterIdinterface必填publicKey必填allowedAddressconfirmationToken

manage_wireguard_interface

Manage WireGuard Interface

Add, remove, enable, or disable a WireGuard interface. Idempotent by name. RouterOS generates the private key on create — it is never passed in. The public key is returned after creation.

輸入參數mtuname必填action必填dryRuncommentrouterIdlistenPortconfirmationToken

list_dns_entries

List DNS Entries

List static DNS entries on a MikroTik router with optional filtering by name and type.

輸入參數nametypelimitoffsetrouterId

manage_dns_entry

Manage DNS Entry

Add or remove a static DNS entry, found by name (case-insensitive) and type. add returns already_exists if such a record already has the requested value and disabled state (and ttl/comment, when given), and throws CONFLICT if it differs; add never creates a second record with the same name and type. remove deletes the one matching record; when several share the name (round-robin), pass address/cname/text to pick one.

輸入參數ttlname必填texttypecnameaction必填dryRunaddresscommentdisabledrouterIdconfirmationToken

get_dns_settings

Get DNS Settings

Read DNS resolver configuration: upstream servers, cache size, cache TTL, and whether remote DNS requests are allowed.

輸入參數routerId

manage_dns_settings

Manage DNS Settings

Update DNS resolver settings (upstream servers, cache size, cache TTL, allow-remote-requests). Idempotent: returns no_change if nothing differs.

輸入參數dryRunserversrouterIdcacheSizecacheMaxTtlmaxUdpPacketSizeconfirmationTokenallowRemoteRequests

list_mangle_rules

List Mangle Rules

List firewall mangle rules on a MikroTik router in evaluation order. Supports filtering by chain, action, and disabled state.

輸入參數chainactiondisabledrouterId

manage_mangle_rule

Manage Mangle Rule

Add, remove, enable, or disable a firewall mangle rule. ruleAction sets the action; when it is omitted, a new* value implies its own (newRoutingMark → mark-routing), otherwise accept. Each new* value is accepted only under its action. Uses comment as idempotency key: a repeated add returns already_exists only when the chain, match fields, marks, DSCP, MSS, passthrough, and the given or implied action agree, otherwise CONFLICT. Supports dry-run mode.

輸入參數chainaction必填dryRunnewMsscomment必填dstPortsrcPortprotocolrouterIdtcpFlagsdstAddressruleAction另有 11 個

list_address_list_entries

List Address List Entries

List firewall address list entries on a MikroTik router. Supports filtering by list name and address.

輸入參數listaddressrouterId

manage_address_list_entry

Manage Address List Entry

Add or remove a firewall address list entry. Idempotent by list name + address. Supports dry-run mode.

輸入參數list必填action必填dryRunaddress必填commenttimeoutrouterIdconfirmationToken

list_routing_rules

List Routing Rules

List policy routing rules on a MikroTik router in evaluation order. Supports filtering by table and disabled state.

輸入參數tabledisabledrouterId

manage_routing_rule

Manage Routing Rule

Add, remove, enable, or disable a policy routing rule. Idempotent by srcAddress+dstAddress+interface+table composite key; a repeated add with an explicit, different ruleAction is a CONFLICT. Supports dry-run mode.

輸入參數table必填action必填dryRunpriorityrouterIdinterfacedstAddressruleActionsrcAddressconfirmationToken

list_routing_tables

List Routing Tables

List custom routing tables on a MikroTik router.

輸入參數routerId

manage_routing_table

Manage Routing Table

Create or remove a custom routing table. Idempotent by table name. Supports dry-run mode.

輸入參數fibname必填action必填dryRunrouterIdconfirmationToken

list_bgp_peers

List BGP Peers

List BGP sessions on a MikroTik router (RouterOS 7+). Returns state, remote AS, prefix counts, and uptime.

輸入參數staterouterId

list_ospf_neighbors

List OSPF Neighbors

List OSPF neighbors on a MikroTik router (RouterOS 7+). Returns neighbor state, interface, DR/BDR, and uptime.

輸入參數staterouterId

list_scripts

List Scripts

List RouterOS scripts on a MikroTik router. Supports optional name filter.

輸入參數namerouterId

manage_script

Manage Script

Add, update, or remove a RouterOS script. Idempotent by name. add throws CONFLICT if the name already exists; update throws NOT_FOUND if it does not. Supports dry-run.

輸入參數name必填action必填dryRunsourcecommentrouterIdconfirmationTokendontRequirePermissions

run_script

Run Script

Execute a named RouterOS script. Fire-and-forget — the script runs asynchronously and its output is written to the router system log. Use get_log after calling this tool to see results.

輸入參數name必填routerIdconfirmationToken

list_scheduled_jobs

List Scheduled Jobs

List RouterOS scheduler entries on a MikroTik router with next-run time, interval, and disabled state.

輸入參數namerouterId

manage_scheduled_job

Manage Scheduled Job

Add, update, remove, enable, or disable a RouterOS scheduler entry. onEvent is arbitrary RouterOS script run with the router user's policies, so this tool is destructive. Idempotent by name. add throws CONFLICT if name exists; update throws NOT_FOUND if it does not. Supports dry-run.

輸入參數name必填action必填dryRuncommentonEventintervalrouterIdstartDatestartTimeconfirmationToken

list_packages

List Packages

List installed RouterOS packages with version and enabled status.

輸入參數namerouterId

manage_package

Manage Package

Enable or disable a RouterOS package. Changes take effect only after a router reboot — use the reboot tool to apply. Idempotent: no-op if already in the target state.

輸入參數name必填action必填dryRunrouterIdconfirmationToken

list_files

List Files

List files on a MikroTik router filesystem. Supports filtering by name and type.

輸入參數nametyperouterId

get_file_content

Get File Content

Read a text file's contents from a MikroTik router. Only suitable for text files — binary files will return garbled content.

輸入參數name必填routerId

upload_file

Upload File

Upload a text file to a router, overwriting any existing file of the same name. Prefers SFTP (encrypted, over SSH) and falls back to plaintext FTP if SFTP is unavailable. Requires SSH (or FTP) access for the router user. RouterOS runs a file named *.auto.rsc as a script when it arrives over FTP. Dry-run tests connectivity only.

輸入參數name必填dryRuncontent必填routerIdconfirmationToken

delete_file

Delete File

Delete a file from the router filesystem by name. Idempotent: returns not_found gracefully if the file does not exist.

輸入參數name必填dryRunrouterIdconfirmationToken

list_containers

List Containers

List RouterOS container instances with status, image, and network information.

輸入參數routerId

manage_container

Manage Container

Create, start, stop, or remove a RouterOS container. create needs a pre-configured veth interface; start/stop are no-ops when already in the target state; remove throws NOT_FOUND when absent. Supports dry-run.

輸入參數name必填action必填dryRuncommentenvlistrootDirrouterIdinterfaceremoteImageconfirmationToken

list_ipsec_peers

List IPSec Peers

List IPSec peers on a MikroTik router.

輸入參數limitaddressrouterId

list_ipsec_policies

List IPSec Policies

List IPSec policies on a MikroTik router.

輸入參數limitrouterIddstAddresssrcAddress

manage_ipsec_peer

Manage IPSec Peer

Add, remove, enable, or disable an IPSec peer. Idempotent by name: add returns already_exists if a peer with the same name and address already exists.

輸入參數name必填action必填dryRunaddresscommentprofileexchangerouterIdlocalAddressconfirmationToken

manage_ipsec_policy

Manage IPSec Policy

Add, remove, enable, or disable an IPSec policy. Idempotent by composite key (srcAddress + dstAddress + tunnel).

輸入參數levelaction必填dryRuntunnelrouterIddstAddress必填srcAddress必填ipsecActionsaDstAddresssaSourceAddressconfirmationToken

list_certificates

List Certificates

List certificates on a MikroTik router.

輸入參數namelimitexpiredrouterId

manage_certificate

Manage Certificate

Remove, trust, or untrust a certificate. Idempotent: trust/untrust return early if already in the target state.

輸入參數name必填action必填dryRunrouterIdconfirmationToken

list_users

List Users

List local users on a MikroTik router. Passwords are never returned.

輸入參數grouplimitrouterId

manage_user

Manage User

Add, remove, enable, disable, or set the password for a local RouterOS user. Idempotent by name: add returns already_exists if a user with the same name and group already exists.

輸入參數name必填groupaction必填dryRunaddresscommentpasswordrouterIdconfirmationToken

list_user_groups

List User Groups

List local user groups on a MikroTik router.

輸入參數limitrouterId

manage_user_group

Manage User Group

Add, update, or remove a local RouterOS user group. Idempotent by name: add returns already_exists if a group with the same name and policy already exists.

輸入參數name必填skinaction必填dryRunpolicyrouterIdconfirmationToken

list_dhcp_servers

List DHCP Servers

List DHCP servers on a MikroTik router.

輸入參數limitoffsetrouterIdinterface

manage_dhcp_server

Manage DHCP Server

Add, remove, enable, or disable a DHCP server. Idempotent by name: add returns already_exists if a server with the same name, interface, and address pool already exists.

輸入參數name必填action必填dryRuncommentrouterIdinterfaceleaseTimeaddressPoolconfirmationToken

list_ip_pools

List IP Pools

List IP address pools on a MikroTik router. Supports filtering by name and pagination.

輸入參數namelimitoffsetrouterId

manage_ip_pool

Manage IP Pool

Add or remove an IP address pool. Idempotent by name: add returns already_exists if a pool with the same name and ranges already exists.

輸入參數name必填action必填dryRunrangesnextPoolrouterIdconfirmationToken

list_queues

List Queues

List simple queues on a MikroTik router.

輸入參數limittargetrouterId

manage_queue

Manage Queue

Add, remove, enable, or disable a simple queue. Idempotent by name: add returns already_exists if a queue with the same name and target already exists.

輸入參數name必填action必填dryRuntargetcommentlimitAtmaxLimitrouterIdconfirmationToken

list_vrrp_instances

List VRRP Instances

List VRRP instances on a MikroTik router.

輸入參數limitrouterIdinterface

manage_vrrp_instance

Manage VRRP Instance

Add, remove, enable, or disable a VRRP instance. Idempotent by name: add returns already_exists if an instance with the same name, interface, and VRID already exists.

輸入參數name必填vridaction必填dryRuncommentversionintervalpriorityrouterIdinterfaceconfirmationToken

get_snmp_settings

Get SNMP Settings

Retrieve SNMP settings from a MikroTik router.

輸入參數routerId

get_ntp_settings

Get NTP Settings

Retrieve NTP client settings from a MikroTik router.

輸入參數routerId

list_netwatch_entries

List Netwatch Entries

List Netwatch monitoring entries on a MikroTik router.

輸入參數hostlimitstatusrouterId

manage_netwatch_entry

Manage Netwatch Entry

Add, remove, enable, or disable a Netwatch monitoring entry. Idempotent by host+port: add returns already_exists if an entry with the same host and port already exists.

輸入參數host必填portaction必填dryRuncommenttimeoutintervalrouterIdconfirmationToken

list_neighbors

List Neighbors

List discovered neighbors (CDP/LLDP/MNDP) on a MikroTik router.

輸入參數limitrouterIdinterface

list_arp_entries

List ARP Entries

List ARP table entries on a MikroTik router.

輸入參數limitaddressrouterIdinterfacemacAddress

manage_ntp_client

Manage NTP Client

Update NTP client settings on a MikroTik router. Idempotent: returns already_set if no changes are needed.

輸入參數modedryRunenabledserversrouterIdvlanInterfaceconfirmationToken

manage_vlan

Manage VLAN Interface

Add, remove, enable, or disable a VLAN interface. Idempotent by name: add returns already_exists when a VLAN with matching name, vlan-id, and parent interface exists. Supports dry-run mode.

輸入參數mtuname必填action必填dryRunvlanIdcommentdisabledrouterIdparentInterfaceconfirmationToken

list_dhcp_clients

List DHCP Clients

List DHCP client configurations on a MikroTik router. Shows which interfaces obtain their IP via DHCP, current status, and assigned address.

輸入參數limitoffsetstatusrouterIdinterface

manage_dhcp_client

Manage DHCP Client

Add, remove, enable, or disable a DHCP client on an interface. Idempotent by interface name: add returns already_exists if a DHCP client is already configured on the same interface.

輸入參數action必填dryRuncommentrouterIdinterface必填usePeerDnsusePeerNtpaddDefaultRouteconfirmationToken

list_ip_services

List IP Services

List IP services on a MikroTik router (api, api-ssl, ssh, telnet, www, www-ssl, winbox, ftp) with their port numbers and enabled/disabled status.

輸入參數nameenabledrouterId

manage_ip_service

Manage IP Service

Enable or disable a RouterOS IP service (api, api-ssl, ssh, telnet, www, www-ssl, winbox, ftp). Port number changes are intentionally not supported to prevent accidental lockout. MikroMCP reaches RouterOS through the REST API on www-ssl (or www for plaintext): disabling the service its connection uses cuts MikroMCP off from the router, including any later call to re-enable it.

輸入參數name必填action必填dryRunrouterIdconfirmationToken

list_pppoe_clients

List PPPoE Clients

List PPPoE client interfaces on a MikroTik router. Shows name, parent interface, ISP username, and connection status.

輸入參數limitoffsetstatusrouterIdinterface

manage_pppoe_client

Manage PPPoE Client

Add, update, or remove a PPPoE client interface. Idempotent by name (already_exists on matching name+interface+user; CONFLICT on differing config; no_change when an update differs in nothing). Password is always written when provided since RouterOS does not return it on GET.

輸入參數name必填useraction必填dryRunpasswordrouterIdinterfaceserviceNamedialOnDemandaddDefaultRouteconfirmationToken

list_ovpn_clients

List OpenVPN Clients

List OpenVPN client interfaces on a MikroTik router. Shows name, remote server, and connection status.

輸入參數limitoffsetrouterId

manage_ovpn_client

Manage OpenVPN Client

Add, update, or remove an OpenVPN client interface. Idempotent by name (already_exists on matching name+connectTo; CONFLICT on differing connectTo; no_change when an update differs in nothing). Password is always written when provided since RouterOS does not return it on GET.

輸入參數modename必填portuseraction必填dryRunpasswordprotocolrouterIdconnectTocertificateconfirmationToken

get_ovpn_server

Get OpenVPN Server

Get the OpenVPN server configuration on a MikroTik router. Throws NOT_FOUND if the OpenVPN package is not installed.

輸入參數routerId

manage_ovpn_server

Manage OpenVPN Server

Enable, disable, or configure the OpenVPN server (a per-router singleton). Throws NOT_FOUND if the OpenVPN package is not installed. The set action requires at least one configuration field.

輸入參數authmodeportaction必填cipherdryRunprotocolrouterIdcertificateconfirmationToken

list_ppp_profiles

List PPP Profiles

List PPP profiles including the built-in default and default-encryption profiles.

輸入參數namelimitrouterId

manage_ppp_profile

Manage PPP Profile

Add, update, or remove a PPP profile. Idempotent by name. update returns no_change when requested values match. Built-in profiles (default, default-encryption) cannot be removed — RouterOS blocks this and the error is surfaced.

輸入參數name必填action必填dryRuncommentrouterIddnsServerrateLimitlocalAddressremoteAddresssessionTimeoutconfirmationToken

get_upgrade_status

Get Upgrade Status

Read the current RouterOS package upgrade status and routerboard firmware versions. Shows installed version, latest available version, update channel, and firmware upgrade availability.

輸入參數routerId

manage_upgrade

Manage Upgrade

Trigger a RouterOS package update check or install. 'check' queries the update server for new packages. 'install' downloads and applies the update — the router will reboot automatically. Supports dry-run.

輸入參數action必填dryRunrouterIdconfirmationToken

create_backup

Create Backup

Create a binary configuration backup on a MikroTik router. The backup is saved as <name>.backup on the router's filesystem. To encrypt it, prefer passwordSecret (a MIKROMCP_SECRET_<NAME> bound to the router in routers.yaml — the password never reaches the conversation) over a literal password. Dry run checks that the secret resolves.

輸入參數namedryRunpasswordrouterIdpasswordSecretconfirmationToken

export_config

Export Config

Export the router configuration as a RouterOS script. When no file is specified, returns the script text inline. When a file is specified, saves it as <file>.rsc on the router's filesystem. Supports compact mode to show only non-default values.

輸入參數filecompactrouterIdconfirmationToken

list_log_rules

List Log Rules

List RouterOS logging rules (system/logging) with optional topic substring and action exact-match filtering.

輸入參數limittopicsrouterIdlogAction

manage_log_rule

Manage Log Rule

Add, remove, enable, or disable a RouterOS logging rule. Idempotent by topics+logAction (add → already_exists on match; remove → not_found handled gracefully; enable/disable throw NOT_FOUND when absent). Supports dry-run.

輸入參數action必填dryRunprefixtopics必填routerIdlogAction必填confirmationToken

list_log_actions

List Log Actions

List RouterOS logging action targets (system/logging/action) with optional type filter.

輸入參數typelimitrouterId

manage_log_action

Manage Log Action

Add or remove a RouterOS logging action target. Idempotent by name. add throws VALIDATION if type is missing; returns already_exists if name found. remove returns not_found gracefully. Supports dry-run.

輸入參數name必填typeaction必填dryRunremoterouterIdremotePortdiskFileNameconfirmationToken

bandwidth_test

Bandwidth Test

Run a RouterOS bandwidth test from the router to a remote host running a RouterOS btest server. Returns TX and RX throughput in Mbps. Duration capped at 20 seconds. Saturates the link — not auto-retried.

輸入參數address必填durationprotocolrouterIddirection

fetch_url

Fetch URL

Send an HTTP/HTTPS request from the router using /tool/fetch. Response body is returned inline (capped at 64 KB with [TRUNCATED] marker). Use outputFile to save to router filesystem instead. Not read-only: POSTs have side effects and outputFile writes to the router.

輸入參數url必填methodhttpDatarouterIdoutputFileconfirmationToken

list_connections

List Connections

List active connection tracking entries from the router firewall table. Filters are applied client-side. Useful for diagnosing NAT and firewall behavior.

輸入參數limitprotocolrouterIddstAddresssrcAddress

get_container_config

Get Container Config

Read global container configuration: registry URL, RAM high-water mark, and veth interface.

輸入參數routerId

manage_container_config

Manage Container Config

Update global container settings. Idempotent: returns no_change if nothing differs.

輸入參數dryRunrouterIdramHighMbregistryUrlvethInterfaceconfirmationToken

list_container_envs

List Container Envs

List container environment variable entries, optionally filtered by container name.

輸入參數namelimitrouterId

manage_container_env

Manage Container Env

Add or remove a container environment variable. Idempotent by name+key. add returns already_exists if the entry exists with the same value; throws CONFLICT if the value differs.

輸入參數key必填name必填valueaction必填dryRunrouterIdconfirmationToken

list_container_mounts

List Container Mounts

List container volume mount definitions with source path, destination path, and mount name.

輸入參數namelimitrouterId

manage_container_mount

Manage Container Mount

Add or remove a container volume mount. Idempotent by name: add returns already_exists if the mount exists with matching src/dst; throws CONFLICT if name exists with different paths.

輸入參數dstsrcname必填action必填dryRunrouterIdconfirmationToken

list_interface_lists

List Interface Lists

List all interface lists defined on the router.

輸入參數limitrouterId

manage_interface_list

Manage Interface List

Add or remove an interface list. Idempotent by name. Removing a list that has members is blocked by RouterOS — the error is surfaced as-is.

輸入參數name必填action必填dryRuncommentrouterIdconfirmationToken

manage_interface_list_member

Manage Interface List Member

Add or remove an interface from an interface list. Idempotent by list+interface composite key. add returns already_exists if the membership exists. remove returns not_found gracefully.

輸入參數list必填action必填dryRuncommentrouterIdinterface必填confirmationToken

list_interface_list_members

List Interface List Members

List interface list memberships (which interface belongs to which list, e.g. WAN/LAN) on a MikroTik router. Supports filtering by list and interface, with pagination.

輸入參數listlimitoffsetrouterIdinterface

list_swos_endpoints

List SwOS Endpoints

List the SwOS/SwOS Lite '.b' API endpoints supported by this server, with the decoded field names per endpoint. Read-only schema introspection — no device call.

輸入參數routerId

get_swos_status

Get SwOS Status

Retrieve status from a MikroTik SwOS switch (SwOS or SwOS Lite): identity, model, firmware, uptime, per-port link state/speed/duplex, PoE mode/state/power, and SFP modules.

輸入參數includerouterId

get_swos_endpoint

Get SwOS Endpoint

Fetch and decode a single SwOS '.b' endpoint (link.b, sys.b, poe.b, lacp.b, rstp.b, snmp.b, fwd.b, vlan.b, stats.b, sfp.b, host.b, acl.b, ...) as structured data. Unknown keys are preserved under '_raw'.

輸入參數endpoint必填routerId

write_swos_blob

Write SwOS Blob

Mutate a SwOS '.b' endpoint on a MikroTik switch. The full endpoint blob is read, the given fields are merged in, and the entire blob is written back (the firmware only accepts whole-blob writes); untouched fields are re-sent byte-for-byte, and a field this firmware does not expose is refused rather than injected. dryRun defaults to true — preview first. Every result reports whether the schema has been verified against the switch's firmware. The pre-write blob is snapshotted, so the change can be undone with rollback_change. Returns no_change when the values already match.

輸入參數dryRunfields必填endpoint必填routerIdconfirmationToken

get_swos_config

Get SwOS Config

Export a SwOS switch's configuration as one YAML document: system settings (including management access), every port's name, enabled state and VLAN settings, the VLAN table (full SwOS) and SNMP. The SNMP community is never exported. The document is the input format of apply_swos_config, so it doubles as a backup you can read and diff.

輸入參數routerId

apply_swos_config

Apply SwOS Config

Apply a switch config document (the format get_swos_config exports) to a SwOS switch. Plans every change against the switch first; dryRun defaults to true. Writes only the endpoints that change: the VLAN table grows first (new VLANs and members), then the per-port settings (VLAN, isolation, storm and flood control), port names/negotiation/enabled, LAG and SNMP, then the table shrinks (removed VLANs and members), then system — so no port loses its VLAN mid-apply. Refuses management changes (address, allow-from) unless includeManagement is true, and any plan that would cut a linked port off (its untagged VLAN moved or dropped, a trunk losing tagged VLANs or becoming an access port, a forced VLAN, a port that starts filtering VLANs, the port disabled, renegotiating, isolated from another linked port or moved in or out of a LAG, every linked port dropped from allow_from_ports; only risks the plan introduces) unless acceptLockoutRisk is true. All six endpoints are snapshotted before a real apply, so rollback_change restores the previous state; the result names any endpoint whose snapshot failed, and says so when none was recorded. A document that moves management to another VLAN (allow_from_vlan) and changes a port's VLAN settings or the VLAN table's membership at the same time is refused, because that cannot be written in a safe order (sys.b goes last and cuts the session): apply the VLAN changes first, then the move. `snmp.community` may reference only the secrets bound to the switch (its `secrets` list in routers.yaml); a switch without a list may reference none.

輸入參數config必填dryRunrouterIdpruneVlansacceptLockoutRiskconfirmationTokenincludeManagement

save_swos_backup

Save SwOS Backup

Download the switch's own configuration backup (backup.swb, the file the web UI's Save Backup produces) into the server's SwOS folder. The file is MikroTik's opaque format: it restores only through restore_swos_backup or the web UI, on the same model. A switch on factory defaults has nothing to save. Writes a file on the server (owner-only), so it is audited like a write.

輸入參數routerId

restore_swos_backup

Restore SwOS Backup

Restore a backup.swb file from the server's SwOS folder onto the switch, as the web UI's Restore Backup does. The switch replaces its whole configuration and reboots, so it is unreachable for a while, and its address may change to the one in the backup. By default the current configuration is saved first. dryRun defaults to true.

輸入參數file必填forcedryRunrouterIdsaveCurrentFirstconfirmationToken

upgrade_swos_firmware

Upgrade SwOS Firmware

Upgrade a SwOS switch's firmware the way the web UI's Upgrade tab does. Resolves the latest stable version for the model from MikroTik's download server (or takes `version`), downloads swos-<board>-<version>.bin over HTTPS into the server's SwOS folder (or uses `file`), checks it, then flashes it; the switch reboots. Refuses release candidates unless allowPrerelease is true. A switch still on its preinstalled backup firmware (a version ending in 'p', which cannot save configuration) counts as needing the upgrade. dryRun defaults to true.

輸入參數fileboardforcedryRunversionrouterIdallowPrereleaseconfirmationToken

set_swos_password

Set SwOS Password

Change a SwOS switch's admin password, as the web UI's Password Change does. The new password comes from the server secret MIKROMCP_PASSWORD_<newPasswordSecret>, never from the conversation; the current one is the router's configured credential. Passwords are ASCII, at most 15 characters. After the change this call's client keeps working with the new password, but the server rebuilds the client from the router's configured credential ({PREFIX}_PASS) after any authentication failure or restart, so that variable must be updated right away. On SwOS Lite the switch does not answer the change; the result is confirmed by logging in with the new password. dryRun defaults to true.

輸入參數dryRunrouterIdconfirmationTokennewPasswordSecret必填

plan_changes

Plan Changes

Preview a sequence of write operations: each step runs with dryRun=true against live state, returning affected paths and the predicted action per step. Use apply_plan to execute the same steps for real.

輸入參數steps必填routerId

apply_plan

Apply Plan

Execute write operations in order, stopping on first failure. Each step is snapshotted and journaled individually. Non-admin identities need a confirmationToken (same two-step flow as other destructive tools). Undo individual steps via rollback_change with the returned journal IDs.

輸入參數steps必填routerIdconfirmationToken

rollback_change

Rollback Change

Restore device state to before a write, identified by its journal ID. RouterOS: reads the before-snapshot, diffs against live state, and applies the reverse. SwOS: re-POSTs the exact pre-write '.b' blob. Use dryRun=true to preview. Requires MIKROMCP_DATA_DIR (defaults to data/).

輸入參數dryRunrouterIdjournalId必填confirmationToken

list_journal

List Write Journal

List recent entries from the server's write journal (write-journal.ndjson): every journaled write with its journalId, timestamp, tool, router, parameters (as redacted at write time), snapshot ids and outcome — newest first. Read-only. Use it to recover a lost journalId for rollback_change, or to audit what was written when. Only entries with rollbackable: true can be rolled back — dry runs and writes without snapshots (run_command, plan_changes) cannot.

輸入參數toollimitrouterId

check_router_health

Check Router Health

Probe a device: RouterOS routers via system/resource, SwOS switches via sys.b. Returns health status, firmware version, uptime, and (RouterOS only) CPU load and memory info. Unlike other tools, this never throws — unreachable devices are reported as healthy=false.

輸入參數routerId

bulk_execute

Bulk Execute

Fan out a single-router tool to many routers in parallel (up to `concurrency`), targeted by routerIds or tag. Write tools need two-step confirmation for every role: call without `confirmationToken` to get a fleet token, then re-call with it. Read-only tools fan out immediately. Writes snapshot+journal each router for rollback. Returns per-router results with succeeded/failed counts. To fan out a read-only tool, prefer bulk_read.

輸入參數tagsparams必填toolName必填routerIdsconcurrencyconfirmationToken

bulk_read

Bulk Read

Fan out a read-only single-router tool (list_*, get_* and others annotated read-only) to many routers in parallel (up to `concurrency`), targeted by routerIds or tag. Unlike bulk_execute, the server refuses every write tool and the traffic-generating diagnostics (ping, traceroute, torch, bandwidth_test) with BULK_READ_TOOL_NOT_READ_ONLY, and never needs a confirmation token, snapshot or journal — so an MCP client can allow bulk_read without allowing fleet-wide writes. Use bulk_execute for anything else. Returns per-router results with succeeded/failed counts.

輸入參數tagsparams必填toolName必填routerIdsconcurrency

list_routers

List Routers

List the routers configured in the registry (routers.yaml): id, host, port, TLS status, tags, ROS version, and which is the default. Read-only reflection of local config — no RouterOS API call, no credentials in the response. rosVersion is what routers.yaml states and may lag a router upgrade — ask get_system_status for the live version. Use it to discover valid routerId values and tags for targeting other tools (including bulk_read and bulk_execute).

輸入參數tags

版本歷史

10
  1. v1.16.1最新Nov 4, 2026
  2. v1.16.0Oct 25, 2026
  3. v1.15.0Oct 24, 2026
  4. v1.14.1Oct 17, 2026
  5. v1.14.0Oct 15, 2026
  6. v1.13.2Oct 14, 2026
  7. v1.13.1Oct 6, 2026
  8. v1.13.0Oct 6, 2026
  9. v1.12.0Oct 6, 2026
  10. v1.11.0Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分