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 分