API reference
Every tool the server exposes, grouped into 19 categories (170+ tools total). Each entry shows the name, what it does, its parameters (required vs optional), and a canonical example.
Naming convention. Most tools are prefixed with mikrotik_ followed by a
verb — create, list, get, update,
remove, plus category-specific verbs. Six categories are exceptions:
Inventory, Interfaces, PoE, IPv6 Address, Queues, and Safe Mode tools are called
without the prefix (e.g. list_interfaces, create_simple_queue,
enable_safe_mode). The category headers below flag which convention applies. With a multi-device
inventory configured, every device-scoped tool also accepts an optional
device argument naming the inventory title to target.
Categories
Inventory — Multiple Devices
Manage a whole fleet from one server. Devices are declared in a
YAML inventory; each entry has a unique title, and every
device-scoped tool accepts an optional device argument naming the title to
target. With no inventory configured the server behaves exactly as before — a single device
built from MIKROTIK_HOST / MIKROTIK_USERNAME / …, and
device can be omitted everywhere.
mikrotik_ prefix on this category · read-only
Lists the devices this server manages — title, host, port, username, tags, and region. Credentials are never returned. Use it to discover the fleet before targeting a device.
The inventory is YAML, from one of two sources —
MIKROTIK_INVENTORY_FILE (path to a YAML file, recommended) or
MIKROTIK_INVENTORY (the inventory written inline; YAML flow syntax needs no
escaped quotes, and plain JSON works too since it's a YAML subset). When both are set,
the inline value wins. A broken inventory (missing file, bad YAML, invalid
entry) stops the server at startup with one clear message. A ready-to-copy template ships at
the repository root as inventory.example.yml.
device — matching is case-insensitive22, adminpassword when using a key[branch, eu], NL — great targets for "every device tagged office" promptsEvery device-scoped tool takes an optional device argument.
One device configured — omit it; that device is used automatically.
More than one — pass the title. Omitting it, or passing an
unknown title, returns an error that lists the valid titles, so an AI caller corrects
itself on the next call instead of quietly running the command on the wrong router.
/config as the mount point:
-v "$PWD/inventory.yaml:/config/inventory.yaml:ro" -e MIKROTIK_INVENTORY_FILE=/config/inventory.yaml.
Two traps the entrypoint catches with an explicit error: the container runs as
uid 1000, so the file must be readable by that uid
(chmod 644 is usually enough); and if the host file doesn't exist at start,
Docker silently creates a directory in its place — create the YAML first. The
entrypoint also accepts --inventory '<yaml>' / --inventory-file <path>.
When an inventory is configured it wins, and MIKROTIK_HOST /
MIKROTIK_USERNAME / MIKROTIK_PASSWORD / MIKROTIK_PORT
are ignored. See Installation.
enable_safe_mode(device="office-core") leaves
every other device untouched. The inventory is a secret — it holds fleet
credentials, so prefer key_filename, restrict file permissions, and remember
env values show in docker inspect. Validation errors never echo inventory
contents, so a typo can't leak a password into a log. For a local two-device lab,
routeros-docker/docker-compose.yml starts routeros-a (SSH
127.0.0.1:2222) and routeros-b (:2223).
Interfaces — All Interface Types
List and manage every interface on the device — ethernet, bridge,
WireGuard, PPPoE, VLAN, WiFi, SFP, LTE, loopback. The equivalent of
/interface print in RouterOS. For type-specific create/remove, use the dedicated
categories (VLAN, WireGuard, Wireless).
mikrotik_ prefix on this category
Lists all interfaces, with optional filtering by type, name, or running/disabled state.
ether, bridge, vlan, wg, pppoe-out, wifi, lte, loopback, …"ether" matches ether1, ether2 …Returns detailed information about a single interface by exact name.
"ether1", "bridge", "pppoe-out1", "wg0"Bring an interface up or take it down without removing it.
PoE — Power over Ethernet
Read-only monitoring of Power-over-Ethernet status and per-port
configuration on PoE-capable devices, under /interface ethernet poe. On hardware
without PoE-out ports (e.g. CHR / virtual routers) these tools report that no PoE data is
available.
mikrotik_ prefix on this category · read-only
Reads real-time PoE-out telemetry — status, voltage, current, and power — for
one or more ethernet interfaces. Runs /interface ethernet poe monitor … once.
Lists the PoE-out configuration (PoE-out mode, priority) of PoE-capable ethernet interfaces.
Runs /interface ethernet poe print.
"ether" matches ether1, ether2 …Gets the detailed PoE-out settings of a specific ethernet interface — mode, priority, voltage,
and low/high thresholds. Runs /interface ethernet poe print detail where name=….
"ether1"VLAN — Tagged Interfaces
Create, list, inspect, update, and remove tagged 802.1Q interfaces. Parent interfaces can be any physical port or bridge.
Creates a VLAN interface on a parent port.
Lists VLAN interfaces, optionally filtered.
Returns full details for a specific VLAN interface.
Updates an existing VLAN interface in place. Pass only the fields you want to change.
Removes a VLAN interface. Dependent IP addresses, DHCP servers, and firewall rules that reference the interface will be orphaned — clean them up first.
IP Address — IPv4 Interface Bindings
Assign and remove IPv4 addresses on physical, bridge, or VLAN interfaces. For IPv6, see IPv6 Address.
Bind an address to an interface.
192.168.100.1/24Inspect bindings — list takes optional filters (by interface, address, network, dynamic flag, or disabled-only); get returns one address record by ID.
IPv6 Address — Interface Bindings
Assign and inspect IPv6 addresses on interfaces, under the RouterOS
/ipv6 address tree. IPv6 lives in a separate command tree from IPv4
(/ipv6 … vs /ip …) — this is the IPv6 counterpart of the
IP Address category. These tools cover IPv6 addressing;
IPv6 routing, firewall, DHCPv6/ND, and pools are separate areas.
mikrotik_ prefix on this category
Adds an IPv6 address to an interface. Runs /ipv6 address add ….
2001:db8::1/64, fe80::1/64. With from_pool, supply the host part only (e.g. ::1/64).ether1, bridgeLists IPv6 addresses, with optional filtering. Runs /ipv6 address print.
"2001:db8", "fe80"fe80::/10Gets details for a single IPv6 address, by RouterOS id or by address value.
Runs /ipv6 address print detail where ….
*1) or the address value (e.g. 2001:db8::1/64)Removes an IPv6 address by id or address value. Runs /ipv6 address remove [find …].
*1) or the address valueIP Pool — Named Address Pools
Named ranges used by DHCP, hotspot, PPP, and VPN servers. Pools can be inspected, updated, and expanded without disruption.
"192.168.1.100-192.168.1.200"Inspect pool definitions, fetch a single pool by name, plus the live used-address table (which addresses are currently leased from a pool). list_ip_pools accepts name_filter / ranges_filter / include_used; list_ip_pool_used filters by pool_name, address_filter, mac_filter, and info_filter.
update edits a pool's name (rename via new_name), ranges, or next-pool chain; expand appends additional ranges without disrupting existing leases.
Remove a pool. Servers using it will refuse new leases.
DHCP — Pools, Networks, Servers
Three-piece model: a pool defines the address range, a network defines gateway and DNS, and a server binds them to an interface.
Build a DHCP service for a subnet in three steps. create_dhcp_server takes
name + interface (plus optional lease_time defaulting to
"1d", address_pool, authoritative, …).
List all DHCP servers or fetch one by name.
Removes a DHCP server. The underlying pool and network records survive.
DNS — Resolution & Static Records
Set upstream servers (with optional DNS-over-HTTPS), manage static
A/CNAME/MX/SRV/TXT records, regex blocklists, and inspect or flush the cache.
Run live test queries with mikrotik_test_dns_query.
Configure upstream resolvers, add static records, and define regex-based blocklists.
set_dns_servers also accepts allow_remote_requests, cache tuning
(cache_size, cache_max_ttl, max_udp_packet_size,
max_concurrent_queries), and DoH options (use_doh, doh_server,
verify_doh_cert). add_dns_static takes the record-type fields
cname, mx_preference/mx_exchange, text,
srv_priority/weight/port/target, plus
ttl and regexp.
Inspect resolver settings, list or fetch static records, dump the cache and its statistics, and run a live test query.
Edit a static record, enable/disable it without deleting, clear the resolver cache, or dump the full DNS configuration to a file.
Routes — Routing Table
Add static, default, and blackhole routes. Inspect active routes, check the path to a destination, dump routing tables, and read the route cache and statistics.
Three flavors of route creation. add_route takes dst_address +
gateway (plus optional distance, scope,
routing_mark, pref_src, check_gateway, …).
Inspect the routing table from several angles: list all, single route, traceroute-style path check, full table dump (table_name defaults to "main"), the kernel route cache, and aggregate statistics.
Edit a route in place, toggle individual routes by ID, or flush the route cache.
Firewall — Filter Rules
Manage filter rules across the input, forward,
and output chains. Includes rule ordering, enable/disable, and basic
firewall scaffolding.
Creates a new firewall filter rule. Most match parameters are optional — combine them to build whatever predicate you need.
input, forward, or output"established,related"List rules with optional filters (chain, action, addresses, protocol, interface, disabled/invalid/dynamic), or fetch a single rule by ID.
Edit a rule in place, reorder it within its chain (critical for ordered evaluation), or toggle it on/off without removing it.
Creates a sensible baseline: accept established/related, drop invalid, accept ICMP,
drop everything else on input. Useful for fresh routers.
NAT — Translation Rules
Source-NAT (masquerade) for outbound, destination-NAT (port forwarding) for inbound, plus rule ordering and toggle.
Creates a NAT rule on the srcnat or dstnat chain.
srcnat or dstnatInspect NAT rules — optionally filtered by chain. get returns one rule's full record.
Same edit / reorder / toggle surface as the firewall counterparts.
WireGuard — Tunnels & Peers
Create WireGuard interfaces, add peers with allowed-IPs and endpoints,
and generate ready-to-paste client configs. The interface's public key is returned by
get_wireguard_interface — hand it to clients. WireGuard requires RouterOS v7+.
Stands up a WireGuard interface. If no private key is supplied, one is generated; read the
matching public key back via get_wireguard_interface.
"wg0"13231)1420)List all WireGuard interfaces or fetch one — the latter includes the device's public key for clients to use.
Edit, toggle, or remove an interface. Removing an interface also deletes all of its peers.
Attaches a peer to an interface.
Inspect peers and their handshake state.
Edit, toggle, or remove peers. Identifiers are RouterOS peer IDs.
Produces a complete client .conf (the [Interface] / [Peer] blocks) ready to paste into a WireGuard client. This tool only formats text locally — it does not contact the router, so first use get_wireguard_interface for the server's public key and add_wireguard_peer to register the client.
51820, 0.0.0.0/0, keepalive 25. Use allowed_ips="0.0.0.0/0, ::/0" for a full tunnel, or a specific subnet for split-tunnel.The single-purpose tools above compose into a full VPN server. Run them in order — steps 2–4 reach into other categories (IP address, firewall, NAT):
Wireless — WiFi Interfaces & Security
Manage wireless interfaces, security profiles, access lists, and scanning.
Call check_wireless_support first — wireless tooling depends on the device's
RouterOS wireless package.
Creates / configures a wireless interface (SSID, band, channel, mode, and an attached security profile).
List wireless interfaces or fetch one's full configuration.
Edit, toggle, or remove a wireless interface.
Full lifecycle for security profiles — WPA/WPA2/WPA3 modes, passphrases, encryption. set attaches a profile to an interface.
Scan for nearby networks (optional duration) and list currently-associated clients with signal data.
MAC-based allow/deny entries with optional signal-range and time constraints.
Reports whether the device's RouterOS build supports the wireless tooling. Call this first.
Queues — Traffic Shaping
Simple queues for per-target rate limits, queue trees for hierarchical policies, and queue types for the underlying discipline (CAKE, fq-codel, SFQ, RED, PCQ, …).
nomikrotik_ prefix on this category
Per-target rate limits — the simplest way to throttle a host or subnet. max_limit takes
an upload/download pair like "10M/20M".
Hierarchical HTB shaping. Attach to a parent, match traffic by packet_mark,
set max_limit / limit_at / burst, and priority (1–8).
Define reusable queue disciplines. kind (default cake) is one of cake,
fq-codel, sfq, red, pcq, pfifo,
bfifo, … each with its own tuning parameters (e.g. cake_flowmode/cake_nat/cake_overhead
for CAKE, pcq_rate/pcq_classifier for PCQ, sfq_perturb for SFQ,
red_* thresholds for RED). Built-in types (default, default-small, …)
can't be modified or removed.
Users — Accounts, Groups & SSH Keys
Local users, groups, policies, active sessions, and SSH key management.
Used to provision scoped accounts for tooling rather than sharing admin.
Create users and permission groups. Groups take a policy list (e.g. read,write,ssh).
Inspect users, groups, and currently-connected sessions.
Edit users / groups, toggle accounts, or forcibly disconnect an active session.
Import a user's SSH public key (key-based auth), list installed keys, or remove one by ID.
Dumps the full user / group configuration to a file.
Remove a user or a group.
Backup & Export — Configuration State
Binary backups, RouterOS .rsc exports, section dumps,
file transfer, restore, and import.
Three formats: a binary .backup (full snapshot), a .rsc export (declarative,
choose rsc/json/xml and full/compact/verbose), or a single-section dump.
List backup files, inspect a backup's metadata, and download files off the device.
download_file pulls the raw bytes over SFTP and returns them base64-encoded,
so binary .backup files survive the round-trip intact alongside text .rsc exports.
Restore a binary backup (pass password for an encrypted backup), import a .rsc config, or upload an arbitrary file to the device — upload_file takes base64 content and writes the decoded bytes over SFTP.
Removes any file from the device's filesystem.
Logs — System Events
Stream and analyze RouterOS logs by topic, severity, or free-text search. Pull system events and security logs, aggregate statistics, live-tail, and export to CSV.
Seven lenses on the log buffer — by topic, by severity
(debug/info/warning/error/critical),
free-text search, system events, the security topic, or aggregate stats.
Live-tail logs for a duration, or dump them to plain / csv.
Clears the in-memory log buffer. Doesn't affect file-backed logs.
Safe Mode — Atomic Sessions
RouterOS safe-mode wraps a sequence of changes; if the management session drops before you commit, every change auto-reverts. Highly recommended when editing firewall or connectivity rules remotely.
nomikrotik_ prefix on this category · no parameters
enable_safe_mode opens a persistent SSH shell and sends a
Ctrl+X to the router. While active, every subsequent MCP tool call is
routed through that same session automatically (the connector detects it — no per-command
connections). commit_safe_mode sends a second Ctrl+X,
writing the pending changes to flash/NVRAM and closing the session; rollback_safe_mode
simply drops the session (no Ctrl+X), so RouterOS reverts everything. Pending
changes live in memory only — a router reboot, not just a dropped connection, also
reverts them. Concurrent calls are serialised through an internal lock, so parallel requests are safe. With an inventory, safe mode is tracked per device — enabling it on one router leaves the others untouched.
Starts a safe-mode session; afterwards every tool call runs inside the one persistent
shell until you commit or roll back. Returns an Error: … string if the SSH connection
fails or the router doesn't confirm the <SAFE> prompt.
Persist the journaled changes, or revert them immediately. Both are no-ops when safe mode
isn't active — they return "Safe mode is not active. Nothing to commit / roll back."
Reports whether a safe-mode session is currently active — e.g.
"Safe mode is ACTIVE. Changes are pending — NOT yet persisted…" versus
"Safe mode is NOT active…".