MikroTik MCP / Docs / API reference

API reference

Every tool the server exposes, grouped into 31 categories in 12 feature areas (253 tools total). Each entry shows the name, what it does, its parameters (required vs optional), and a canonical example. Wondering which RouterOS commands are not covered yet? See the API coverage.

Naming convention. A tool is named <verb>_<resource>: a verb — create, list, get, update, remove, plus category-specific verbs such as enable, move or flush — and what it acts on, for example list_interfaces, create_simple_queue or enable_safe_mode. These are the names the server registers, so they are what an MCP client lists and what you pass when you call a tool. Some clients show them qualified with the server name (Claude Code, for one, shows mcp__<server>__list_interfaces). Older releases and tutorials show many of them with a mikrotik_ prefix; the server no longer registers it, so use the names on this page. With a multi-device inventory configured, every device-scoped tool also accepts an optional device argument naming the inventory title to target.

Feature areas. The categories are grouped into the same feature areas as the packages under src/mcp_mikrotik/scope/, so a category's code, its unit tests and its reference pages are easy to find from one another in the repository; see Contributing. Failures are reported as failures. A write that RouterOS refuses, or that finds nothing to change (an id or a name that does not exist), is reported as a failure with RouterOS's answer instead of a success message.

Categories

Area · Devices

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.

1 tool
category 01
list list_devices

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.

—no paramsTakes no arguments
Fleet patternlist_devices() # discover the fleet list_interfaces(device="office-core") # target one device create_vlan_interface(device="branch-berlin", name="vlan100", vlan_id=100, interface="ether1")
configure Configuring the inventory

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.

inventory.yaml- title: office-core host: 192.168.88.1 port: 22 username: admin password: change-me tags: [office, core] region: NL - title: branch-berlin host: 10.20.0.1 username: admin key_filename: /config/keys/id_ed25519 tags: [branch] region: DE
titlerequiredUnique identifier passed as device — matching is case-insensitive
hostrequiredIP or hostname
port · usernameoptionalDefaults: 22, admin
password · key_filenameoptionalPrefer an SSH key over a password; omit password when using a key
allow_ssh_agentoptionalAuthenticate with keys offered by the SSH agent through SSH_AUTH_SOCK; default false
ssh_agent_keyoptionalRestrict agent authentication to the matching key: a full public-key line, its base64 blob, or a SHA256: fingerprint; requires allow_ssh_agent: true
tags · regionoptionalFree-form labels — [branch, eu], NL — great targets for "every device tagged office" prompts
select Selecting a device

Every 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.

DOCKER
In the container, the inventory file must be mounted as a volume — the image ships /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 / MIKROTIK_ALLOW_SSH_AGENT / MIKROTIK_SSH_AGENT_KEY are ignored. See Installation.
BEHAVIOR
Connections are per command — every command opens its own SSH connection and closes it when done, so parallel client sessions can't disturb each other; the trade-off is one SSH handshake per command. Safe mode is per device — each device holds its own persistent session, so 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).
Area · Devices

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.

4 tools
category 02
HOW IT WORKS
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. RouterOS keeps them only if the session is released before the connection closes, so the tool checks the console state first, waits for the release and closes the SSH session only when the prompt no longer shows <SAFE>; a commit takes a few seconds. 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.
enableenable_safe_mode

Starts a safe-mode session; afterwards every tool call runs inside the one persistent shell until you commit or roll back, and a command that fails answers at once with RouterOS's error text. If the SSH connection fails or the router does not confirm the safe-mode session, the tool returns a tool error (isError), never a successful answer.

—no paramsTakes no arguments
commit · rollbackcommit_safe_mode · rollback_safe_mode

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." When the release cannot be confirmed, or the console state cannot be read, commit_safe_mode returns a tool error and leaves the session open: the changes are still pending and not persisted, so call it again or roll back. If the console was no longer in safe mode when the commit started, it returns a tool error and sends nothing; check the configuration before relying on the changes.

statussafe_mode_status

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…".

Pattern — risky firewall edit under safe modeenable_safe_mode() create_filter_rule(chain="input", action="drop", src_address="0.0.0.0/0") # test reachability from another window; if you're locked out, just # disconnect and the rule auto-reverts. If still reachable: commit_safe_mode()
Area · DHCP

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.

10 tools
category 03
create create_dhcp_pool · create_dhcp_network · create_dhcp_server

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, …).

Example — Guest VLAN DHCPcreate_dhcp_pool(name="pool-vlan100", ranges="192.168.100.10-192.168.100.200") create_dhcp_network(network="192.168.100.0/24", gateway="192.168.100.1", dns_servers=["8.8.8.8", "8.8.4.4"]) create_dhcp_server(name="dhcp-vlan100", interface="vlan100", address_pool="pool-vlan100")
list · getlist_dhcp_servers · get_dhcp_server

List all DHCP servers or fetch one by name.

leases · bindingslist_dhcp_leases · list_dhcpv6_bindings

Raw, detailed views of who actually holds an address — IPv4 DHCP leases and DHCPv6 bindings. Identity filters match the active lease fields. Address and identity filters use substring matching; server, status, and lease time use exact matching.

address_filter · mac_filteroptionalActive address / MAC (leases); assigned address or prefix (bindings)
client_id_filter · hostname_filter · class_id_filteroptionalLeases only — active client ID, hostname, class ID
duid_filter · iaid_filteroptionalBindings only — DUID (substring) and IAID (exact)
server_filter · status_filteroptionalExact match on DHCP server / lease or binding status
lease_time_filteroptionalConfigured time — the RouterOS lease-time field for leases, life-time for bindings
last_seen_withinoptionalOnly entries seen within a duration such as 1h or 24h
Exampleslist_dhcp_leases(status_filter="bound", last_seen_within="24h") list_dhcpv6_bindings(status_filter="bound", last_seen_within="1h")
network update · removeupdate_dhcp_network · remove_dhcp_network

Edit or delete a DHCP network record (the gateway/DNS half of the three-piece model), keyed by its network CIDR. update takes any of gateway, netmask, dns_servers, domain, wins_servers, ntp_servers, dhcp_option, and comment.

Exampleupdate_dhcp_network(network="192.168.100.0/24", dns_servers=["1.1.1.1"]) remove_dhcp_network(network="192.168.100.0/24")
removeremove_dhcp_server

Removes a DHCP server. The underlying pool and network records survive.

Area · DNS

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 test_dns_query.

15 tools
category 04
createset_dns_servers · add_dns_static · add_dns_regexp

Configure upstream resolvers, add static records, and define regex-based blocklists. An empty servers list given to set_dns_servers clears the upstream servers, and options left out keep their current value. 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.

Exampleset_dns_servers(servers=["8.8.8.8", "1.1.1.1"], allow_remote_requests=true) add_dns_static(name="router.local", address="192.168.1.1")
read · testget_dns_settings · list_dns_static · get_dns_static · get_dns_cache · get_dns_cache_statistics · test_dns_query

Inspect resolver settings, list or fetch static records, dump the cache and its statistics, and run a live test query.

Exampletest_dns_query(name="example.com", server="8.8.8.8", type="A")

Test queries run through RouterOS :resolve, so type accepts A/ipv4 (default), AAAA/ipv6, any, and any6 only — record-type lookups such as MX or TXT aren't supported by :resolve.

update · toggle · flush · exportupdate_dns_static · enable_dns_static · disable_dns_static · flush_dns_cache · export_dns_config

Edit a static record, enable/disable it without deleting, clear the resolver cache, or dump the full DNS configuration to a file.

removeremove_dns_static
entry_idrequiredStatic record ID
Area · Firewall

Firewall — Filter Rules

Manage IPv4 filter rules across the input, forward, and output chains. Includes rule ordering, enable/disable, and basic firewall scaffolding. For IPv6, see IPv6 Firewall.

9 tools
category 05
create create_filter_rule

Creates a new firewall filter rule. Most match parameters are optional — combine them to build whatever predicate you need.

chainrequiredChain — input, forward, or output
actionrequiredaccept, drop, reject, log, jump, …
src_addressoptionalSource address / CIDR
dst_addressoptionalDestination address / CIDR
src_port · dst_portoptionalSource / destination port
protocoloptionaltcp, udp, icmp, …
in_interface · out_interfaceoptionalMatch by interface
in_interface_list · out_interface_listoptionalMatch an /interface list (e.g. "LAN", "WAN") rather than a single interface
connection_stateoptionale.g. "established,related"
src_address_list · dst_address_listoptionalNamed source / destination address lists
connection_nat_stateoptionalConnection NAT state match
tcp_flags · limitoptionalTCP flag matches; rate limit
comment · disabledoptionalDescription; create disabled
log · log_prefixoptionalEnable logging; log prefix string
place_beforeoptionalInsert before this rule ID
Example — allow SSH from LANcreate_filter_rule( chain="input", action="accept", protocol="tcp", dst_port="22", src_address="192.168.1.0/24" )
list · getlist_filter_rules · get_filter_rule

List rules with optional filters (chain, action, addresses, protocol, interface, disabled/invalid/dynamic), or fetch a single rule by ID.

Examplelist_filter_rules(chain_filter="input")
update · move · toggleupdate_filter_rule · move_filter_rule · enable_filter_rule · disable_filter_rule

Edit a rule in place, reorder it within its chain (critical for ordered evaluation), or toggle it on/off without removing it. update_filter_rule takes rule_id plus the create fields except place_before; use move_filter_rule to change the position.

Example — move rule to topmove_filter_rule(rule_id="*1", destination=0)
removeremove_filter_rule
rule_idrequiredRule ID
scaffoldcreate_basic_firewall_setup

Creates a sensible baseline: accept established/related, drop invalid, accept ICMP, drop everything else on input. Useful for fresh routers.

—no paramsTakes no arguments
Examplecreate_basic_firewall_setup()
Area · Firewall

IPv6 Firewall — Filter Rules

Filter rules under the RouterOS /ipv6 firewall filter tree — the IPv6 counterpart of the Firewall (IPv4) category. IPv6 lives in a separate command tree, so the IPv4 tools neither see nor touch these rules. Two differences bite most often: ICMP is spelled icmpv6, and addresses are IPv6 prefixes such as 2001:db8::/64.

8 tools
category 06
create create_ipv6_filter_rule

Creates an IPv6 filter rule. Runs /ipv6 firewall filter add …. Most match parameters are optional — combine them to build whatever predicate you need.

chainrequiredinput, forward, or output
actionrequiredaccept, drop, reject, jump, log, passthrough, return, tarpit
jump_targetoptionalChain to jump to — only used with action="jump"
src_address · dst_addressoptionalIPv6 address or prefix
src_port · dst_portoptionalPort, list, or range
protocoloptionale.g. tcp, udp, icmpv6
in_interface · out_interfaceoptionalMatch by interface
connection_stateoptionalComma-separated, e.g. "established,related"
src_address_list · dst_address_listoptionalNamed address lists
src_address_type · dst_address_typeoptionale.g. unicast, multicast, local
icmp_optionsoptionalICMPv6 type:code — 128:0 is echo request
hop_limitoptionalHop-limit expression, e.g. equal:255
headersoptionalExtension-header match, e.g. hop or !hop
limit · tcp_flagsoptionalRate/burst (10,5:packet); TCP flag expression (syn,!ack)
comment · disabled · log · log_prefixoptionalDescription; create disabled; enable logging; log prefix
place_beforeoptionalRule number or ID to insert before
Examplescreate_ipv6_filter_rule(chain="input", action="accept", protocol="icmpv6") create_ipv6_filter_rule(chain="input", action="accept", protocol="tcp", dst_port="22", src_address="2001:db8::/64") # NDP: router solicitation, hop-limit 255 create_ipv6_filter_rule(chain="input", action="accept", protocol="icmpv6", icmp_options="133:0", hop_limit="equal:255")
list · get list_ipv6_filter_rules · get_ipv6_filter_rule

List rules with optional filters, or fetch one in detail.

chain_filter · action_filteroptionalExact match on chain / action
src_address_filter · dst_address_filteroptionalPartial match — "2001:db8" matches every rule whose address begins with it
protocol_filteroptionalExact protocol — use icmpv6, not icmp
interface_filteroptionalMatches either in-interface or out-interface
disabled_only · invalid_only · dynamic_onlyoptionalNarrow by rule state
rule_idrequired for getA RouterOS internal id, e.g. *1 — the positional numbers shown by print are per-session and do not resolve here
Exampleslist_ipv6_filter_rules(chain_filter="forward") list_ipv6_filter_rules(protocol_filter="icmpv6") get_ipv6_filter_rule(rule_id="*3")
update · move · toggle update_ipv6_filter_rule · move_ipv6_filter_rule · enable_ipv6_filter_rule · disable_ipv6_filter_rule

Edit a rule in place, reorder it within its chain (critical for ordered evaluation), or toggle it without removing it. update takes rule_id plus any create field except place_before (use move to change the position) — pass an empty string to clear an optional field. move takes a 0-based destination.

Examplesupdate_ipv6_filter_rule(rule_id="*3", comment="tightened", src_address="") move_ipv6_filter_rule(rule_id="*3", destination=0) disable_ipv6_filter_rule(rule_id="*3")
remove remove_ipv6_filter_rule
rule_idrequiredInternal rule ID, e.g. *3
Area · Firewall

NAT — Translation Rules

Source-NAT (masquerade) for outbound, destination-NAT (port forwarding) for inbound, plus rule ordering and toggle.

8 tools
category 07
create create_nat_rule

Creates a NAT rule on the srcnat or dstnat chain.

chainrequiredsrcnat or dstnat
actionrequiredmasquerade, dst-nat, src-nat, redirect, …
to_addressesoptionalTarget address for dst-nat
to_portsoptionalTarget port(s)
protocol · dst_port · …optionalSame predicate set as firewall rules
Example — port-forward HTTPcreate_nat_rule( chain="dstnat", action="dst-nat", dst_port="80", protocol="tcp", to_addresses="192.168.100.10", to_ports="80", comment="Web server" )
list · getlist_nat_rules · get_nat_rule

Inspect NAT rules — optionally filtered by chain. get returns one rule's full record.

Exampleslist_nat_rules(chain_filter="srcnat") get_nat_rule(rule_id="*1")
update · move · toggleupdate_nat_rule · move_nat_rule · enable_nat_rule · disable_nat_rule

Same edit / reorder / toggle surface as the firewall counterparts. update_nat_rule takes every create field except place_before; use move_nat_rule to change the position.

removeremove_nat_rule
rule_idrequiredRule ID
Area · Firewall

Firewall Raw — Pre-conntrack Rules

Tools for the RouterOS raw tables, /ip firewall raw and /ipv6 firewall raw. Raw rules run before connection tracking, in the prerouting and output chains. They are used to drop unwanted traffic cheaply (for example traffic from a blocklist, or bogons on the WAN) and to exempt traffic from connection tracking with action=notrack. Raw rules see no connection state, so there is no connection_state matcher.

Each tool exists twice, with the same parameters: *_raw_rule(s) for IPv4 and *_ipv6_raw_rule(s) for IPv6. The only parameter that differs is the TTL matcher, ttl for IPv4 and hop_limit for IPv6. In IPv6 the ICMP protocol is spelled icmpv6. With --read-only, only list_* and get_* are exposed.

16 tools
category 08
IPv4IPv6Annotation
list_raw_ruleslist_ipv6_raw_rulesREAD
get_raw_ruleget_ipv6_raw_ruleREAD
create_raw_rulecreate_ipv6_raw_ruleWRITE
update_raw_ruleupdate_ipv6_raw_ruleWRITE_IDEMPOTENT
enable_raw_rule / disable_raw_ruleenable_ipv6_raw_rule / disable_ipv6_raw_ruleWRITE_IDEMPOTENT
move_raw_rulemove_ipv6_raw_ruleWRITE_IDEMPOTENT
remove_raw_ruleremove_ipv6_raw_ruleDESTRUCTIVE
create create_raw_rule · create_ipv6_raw_rule

Creates a raw rule. Runs :put [<menu> add …] and reports the new internal id. Most match parameters are optional.

chainrequiredprerouting, output, or a custom chain reached by a jump
actionrequiredaccept, drop, notrack, jump, return, log, passthrough, add-src-to-address-list, add-dst-to-address-list
jump_targetoptionalRequired with action="jump"
address_list · address_list_timeoutoptionaladdress_list is required with the add-*-to-address-list actions; timeout such as 1d, 12h, 00:30:00
src_address · dst_addressoptionalMatch by address
src_port · dst_port · portoptionalMatch by port
protocoloptionalProtocol — icmpv6 (not icmp) on the IPv6 tool
in_interface · out_interfaceoptionalMatch by interface
in_interface_list · out_interface_listoptionalMatch by interface list
src_address_list · dst_address_listoptionalMatch by address list
src_address_type · dst_address_typeoptionalMatch by address type
tcp_flags · icmp_options · packet_size · dscp · limitoptionalFurther matchers
ttl · hop_limitoptionalTTL matcher: ttl on the IPv4 tool, hop_limit on the IPv6 tool
comment · disabled · log · log_prefixoptionalDescription; create disabled; enable logging; log prefix
place_beforeoptionalInternal id or print position of the rule to insert before
Examplescreate_raw_rule(chain="prerouting", action="drop", in_interface_list="WAN", src_address_list="blocklist") create_raw_rule(chain="prerouting", action="notrack", protocol="udp", dst_port="53", dst_address_type="local") create_ipv6_raw_rule(chain="prerouting", action="drop", in_interface_list="WAN", src_address="fc00::/7")
list · get list_raw_rules · get_raw_rule

List rules with optional filters, or fetch one in detail. Runs <menu> print [stats] [where …] and <menu> print detail where .id=…. IPv6: list_ipv6_raw_rules, get_ipv6_raw_rule.

chain_filter · action_filter · protocol_filteroptionalExact match
src_address_filter · dst_address_filteroptionalPartial match
interface_filteroptionalPartial match on in/out interface and in/out interface list
comment_filteroptionalPartial match on the comment
disabled_only · invalid_only · dynamic_onlyoptionalNarrow by rule state
statsoptionalShow byte and packet counters (print stats)
rule_idrequired for getAn internal id (*1A) or a print position (0), which is resolved to an id first
Exampleslist_raw_rules(chain_filter="prerouting", action_filter="drop") get_raw_rule(rule_id="*1A")
update update_raw_rule · update_ipv6_raw_rule

Updates a raw rule. Runs <menu> set <id> …. Takes rule_id plus the same parameters as create, all optional, except place_before (use move_raw_rule or move_ipv6_raw_rule to change the position). Pass "" to clear a matcher (for example src_address="" sends !src-address). Any output from set is reported as a refusal, for example not enough permissions (9) for a read-only account.

rule_idrequiredInternal id or print position
(same as create)optionalEvery create parameter except place_before, all optional
Exampleupdate_raw_rule(rule_id="*1A", comment="Drop blocklist")
enable · disable · move enable_raw_rule · disable_raw_rule · move_raw_rule

Toggle a rule (set <id> disabled=no|yes) or move it to a position. move_raw_rule moves the rule to the 0-based destination position, by id, then checks it landed there. IPv6: enable_ipv6_raw_rule, disable_ipv6_raw_rule, move_ipv6_raw_rule.

rule_idrequiredInternal id or print position
destinationrequired for move0-based target position
Examplesdisable_raw_rule(rule_id="*1A") move_raw_rule(rule_id="*1A", destination=0)
remove remove_raw_rule · remove_ipv6_raw_rule

Removes a rule and checks it is gone.

rule_idrequiredInternal id or print position
Exampleremove_raw_rule(rule_id="*1A")
Area · Firewall

Address Lists — Named IP Sets

Named address sets under /ip firewall address-list and /ipv6 firewall address-list, referenced from filter rules via src_address_list / dst_address_list. Unlike the filter scopes, IPv4 and IPv6 share one set of tools — the entry schema is identical across families, so each tool takes a required family of "ipv4" or "ipv6" rather than duplicating seven tools per family.

7 tools
category 09
BEHAVIOR
Three things worth knowing before you use these. IPv6 stores host entries with an explicit /128 — adding 2001:db8::5 stores 2001:db8::5/128, so a bare lookup wouldn't match; these tools canonicalise the address for you, so either form works. List names match exactly, including spaces — "internal NS " with a trailing space is a different list from "internal NS"; nothing is trimmed. A hostname entry creates dynamic children — address=example.com adds one static entry plus one dynamic entry per resolved address (use static_only to exclude them), and an entry with a timeout is likewise dynamic and does not survive a reboot.
create create_address_list_entry

Adds an entry. Runs /ip or /ipv6 firewall address-list add.

familyrequired"ipv4" or "ipv6"
list_namerequiredList to add to — created implicitly if new
addressrequiredAddress, prefix, or hostname
comment · timeout · disabledoptionalDescription; expiry such as 1h (makes the entry dynamic); create disabled
Examplescreate_address_list_entry(family="ipv4", list_name="trusted", address="203.0.113.0/24") create_address_list_entry(family="ipv6", list_name="trusted", address="2001:db8::5") create_address_list_entry(family="ipv4", list_name="temp", address="203.0.113.9", timeout="1h")
list · get list_address_list_entries · get_address_list_entry

List entries with optional filters, or fetch one by list name and address.

familyrequired"ipv4" or "ipv6"
list_filteroptionalExact list name — trailing spaces included
address_filter · comment_filteroptionalPartial match
disabled_only · dynamic_only · static_onlyoptionalNarrow by entry state — static_only excludes hostname/timeout children
list_name · addressrequired for getLocate the single entry
Exampleslist_address_list_entries(family="ipv4", list_filter="trusted", static_only=true) list_address_list_entries(family="ipv6", address_filter="2001:db8") get_address_list_entry(family="ipv6", list_name="trusted", address="2001:db8::5")
update · toggle update_address_list_entry · enable_address_list_entry · disable_address_list_entry

Edit an entry located by its current list_name + address, or toggle it without removing it. update takes new_list_name, comment, timeout, and disabled — pass "" to clear comment or timeout. The change is confirmed on the device before success is reported: a refusal RouterOS phrases without the words "failure" or "error" — a read-only account answers not enough permissions (9) — is reported as a failure rather than a successful update.

Examplesupdate_address_list_entry(family="ipv4", list_name="temp", address="203.0.113.9", new_list_name="trusted") disable_address_list_entry(family="ipv4", list_name="trusted", address="203.0.113.0/24")
remove remove_address_list_entry

Removes the matching entry. Removing a hostname entry also clears the dynamic entries RouterOS derived from it.

Exampleremove_address_list_entry(family="ipv4", list_name="trusted", address="203.0.113.0/24")
Area · Interfaces

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).

4 tools
category 10
list list_interfaces

Lists all interfaces, with optional filtering by type, name, or running/disabled state.

type_filteroptionalFilter by type — ether, bridge, vlan, wg, pppoe-out, wifi, lte, loopback, …
name_filteroptionalPartial name match — "ether" matches ether1, ether2 …
running_onlyoptionalOnly currently-running interfaces
disabled_onlyoptionalOnly disabled interfaces
Exampleslist_interfaces() list_interfaces(type_filter="ether") list_interfaces(running_only=true)
get get_interface

Returns detailed information about a single interface by exact name.

namerequiredExact interface name — "ether1", "bridge", "pppoe-out1", "wg0"
Exampleget_interface(name="ether1-wan")
enable · disable enable_interface · disable_interface

Bring an interface up or take it down without removing it.

namerequiredExact interface name
Examplesdisable_interface(name="ether4") enable_interface(name="ether4")
Area · Interfaces

VLAN — Tagged Interfaces

Create, list, inspect, update, and remove tagged 802.1Q interfaces. Parent interfaces can be any physical port or bridge.

5 tools
category 11
create create_vlan_interface

Creates a VLAN interface on a parent port.

namerequiredVLAN interface name
vlan_idrequiredVLAN ID (1–4094)
interfacerequiredParent interface
commentoptionalDescription
disabledoptionalCreate in disabled state
mtuoptionalMTU size
use_service_tagoptional802.1ad service tag
arpoptionalARP mode
arp_timeoutoptionalARP timeout
Examplecreate_vlan_interface(name="vlan100", vlan_id=100, interface="ether1")
list list_vlan_interfaces

Lists VLAN interfaces, optionally filtered.

name_filteroptionalFilter by name
vlan_id_filteroptionalFilter by VLAN ID
interface_filteroptionalFilter by parent interface
disabled_onlyoptionalShow only disabled interfaces
Examplelist_vlan_interfaces(vlan_id_filter=100)
get get_vlan_interface

Returns full details for a specific VLAN interface.

namerequiredVLAN interface name
Exampleget_vlan_interface(name="vlan100")
update update_vlan_interface

Updates an existing VLAN interface in place. Pass only the fields you want to change.

namerequiredCurrent name
new_nameoptionalRename to
vlan_idoptionalNew VLAN ID
interfaceoptionalNew parent interface
commentoptionalNew description
disabledoptionalEnable / disable
mtuoptionalNew MTU
arpoptionalARP mode
use_service_tagoptional802.1ad service tag
arp_timeoutoptionalARP timeout
Exampleupdate_vlan_interface(name="vlan100", comment="Production VLAN")
remove remove_vlan_interface

Removes a VLAN interface. Dependent IP addresses, DHCP servers, and firewall rules that reference the interface will be orphaned — clean them up first.

namerequiredVLAN interface name
Exampleremove_vlan_interface(name="vlan100")
Area · Interfaces

Bridge — VLAN Table & Port PVID

Manage the bridge VLAN table (which ports carry each VLAN tagged or untagged) and the per-port PVID, frame types and ingress filtering of bridge ports. Every write is confirmed on the device before success is reported; a refusal (for example not enough permissions (9) from a read-only account) or an entry that does not exist comes back as a failure.

vlan_ids is a VLAN ID, a range, or a comma list of either, and it has to match the stored value exactly: an entry holding 20,30 is found by "20,30", not by "20".

6 tools
category 12
list list_bridge_vlans

Lists bridge VLAN table entries (tagged/untagged port membership per VLAN).

bridge_filteroptionalFilter by bridge name
vlan_ids_filteroptionalFilter by VLAN IDs
dynamic_onlyoptionalShow only dynamic entries
Examplelist_bridge_vlans(bridge_filter="bridge1")
add add_bridge_vlan

Adds an entry to the bridge VLAN table.

bridgerequiredBridge name
vlan_idsrequiredVLAN ID, comma list, or range (e.g. "10", "10,20", "100-199")
taggedoptionalComma-separated ports carrying these VLANs tagged
untaggedoptionalComma-separated ports carrying these VLANs untagged
commentoptionalDescription
disabledoptionalDisable entry
Exampleadd_bridge_vlan(bridge="bridge1", vlan_ids="10", tagged="ether1,ether2", untagged="ether3")
update update_bridge_vlan

Updates an existing bridge VLAN table entry.

bridgerequiredBridge name
vlan_idsrequiredCurrent VLAN IDs (must match the stored value exactly)
new_vlan_idsoptionalNew VLAN IDs
taggedoptionalNew tagged port list (pass "" to clear)
untaggedoptionalNew untagged port list (pass "" to clear)
commentoptionalNew description
disabledoptionalEnable/disable entry
Exampleupdate_bridge_vlan(bridge="bridge1", vlan_ids="10", tagged="ether1,ether2,ether4")
remove remove_bridge_vlan

Removes an entry from the bridge VLAN table.

bridgerequiredBridge name
vlan_idsrequiredVLAN IDs (must match the stored value exactly)
Exampleremove_bridge_vlan(bridge="bridge1", vlan_ids="10")
list list_bridge_ports

Lists bridge ports, including each port's PVID.

bridge_filteroptionalFilter by bridge name
interface_filteroptionalFilter by interface name
Examplelist_bridge_ports(bridge_filter="bridge1")
update update_bridge_port

Updates per-port VLAN, STP/RSTP and DHCP snooping settings on a bridge port.

interfacerequiredPort's interface name
pvidoptionalVLAN ID for untagged ingress traffic (1–4094)
frame_typesoptionaladmit-all, admit-only-untagged-and-priority-tagged, or admit-only-vlan-tagged
ingress_filteringoptionalDrop frames for VLANs the port is not a member of
path_costoptionalExternal STP/RSTP path cost (1 to 200000000)
internal_path_costoptionalPath cost inside an MSTP region, used only with protocol-mode=mstp (1 to 200000000)
edgeoptionalEdge port mode: auto, no, no-discover, yes or yes-discover
point_to_pointoptionalPoint-to-point link mode: auto, no or yes
restricted_tcn · bpdu_guardoptionalIgnore received topology change notifications; disable the port if a BPDU is received
trustedoptionalTrust this port for DHCP snooping (DHCP server messages received here are forwarded); acts only when the bridge has dhcp-snooping=yes
Exampleupdate_bridge_port(interface="ether3", pvid=10, frame_types="admit-only-untagged-and-priority-tagged")
Area · Interfaces

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+.

15 tools
category 13
createcreate_wireguard_interface

Stands up a WireGuard interface. If no private key is supplied, one is generated; read the matching public key back via get_wireguard_interface.

namerequiredInterface name, e.g. "wg0"
listen_portoptionalUDP listen port (default 13231)
private_keyoptionalAuto-generated if omitted
mtuoptionalMTU (default 1420)
comment · disabledoptionalDescription; create disabled
Examplecreate_wireguard_interface(name="wg0", listen_port=13231)
interface readlist_wireguard_interfaces · get_wireguard_interface

List all WireGuard interfaces or fetch one — the latter includes the device's public key for clients to use.

interface update · toggle · removeupdate_wireguard_interface · enable_wireguard_interface · disable_wireguard_interface · remove_wireguard_interface

Edit, toggle, or remove an interface. Removing an interface also deletes all of its peers.

peer addadd_wireguard_peer

Attaches a peer to an interface.

interfacerequiredWireGuard interface name
public_keyrequiredPeer's public key
allowed_addressrequiredAllowed IPs for this peer
endpoint_address · endpoint_portoptionalRemote endpoint
preshared_key · persistent_keepaliveoptionalExtra security; keepalive interval
Exampleadd_wireguard_peer(interface="wg0", public_key="<peer-pubkey>", allowed_address="10.0.0.2/32")
peer readlist_wireguard_peers · get_wireguard_peer

Inspect peers and their handshake state.

peer update · toggle · removeupdate_wireguard_peer · enable_wireguard_peer · disable_wireguard_peer · remove_wireguard_peer

Edit, toggle, or remove peers. Identifiers are RouterOS peer IDs.

generategenerate_wireguard_client_config

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.

client_private_keyrequiredClient's private key
client_addressrequiredClient tunnel address
server_public_keyrequiredServer's public key
server_endpointrequiredServer host / IP
server_port · allowed_ips · dns · persistent_keepaliveoptionalDefaults: 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.
walkthrough Setting up a WireGuard server

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):

Ordered sequence# 1. Create the interface create_wireguard_interface(name="wg0", listen_port=51820) # 2. Give it a tunnel address add_ip_address(address="10.0.0.1/24", interface="wg0") # 3. Allow inbound WireGuard UDP create_filter_rule(chain="input", action="accept", protocol="udp", dst_port="51820") # 4. (optional) Masquerade clients out to the internet create_nat_rule(chain="srcnat", action="masquerade", out_interface="ether1") # 5. Read the server public key for clients get_wireguard_interface(name="wg0") # 6. Register each client as a peer add_wireguard_peer(interface="wg0", public_key="<client-pubkey>", allowed_address="10.0.0.2/32") # 7. Generate the client .conf generate_wireguard_client_config(client_private_key="<client-privkey>", client_address="10.0.0.2/24", server_public_key="<server-pubkey>", server_endpoint="203.0.113.1")
Area · Interfaces

Wireless — WiFi Interfaces & Security

Wireless interface management. RouterOS 7 has replaced the old /interface wireless menu with /interface wifi, and the tool names and security model changed with it. The interface tools detect which of the two menus your device has and translate automatically; run check_wireless_support first to see which one applies.

On RouterOS 7, security is set either inline with set_wireless_passphrase or as a named security profile (/interface wifi security) created with create_wireless_security_profile and assigned with set_wireless_security_profile. The security-profile and access-list tools work on RouterOS 7 only; on the legacy menu they answer with an error and change nothing. One controller configuring several access points has its own category: CAPsMAN.

21 tools
category 14
support check_wireless_support

Checks if the device supports wireless and reports the RouterOS version and the wireless menu in use. Call this first.

—no paramsTakes no arguments
create create_wireless_interface

Creates a wireless interface. On RouterOS 7 this is a virtual AP on an existing radio interface: RouterOS needs to know which radio, so master_interface is required there.

namerequiredInterface name
ssid · commentoptionalNetwork name; description
disabledoptionalCreate it disabled (default false)
security_profileoptionalOn RouterOS 7 a profile from create_wireless_security_profile; on legacy devices a security profile
master_interfaceoptionalRouterOS 7 only, and required there: the radio the new interface runs on, e.g. wifi1
radio_name · mode · frequency · band · channel_widthoptionalLegacy /interface wireless only; radio_name is required there. RouterOS 7 refuses these with an error instead of ignoring them
Examplecreate_wireless_interface(name="guest", ssid="Guest", master_interface="wifi1", security_profile="guest-sec")
list · get list_wireless_interfaces · get_wireless_interface

Lists wireless interfaces, or fetches one interface by exact name. On legacy wireless a running interface set to frequency=auto is listed with the channel it is on right now, for example frequency=auto (active: 5180/20-Ceee/ac/P(23dBm)), which costs one extra command per such interface.

name_filteroptionalList: substring match
disabled_only · running_onlyoptionalList: only disabled / only running interfaces (default false)
namerequiredGet: exact interface name
Exampleslist_wireless_interfaces(running_only=true) get_wireless_interface(name="wlan1")
update update_wireless_interface

Updates a wireless interface's name, SSID, enabled state or comment, and on RouterOS 7 the configuration profile it uses and who configures it.

namerequiredThe interface to update
new_name · ssid · disabled · commentoptionalThe fields to change
configuration · configuration_manageroptionalRouterOS 7 only: a profile from create_wifi_configuration, and who configures the radio: local, capsman or capsman-or-local. The radios of a CAP need capsman or capsman-or-local to take their settings from the controller
Examplesupdate_wireless_interface(name="wlan1", ssid="NewNetwork") update_wireless_interface(name="wifi1", configuration_manager="capsman-or-local")
passphrase set_wireless_passphrase

Sets the WiFi passphrase directly on a RouterOS 7 wireless interface. On a legacy /interface wireless device, where passphrases live in security profiles, it says so and changes nothing.

namerequiredThe interface
passphraserequiredThe new passphrase
authentication_typesoptionalComma list of wpa-psk, wpa2-psk, wpa3-psk, owe, wpa-eap, wpa2-eap, wpa3-eap, wpa3-eap-192; anything else is refused
Exampleset_wireless_passphrase(name="wlan1", passphrase="change-me", authentication_types="wpa2-psk")
toggle · remove enable_wireless_interface · disable_wireless_interface · remove_wireless_interface

Enables, disables or removes a wireless interface.

namerequiredExact interface name
scan · registration scan_wireless_networks · get_wireless_registration_table

Scans for nearby networks with the given interface (the command blocks for the scan duration), and lists the connected clients with signal data.

interfacerequiredScan: the interface to scan with
durationoptionalScan: seconds, default 5
interfaceoptionalRegistration table: filter to one interface
Examplesscan_wireless_networks(interface="wlan1", duration=10) get_wireless_registration_table(interface="wlan1")
monitor monitor_wireless_interface · monitor_wireless_frequency

monitor_wireless_interface takes one snapshot (once) of an interface's real-time status, frequency, CCQ, noise floor and client counts. monitor_wireless_frequency shows frequency usage and noise floor across channels on legacy wireless interfaces (/interface wireless frequency-monitor); running it briefly interrupts the clients connected to that radio.

interfacerequiredWireless interface name
durationoptionalmonitor_wireless_frequency: 1 to 30 seconds, default 5
Examplesmonitor_wireless_interface(interface="wlan1") monitor_wireless_frequency(interface="wlan1", duration=5)
security profiles create_wireless_security_profile · list_wireless_security_profiles · get_wireless_security_profile · set_wireless_security_profile · remove_wireless_security_profile

RouterOS 7. Named security settings in /interface wifi security, shared by any number of interfaces. Create, list, show or remove a profile, or assign one to an interface. Passphrases are never printed by these tools.

namerequiredCreate, get, remove: the profile name
authentication_typesoptionalCreate: a list, e.g. ["wpa2-psk", "wpa3-psk"]
passphrase · commentoptionalCreate: 8 to 63 characters; description
interface_name · security_profilerequiredSet: the interface and the profile to assign
Examplescreate_wireless_security_profile(name="guest-sec", authentication_types=["wpa2-psk", "wpa3-psk"], passphrase="change-me-please") set_wireless_security_profile(interface_name="wifi1", security_profile="guest-sec")
access list create_wireless_access_list · list_wireless_access_list · remove_wireless_access_list_entry

RouterOS 7. Rules in /interface wifi access-list that accept or reject clients. A rule with neither mac_address nor interface matches every client. create_wireless_access_list returns the new rule's id, and list_wireless_access_list shows each rule with the id that remove_wireless_access_list_entry takes.

mac_addressoptionalCreate: e.g. AA:BB:CC:DD:EE:FF
actionoptionalCreate: accept (default) or reject
interface · commentoptionalCreate: limit the rule to one interface; description
entry_idrequiredRemove: the rule id, e.g. *1
Examplecreate_wireless_access_list(mac_address="AA:BB:CC:DD:EE:FF", action="reject", comment="blocked laptop")
Area · Interfaces

CAPsMAN — RouterOS 7 Wi-Fi Controller

CAPsMAN lets one router (the controller) configure the Wi-Fi of several MikroTik access points (CAPs). These tools manage the CAPsMAN of the RouterOS 7 Wi-Fi package, /interface wifi, on RouterOS 7.13 and later: the controller (/interface wifi capsman), the configuration profiles (/interface wifi configuration), the provisioning rules (/interface wifi provisioning), the access points that registered (/interface wifi capsman remote-cap), and the access point side (/interface wifi cap).

The legacy CAPsMAN of the wireless package (/caps-man) and the wifiwave2 menu of RouterOS 7.12 and earlier are not supported; on a router without /interface wifi every tool answers with an error and changes nothing. Every change is read back from the router before the tool reports success. These tools never take or print a passphrase: it lives in a security profile (see Wireless).

12 tools
category 15
4 STEPS
A controller in four steps:
  1. create_wireless_security_profile(name="sec-home", authentication_types=["wpa2-psk", "wpa3-psk"], passphrase="...")
  2. create_wifi_configuration(name="cfg-home", ssid="Home", country="Netherlands", security="sec-home", datapath_bridge="bridge1")
  3. create_wifi_provisioning_rule(action="create-dynamic-enabled", master_configuration="cfg-home", supported_bands=["5ghz-ax"])
  4. set_wifi_capsman(enabled=True, interfaces=["bridge1"], ca_certificate="auto", certificate="auto")

Then, on each access point: set_wifi_cap(enabled=True, discovery_interfaces=["bridge1"]) and update_wireless_interface(name="wifi1", configuration_manager="capsman-or-local") for each radio. A radio takes its settings from the controller only when its configuration_manager says so; list_wifi_remote_caps on the controller shows the access points that registered.

controller get_wifi_capsman · set_wifi_capsman

Shows the CAPsMAN settings (enabled, the interfaces it listens on, the certificates and the upgrade policy), or turns CAPsMAN on or off and changes them. Only the parameters you pass change.

enabledoptionalTurn CAPsMAN on or off
interfacesoptionalInterfaces or interface lists to listen on, e.g. ["bridge1"] or ["all"]; [] unsets it
ca_certificateoptionalauto lets CAPsMAN create its CA certificate, none, or a certificate name
certificateoptionalauto or a certificate name
require_peer_certificateoptionalAccept only CAPs with a certificate signed by the CA
upgrade_policyoptionalnone, suggest-same-version or require-same-version
Exampleset_wifi_capsman(enabled=true, interfaces=["bridge1"])
remote caps list_wifi_remote_caps

Lists the access points that registered with this controller (address, identity, board, serial, version, state). When there are none, it says whether CAPsMAN is turned off.

—no paramsTakes no arguments
create create_wifi_configuration

Creates a configuration profile: the settings a radio gets (SSID, country, security profile, channel and datapath). CAPsMAN hands profiles out through provisioning rules; a local radio can use one too.

namerequiredMust be unique
ssidoptionalNetwork name
countryoptionalAs RouterOS spells it, case-sensitive, e.g. Netherlands or United States
modeoptionalap, station, station-bridge or station-pseudobridge
manageroptionalWho configures a radio that uses the profile: local, capsman or capsman-or-local
securityoptionalThe name of a security profile
channel_band · channel_widthoptionale.g. 5ghz-ax; 20/40/80mhz
channel_frequencyoptionalMHz values or ranges, e.g. ["5180", "5200-5240"]
datapath_bridge · datapath_vlan_idoptionalThe bridge the client traffic joins; VLAN 1 to 4095
hide_ssid · commentoptionalHide the SSID; description
Examplecreate_wifi_configuration(name="cfg-guest", ssid="Guest", country="Netherlands", security="sec-guest", datapath_vlan_id=20)
list · update list_wifi_configurations · update_wifi_configuration

Lists the configuration profiles, or changes one; CAPsMAN pushes the change to the radios that use it. update_wifi_configuration takes name (the profile to change), new_name and the same optional fields as create_wifi_configuration; only the fields you pass change, and channel_frequency=[] unsets the frequency list.

Exampleupdate_wifi_configuration(name="cfg-home", ssid="Home-2")
remove remove_wifi_configuration

Removes a profile. RouterOS itself would remove a profile that a provisioning rule names and leave the rule pointing at nothing, so the tool refuses while a provisioning rule or a Wi-Fi interface uses the profile, and says which ones.

namerequiredThe profile to remove
provisioning create_wifi_provisioning_rule

Creates a provisioning rule, which decides which configuration a CAP's radio gets. The controller checks the rules in order and the first one that matches wins; a new rule goes last. A rule without radio_mac, identity_regexp, address_ranges or supported_bands matches every radio.

actionrequiredcreate-dynamic-enabled (the usual choice), create-enabled, create-disabled, use-network-config or none
master_configurationoptionalThe configuration profile of the radio's main interface
slave_configurationsoptionalProfiles for extra virtual APs on the same radio, e.g. ["cfg-guest"]
supported_bands · radio_macoptionalMatch radios by band, e.g. ["5ghz-ax"]; match one radio
identity_regexp · address_rangesoptionalMatch CAPs by system identity; by address, e.g. ["10.0.0.10-10.0.0.50"]
name_formatoptionalHow the created interfaces are named, e.g. cap-%I
comment · disabledoptionalDescription; create it disabled (default false)
Examplecreate_wifi_provisioning_rule(action="create-dynamic-enabled", master_configuration="cfg-home", slave_configurations=["cfg-guest"])
list · remove list_wifi_provisioning_rules · remove_wifi_provisioning_rule

Lists the rules in the order the controller checks them, each with its id, or removes one by that id.

rule_idrequiredRemove: the rule id, e.g. *1
access point get_wifi_cap · set_wifi_cap

Shows the CAP settings of this router (whether a controller manages it, how it finds one and which one it uses), or makes the router a CAP or stops it being one. Only the parameters you pass change.

enabledoptionalBe a CAP or not
discovery_interfacesoptionalWhere to look for the controller, e.g. ["bridge1"]; [] unsets it
caps_man_addressesoptionalController addresses or DNS names, for a controller that layer-2 discovery cannot reach; [] unsets it
certificateoptionalrequest asks the controller for one, none, or a certificate name
lock_to_caps_manoptionalStay with the first controller; needs a certificate
Exampleset_wifi_cap(enabled=true, discovery_interfaces=["bridge1"])
Area · Interfaces

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.

3 tools
category 16
monitor get_poe_monitor

Reads real-time PoE-out telemetry — status, voltage, current, and power — for one or more ethernet interfaces. Runs /interface ethernet poe monitor … once.

interfacesrequiredComma-separated ethernet interface name(s)
Examplesget_poe_monitor(interfaces="ether1") get_poe_monitor(interfaces="ether9-ap,ether10-ap,ether11-ap")
list list_poe

Lists the PoE-out configuration (PoE-out mode, priority) of PoE-capable ethernet interfaces. Runs /interface ethernet poe print.

interface_filteroptionalPartial name match — "ether" matches ether1, ether2 …
Exampleslist_poe() list_poe(interface_filter="ether")
get get_poe_settings

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=….

namerequiredExact ethernet interface name — "ether1"
Exampleget_poe_settings(name="ether1")
Area · IP

IP Address — IPv4 Interface Bindings

Assign and remove IPv4 addresses on physical, bridge, or VLAN interfaces. For IPv6, see IPv6 Address.

4 tools
category 17
addadd_ip_address

Bind an address to an interface.

addressrequiredCIDR, e.g. 192.168.100.1/24
interfacerequiredInterface name
commentoptionalDescription
network · broadcastoptionalManual network / broadcast overrides
disabledoptionalAdd in a disabled state
Exampleadd_ip_address(address="192.168.100.1/24", interface="vlan100")
list · getlist_ip_addresses · get_ip_address

Inspect bindings — list takes optional filters (by interface, address, network, dynamic flag, or disabled-only); get returns one address record by ID.

removeremove_ip_address
address_idrequiredRouterOS address record ID
Area · IP

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.

4 tools
category 18
add add_ipv6_address

Adds an IPv6 address to an interface. Runs /ipv6 address add ….

addressrequiredIPv6 address with prefix length — 2001:db8::1/64, fe80::1/64. With from_pool, supply the host part only (e.g. ::1/64).
interfacerequiredInterface name — ether1, bridge
advertiseoptionalInclude this prefix in Router Advertisements
eui_64optionalDerive the host part from the interface MAC
from_pooloptionalName of an IPv6 pool to take the prefix from
no_dadoptionalSkip Duplicate Address Detection
comment · disabledoptionalDescription; add in a disabled state
Examplesadd_ipv6_address(address="2001:db8:1::1/64", interface="bridge") add_ipv6_address(address="2001:db8:1::1/64", interface="bridge", advertise=true) add_ipv6_address(address="::1/64", interface="bridge", from_pool="isp-pd")
list list_ipv6_addresses

Lists IPv6 addresses, with optional filtering. Runs /ipv6 address print.

interface_filteroptionalFilter by interface
address_filteroptionalPartial match on the address — "2001:db8", "fe80"
disabled_only · dynamic_onlyoptionalOnly disabled / only dynamically-assigned addresses
global_only · link_local_onlyoptionalOnly routable addresses / only fe80::/10
Exampleslist_ipv6_addresses() list_ipv6_addresses(interface_filter="bridge") list_ipv6_addresses(global_only=true) # routable addresses only list_ipv6_addresses(link_local_only=true) # fe80::/10 only
get get_ipv6_address

Gets details for a single IPv6 address, by RouterOS id or by address value. Runs /ipv6 address print detail where ….

address_idrequiredInternal id (e.g. *1) or the address value (e.g. 2001:db8::1/64)
Exampleget_ipv6_address(address_id="2001:db8:1::1/64")
remove remove_ipv6_address

Removes an IPv6 address by id or address value. Runs /ipv6 address remove [find …].

address_idrequiredInternal id (e.g. *1) or the address value
Exampleremove_ipv6_address(address_id="2001:db8:1::1/64")
Area · IP

IP Pool — Named Address Pools

Named ranges used by DHCP, hotspot, PPP, and VPN servers. Pools can be inspected, updated, and expanded without disruption.

7 tools
category 19
createcreate_ip_pool
namerequiredPool name
rangesrequirede.g. "192.168.1.100-192.168.1.200"
next_pooloptionalChain to another pool when exhausted
commentoptionalDescription
Examplecreate_ip_pool(name="dhcp-pool", ranges="192.168.1.100-192.168.1.200")
list · get · usedlist_ip_pools · get_ip_pool · list_ip_pool_used

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 · expandupdate_ip_pool · expand_ip_pool

update edits a pool's name (rename via new_name), ranges, or next-pool chain; expand appends additional ranges without disrupting existing leases.

Exampleexpand_ip_pool(name="dhcp-pool", additional_ranges="192.168.1.201-192.168.1.250")
removeremove_ip_pool

Remove a pool. Servers using it will refuse new leases.

Area · IP

Neighbors — ARP & IPv6 ND

Read-only views of the neighbour tables: raw, detailed IPv4 ARP entries and IPv6 Neighbor Discovery entries. Useful for answering "what is on this segment, and on which port?" Address and MAC filters use substring matching; interface and status filters use exact matching.

2 tools
category 20
list list_arp_entries

Lists raw detailed IPv4 ARP entries.

address_filteroptionalIP address (substring)
mac_filteroptionalMAC address (substring)
interface_filteroptionalInterface (exact)
status_filteroptionalNeighbor status (exact)
Examplelist_arp_entries(interface_filter="bridge", status_filter="reachable")
list list_ipv6_neighbors

Lists raw detailed IPv6 Neighbor Discovery entries.

address_filteroptionalIPv6 address (substring) — "fe80" finds link-local neighbors
mac_filteroptionalMAC address (substring)
interface_filteroptionalInterface (exact)
status_filteroptionalNeighbor status (exact)
Examplelist_ipv6_neighbors(address_filter="fe80", interface_filter="bridge")
Area · IP

IP Services — Management Exposure

A read-only view over /ip service: which management services answer, on which port, and from where. This is the device's remote-management attack surface in one table.

1 tool
category 21
list list_ip_services

Lists the management services with their port and address restriction. Runs /ip service print detail. An empty address restriction (the address property, printed as available-from on RouterOS 7.25) means the service is unrestricted: on a router whose WAN holds a public address that means it is published to the internet, whether or not the port was changed from its default. Entries for the sessions open right now (flag c) are listed too. ftp deserves its own look: RouterOS also serves SFTP file transfers through the SSH service to users whose group holds the ftp policy, so the two are not the same control.

name_filteroptionalFilter by service name: winbox, ssh, api, www, www-ssl, ftp, telnet (substring match)
enabled_onlyoptionalHide the disabled services, which is the list that actually describes exposure (default false)
Exampleslist_ip_services(enabled_only=true) list_ip_services(name_filter="winbox")
Area · Monitoring

Logs — System Events

Stream and analyze RouterOS logs by topic, severity, or free-text search. Pull system events and security logs, aggregate statistics, watch for new entries, and export to a .txt file on the router.

10 tools
category 22
readget_logs · get_logs_by_severity · get_logs_by_topic · search_logs · get_system_events · get_security_logs · get_log_statistics

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. get_logs also narrows by time_filter, message_filter, and prefix_filter, and renders as plain / detail / terse via print_as.

Examplesget_logs(topics="firewall", limit=100) search_logs(search_term="login failure", case_sensitive=false)
stream · exportmonitor_logs · export_logs

monitor_logs watches for new log entries for duration seconds (default 10, capped at 60) and returns the ones that arrived. export_logs writes the logs to a .txt file on the router; filename defaults to logs_export_<timestamp> and RouterOS adds the extension.

clearclear_logs

Clears the in-memory log buffer. Doesn't affect file-backed logs.

Area · Monitoring

Netwatch — Probes and Live Status

A read-only view over /tool netwatch. A configuration export shows which probes exist; it cannot show whether a monitored host is up right now, so this tool returns both the configuration and the live state.

The three scripts of a probe are withheld by default. A probe fires commands on every transition, and those commands are a common place to find a credential in clear text, such as a bot token inside a webhook URL or an SMTP password= on an alert mail. Set include_source=true only when you intend to read them; the output is redacted either way, but redaction is pattern-based and is not a guarantee. A probe with no src-address follows whichever WAN is active, so it keeps reporting across a failover; one pinned to a source address reports that path only.

1 tool
category 23
list list_netwatch

Lists the netwatch probes with their live status and measurements. Runs /tool netwatch print detail, then reads the live state with a second command. The answer has two blocks: the configuration, then a LIVE STATE block with status, since (the time of the last transition) and, on an ICMP probe, the last test's rtt-avg, loss-percent and failed-tests. Match the blocks by host, or by the .id the live block carries. If the live state cannot be read, the configuration is still returned.

host_filter · comment_filteroptionalFilter by host or comment (substring match)
status_filteroptionale.g. down to list only what is currently failing (exact match)
type_filteroptionalProbe type, e.g. icmp (exact match)
include_sourceoptionalInclude up-script, down-script and test-script (default false)
Exampleslist_netwatch(status_filter="down") list_netwatch(host_filter="1.1.1.1", type_filter="icmp")
Area · Monitoring

Diagnostics — Ping, Traceroute, Torch

Bounded diagnostic commands run on the router: ping, traceroute, torch, a quick packet capture and a CPU profile. None of them changes the configuration, so all are annotated READ and stay available with --read-only. The four that reach outside the router or observe live traffic are also marked open-world.

They need RouterOS user policies beyond read. A group for an assistant that may diagnose but not change anything: /user group add name=mcp policy=ssh,read,api,test,sniff. Without the policy the router answers not enough permissions, which the tool returns as a failure.

5 tools
category 24
ToolRouterOS commandPolicy needed
ping/pingtest
traceroute/tool traceroutetest
torch/tool torchsniff
sniff_packets/tool sniffer quicksniff
profile_cpu/tool profileread
read ping

Pings an IPv4/IPv6 address or host name from the router. Runs /ping.

addressrequiredIPv4/IPv6 address or host name
countoptional1 to 20, default 4
sizeoptionalPacket size in bytes
intervaloptionale.g. 200ms, 1s
src_address · interface · routing_table · ttloptionalSource address, interface, routing table and TTL of the probes
do_not_fragmentoptionalCombine with size to probe the path MTU
arp_pingoptionalSend ARP requests instead of ICMP (needs interface)
Examplesping(address="1.1.1.1", count=4) ping(address="203.0.113.10", size=1500, do_not_fragment=true)
read traceroute

Traces the route from the router to an IPv4/IPv6 address or host name. Runs /tool traceroute.

addressrequiredIPv4/IPv6 address or host name
countoptionalProbes per hop, 1 to 5
max_hopsoptionalDefault 30
protocoloptionalicmp (default) or udp, with port for UDP
size · timeoutoptionalProbe size; per-probe timeout, e.g. 500ms
src_address · interface · routing_tableoptionalSource address, interface and routing table
use_dnsoptionalResolve hop names (default off)
Exampletraceroute(address="8.8.8.8", max_hops=12)
read torch

Shows live traffic rates per flow on an interface for a few seconds. Runs /tool torch. Each filter both filters and breaks the table down by that field; with no filter, flows are broken down by IPv4 source and destination address and by IP protocol. While torch runs, RouterOS turns fasttrack off, which raises CPU load on a busy router.

interfacerequiredInterface to watch
durationoptional1 to 30 seconds, default 5; RouterOS prints the first frame after two seconds, so a duration under 3 runs for 3
src_address · dst_addressoptionalIPv4 filter; 0.0.0.0/0 lists every address
src_address6 · dst_address6optionalIPv6 filter; ::/0 lists every address
ip_protocol · port · mac_protocol · vlan_id · dscpoptionalProtocol, one port or any, MAC protocol, VLAN and DSCP
Examplestorch(interface="ether1", duration=5) torch(interface="ether1", ip_protocol="tcp", port="443")
read sniff_packets

Captures packet headers for a few seconds with the quick packet sniffer. Runs /tool sniffer quick. Shows headers only (interface, direction, MACs, VLAN, addresses and ports, protocol, size, CPU); nothing is saved on the router.

interfaceoptionalAll interfaces when omitted
durationoptional1 to 30 seconds, default 5
ip_addressoptionalMatches source or destination
ip_protocol · mac_addressoptionalProtocol and MAC address filters
portoptional53, 80,443 or 1000-2000
Examplesniff_packets(interface="ether1", port="53", duration=5)
read profile_cpu

Shows which RouterOS processes use the CPU, sampled over a few seconds. Runs /tool profile.

durationoptional1 to 30 seconds, default 5; the table per core (all or a core number) comes after two seconds, so a duration under 3 runs for 3
cpuoptionaltotal (default), all for one column per core, or a core number
Exampleprofile_cpu(duration=5)
Area · Queue

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, …).

19 tools
category 25
simple queuecreate_simple_queue · list_simple_queues · get_simple_queue · update_simple_queue · remove_simple_queue · enable_simple_queue · disable_simple_queue

Per-target rate limits — the simplest way to throttle a host or subnet. max_limit takes an upload/download pair like "10M/20M".

Example — limit a host to 10M/20Mcreate_simple_queue(name="limit-guest", target="192.168.100.0/24", max_limit="10M/20M")
queue treecreate_queue_tree · list_queue_trees · get_queue_tree · update_queue_tree · remove_queue_tree · enable_queue_tree · disable_queue_tree

Hierarchical HTB shaping. Attach to a parent, match traffic by packet_mark, set max_limit / limit_at / burst, and priority (1–8).

queue typecreate_queue_type · list_queue_types · get_queue_type · update_queue_type · remove_queue_type

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. update_queue_type changes the CAKE and PCQ parameters; kind and the pfifo, bfifo, sfq, fq_codel and red parameters cannot be changed there, so create a new queue type with create_queue_type.

Area · Routing

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.

14 tools
category 26
createadd_route · add_default_route · add_blackhole_route

Three flavors of route creation. add_route takes dst_address + gateway (plus optional distance, scope, routing_table, pref_src, check_gateway, …). On RouterOS 7 the routing table is named via routing_table (a name from /routing table); RouterOS 6 called this the routing mark. Listing and path checks use routing_table_filter / routing_table to match.

Examplesadd_default_route(gateway="192.168.1.1", distance=1) add_route(dst_address="10.0.0.0/8", gateway="192.168.1.254")
readlist_routes · get_route · check_route_path · get_routing_table · get_route_cache · get_route_statistics

Inspect the routing table from several angles: list all, single route, path check (which route MikroTik would use to reach a destination), full table dump (table_name defaults to "main"), the kernel route cache, and aggregate statistics.

Examplecheck_route_path(destination="8.8.8.8")
update · toggle · flushupdate_route · enable_route · disable_route · flush_route_cache

Edit a route in place, toggle individual routes by ID, or flush the route cache.

removeremove_route
route_idrequiredRouterOS route ID
Area · System

System — Resource, Health, Clock, Packages

Read-only views over /system: what the board is, how it is doing and which RouterOS it runs. They answer the questions an export header only hints at (model, serial, version) and the ones it cannot carry at all: uptime, CPU and memory load, board voltage and temperature, and whether a newer release is available.

6 tools
category 27
get get_system_resource

Reports uptime, RouterOS version, board name, architecture, CPU and memory. Runs /system resource print. free-memory against total-memory, and cpu-load, are the two numbers worth reading before blaming the network for a slow device. No parameters.

Exampleget_system_resource()
get get_system_health

Reports the board sensors: voltage, temperature, fan and PSU state. Runs /system health print. Many boards carry no sensors at all and legitimately report nothing; the tool then answers that no health sensors were reported, which means “this model does not measure it”, not “the reading failed”. No parameters.

Exampleget_system_health()
get get_system_clock

Reports the device clock, time zone and DST setting. Runs /system clock print. Log timestamps are only as trustworthy as this: a device without a working time source dates its own evidence wrongly, which matters when correlating an incident across sites. No parameters.

Exampleget_system_clock()
get get_system_routerboard

Reports the model, serial number and bootloader firmware revision. Runs /system routerboard print. current-firmware against upgrade-firmware is the RouterBOOT bootloader, which is upgraded separately from RouterOS and is easy to leave behind after a package upgrade. Devices that are not a RouterBOARD, such as a CHR, answer that no RouterBOARD information is available. No parameters.

Exampleget_system_routerboard()
list list_system_packages

Lists the installed RouterOS packages and which are disabled. Runs /system package print. No parameters.

Examplelist_system_packages()
get get_system_package_update

Reports the installed RouterOS version against the latest on its update channel. Runs /system package update print. This reads the stored result of the last check and does not contact MikroTik, so latest-version can be stale or empty on a device that has never checked or cannot reach the update server. No parameters.

Exampleget_system_package_update()
Area · System

Scheduler — Tasks and Scripts

Read-only views over /system scheduler and /system script. Script bodies and the on-event commands of a scheduler are withheld by default: a stored RouterOS script is a common place to find a credential in clear text, such as an FTP password for a backup job or an SMTP login for an alert. Pass include_source=true when you need the code; the output is then passed through the server's redaction, which only recognises labelled secrets and is not a guarantee.

2 tools
category 28
list list_schedulers

Lists the scheduled tasks with their interval, next run and run count. Runs /system scheduler print detail. Read next-run together with interval: a scheduler whose run-count is not advancing is firing into a script that errors out. RouterOS does not surface that here; it shows up in the log under the script topic.

name_filteroptionalFilter by name (substring match)
include_sourceoptionalInclude the on-event commands, which can carry a bot token or a password inside a URL (default false)
Exampleslist_schedulers() list_schedulers(name_filter="backup", include_source=true)
list list_scripts

Lists the stored scripts: owner, policy, run count and last start. Runs /system script print detail. policy is what the script may do when it runs, which can exceed what the user who scheduled it may do interactively.

name_filteroptionalFilter by name (substring match)
include_sourceoptionalInclude the script body (default false)
Exampleslist_scripts() list_scripts(name_filter="failover", include_source=true)
Area · System

Backup & Export — Configuration State

Binary backups, RouterOS .rsc exports, section dumps, file transfer, restore, and import.

10 tools
category 29
createcreate_backup · create_export · export_section

Three formats: a binary .backup (full snapshot), a .rsc export (declarative, choose rsc/json/xml and full/compact/verbose), or a single-section dump. export_section is a genuine read — it returns the section as an export script straight from the device without writing anything to storage, so it works on read-only accounts (policy=ssh,read). Its section is a menu path without the leading slash, and hide_sensitive defaults to true. To produce an export file on the device, use create_export instead.

Examplecreate_backup(name="pre-change") export_section(section="ip firewall filter")
readlist_backups · backup_info · download_file

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 · import · uploadrestore_backup · import_configuration · upload_file

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.

removeremove_file

Removes any file from the device's filesystem.

Area · Users

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.

18 tools
category 30
createadd_user · add_user_group

Create users and permission groups. Groups take a policy list (e.g. read,write,ssh).

Exampleadd_user(name="automation", password="SecurePass123", group="write")
readlist_users · get_user · list_user_groups · get_user_group · get_active_users

Inspect users, groups, and currently-connected sessions.

update · toggleupdate_user · enable_user · disable_user · update_user_group · disconnect_user

Edit users / groups, toggle accounts, or forcibly disconnect an active session.

ssh keysset_user_ssh_keys · list_user_ssh_keys · remove_user_ssh_key

Import a user's SSH public key (key-based auth), list installed keys, or remove one by ID.

Exampleset_user_ssh_keys(username="automation", key_file="id_ed25519.pub")
exportexport_user_config

Dumps the full user / group configuration to a file.

removeremove_user · remove_user_group

Remove a user or a group.

Area · VPN

IPsec — Peers, Policies and Tunnel State

Read-only views over the IPsec subsystem (/ip ipsec): which peers, policies, profiles and proposals are configured, and the live state of the tunnels. Output is returned as RouterOS prints it, including the Flags legend.

/ip ipsec identity is deliberately not exposed: its print detail output carries secret= in clear text, and no read tool should be able to surface a pre-shared key. Peers, policies, profiles and proposals show the same topology without the credential.

6 tools
category 31
list list_ipsec_peers

Lists the configured IPsec peers. Runs /ip ipsec peer print detail.

name_filter · address_filteroptionalFilter by peer name or address (substring match)
Examplelist_ipsec_peers(name_filter="branch")
list list_ipsec_policies

Lists the IPsec policies with their phase 2 state. Runs /ip ipsec policy print detail. The Flags legend separates configured policies from the ones a peer generated at runtime (D), and ph2-state says whether the child SA is established. A policy whose selectors do not match the far end's is the usual cause of a tunnel that comes up and passes nothing.

peer_filteroptionalFilter by peer name (substring match)
src_address_filter · dst_address_filteroptionalFilter by selector (substring match). These are the encapsulated subnets, not the tunnel endpoints
Examplelist_ipsec_policies(dst_address_filter="10.20.0.0/24")
list list_ipsec_profiles

Lists the IPsec profiles (phase 1: DH group, hash, encryption, lifetime, DPD). Runs /ip ipsec profile print detail. The phase 1 lifetime must be longer than the phase 2 lifetime on the proposal, so the child SA rekeys inside a live parent SA; equal lifetimes tear the tunnel down on every rekey. dpd-interval multiplied by dpd-maximum-failures is how many seconds of silence the peer tolerates.

name_filteroptionalFilter by profile name (substring match)
Examplelist_ipsec_profiles()
list list_ipsec_proposals

Lists the IPsec proposals (phase 2: encryption, authentication, PFS, lifetime). Runs /ip ipsec proposal print detail. Compare lifetime against the phase 1 lifetime on the profile, and against whatever the far end proposes; a cloud provider's own SA lifetime counts as a third value.

name_filteroptionalFilter by proposal name (substring match)
Examplelist_ipsec_proposals(name_filter="default")
get get_ipsec_active_peers

Lists the peers with a live IKE session, with uptime and counters. Runs /ip ipsec active-peers print detail. This is the parent (phase 1) side: state, uptime, last-seen and the byte counters. A peer can sit here established while its child SAs carry nothing; use get_ipsec_installed_sa to tell the difference.

remote_address_filteroptionalFilter by remote address (exact match)
state_filteroptionalFilter by session state, e.g. established (exact match)
Exampleget_ipsec_active_peers(state_filter="established")
get get_ipsec_installed_sa

Lists the installed security associations (child, phase 2 SAs). Runs /ip ipsec installed-sa print detail. The Flags legend is the point of this view: S (SEEN-TRAFFIC) is the only field that separates an SA carrying traffic from one that is merely installed, H means the cipher runs in hardware and E means ESP. A missing S can mean idle, not broken: put traffic over the selector before concluding anything. Once a peer has several child SAs, per-SA counters do not map onto policies, so watch which counters move under traffic you control instead of pairing SAs by hand.

src_address_filter · dst_address_filteroptionalFilter by SA endpoint (substring match). These are the tunnel endpoints (public addresses); behind NAT-T they carry the port, e.g. 198.51.100.2:4500
Exampleget_ipsec_installed_sa(dst_address_filter="198.51.100.2")
REMEMBER
Every tool takes typed JSON arguments and returns text. Models that don't natively support function calling can still invoke them via JSON-mode prompts — the input schemas are introspectable through the MCP handshake. See the Examples page for end-to-end workflows.