Skip to content

v1.17.0

Choose a tag to compare

@github-actions github-actions released this 21 Nov 14:10
· 11 commits to main since this release
be5ee4e

Change safety: firewall writes revert themselves if they cut the router off, confirmation tokens and plans are tied to the state that was previewed, and every write says whether it was applied and whether it can be undone. SwOS Lite VLAN decoding and a guard on management-address writes come from @f0086's CSS610 lockout report.

Upgrading from 1.16. manage_firewall_rule real writes now add a /system scheduler job, so the router user needs write access to the scheduler; without it the call fails with AUTO_REVERT_ARM_FAILED and changes nothing. Pass autoRevertSeconds: 0 to write without the job, as before. write_swos_blob now refuses a real sys.b write that changes how the switch is reached unless includeManagement: true is passed. Confirmation tokens issued by an older version are refused as expired; request a new one.

Security

  • A confirmation token now approves the state that was previewed, not just the request. The signed payload carries a fingerprint of the configuration under the tool's snapshot paths (dynamic records dropped unless the call acts on them, as manage_dhcp_lease make-static does; counters and status fields left out; record order kept), read when the token is issued and again when it is used. If someone edits, inserts or removes a record in that section in between, the call is refused with CONFIRMATION_STATE_CHANGED (category CONFLICT) and nothing is written; before, the old token still validated, so approving one preview could authorize a different diff. bulk_execute fleet tokens bind every targeted router's state the same way (a router whose state cannot be read is skipped with STATE_UNREADABLE, never written unpreviewed), and an apply_plan token binds every step's paths. SwOS switches and set_system_clock are not covered (their state changes on its own). Tokens issued before upgrading are refused as expired; request a new one.
  • Confirmation tokens now carry a random nonce, so two identical requests in the same millisecond get distinct single-use tokens instead of one shared token the second caller finds already used.

Added

  • Every real write response now carries a rollback field saying whether rollback_change can undo it: { available: true, journalId, snapshotted } after a snapshotted write, or { available: false, reason, detail } with NO_SNAPSHOT (the tool takes no snapshot, as run_command never does) or SNAPSHOT_FAILED; the text adds a "Not undoable with rollback_change" line. Before, a missing journalId could mean either, so there was no way to tell whether an undo existed without trying it. Dry runs, plan_changes, apply_plan and rollback_change are left out. The Available-Tools page now lists the write tools that take no snapshot (#156).
  • list_routers rows carry rosVersionSeen and rosVersionSeenAt once get_system_status or check_router_health has reached a RouterOS router: the version the router itself reported to this server, shown next to the rosVersion from routers.yaml, which can lag an upgrade and is still what picks version-dependent REST paths. The observation is kept in memory only (absent after a restart), is dropped when the router's host changes, and is never set for SwOS switches (#152).
  • Every write-tool response now carries an applied boolean: true when the call ran its write path, false on a dry run, which also leads its text with NOT APPLIED — dry run only. Pass dryRun: false to write this change. The verdict is injected centrally in the tool executor, so it covers every write tool (RouterOS and SwOS) uniformly — including write_swos_blob, whose dryRun defaults to true (preview first) and whose dry-run output could otherwise be mistaken for a write (#140). plan_changes, which previews writes without making them, reports applied: false itself.
  • plan_changes returns a planFingerprint (and a stateFingerprint per step), and apply_plan takes it as an optional planFingerprint parameter. With it, apply_plan checks before the first step that the steps are the previewed ones (PLAN_MISMATCH) and that the configuration they touch is unchanged since the preview (PLAN_STATE_CHANGED), for every role — the drift check admins get, since they skip confirmation tokens.
  • Auto-revert for manage_firewall_rule, a dead-man switch that stands in for RouterOS Safe Mode, which the REST API cannot use. Before a real write, MikroMCP adds a mikromcp-autorevert-<id> scheduler job that undoes the change after autoRevertSeconds (default 60; 0 turns it off): it removes an added rule, re-adds a removed one at its old position, or flips disabled back. The job's first run is set from the router's clock, because a scheduler entry with only an interval first runs as soon as it is added. After the write, MikroMCP waits 3 seconds for the change to take effect (with connection tracking on auto, a CHR only starts tracking a moment after the first rule that needs it), then opens a new REST connection to the router. If the router answers, the job is removed; if it does not, the job stays, the router reverts itself, and the call fails with AUTO_REVERT_PENDING. The job's state is reported in the result's autoRevert, in error details, and in the write journal's outcome entry, including for manage_firewall_rule steps in apply_plan. Dry runs, already_exists and no_change arm nothing.

Changed

  • The HTTP rate limit now says what it is. Every response on /mcp, /sse and /messages carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset; a 429 adds a Retry-After header with the seconds left in the window (it used to say "retry after 60 seconds" whatever was left), and its JSON body now names the limit (limit, retryAfterSeconds) and a hint: raise MIKROMCP_HTTP_RATE_LIMIT_RPM (0 turns it off), send one filtered query instead of many, or use bulk_read for many routers. No headers are sent when the limit is off. The limit itself is unchanged (60 requests per 60 seconds per client IP) and is now described in the Running and Configuration pages (#148).
  • run_command with dryRun: true now says what it checked: the result carries validated: "policy" and syntaxChecked: false, and its text states that only the allow/deny policy was checked, not the syntax, the names the command refers to or what a [find ...] matches. Before, the response gave no hint, so a dry run that passed read as "this will work"; a command with an unquoted port name containing brackets passes it and may do nothing when run. The dryRun description and the Available-Tools entry say the same (#154).
  • write_swos_blob refuses a real write to sys.b that changes how the switch is reached (ip, static_ip, addr_acq, allow_from_ip, allow_from_mask, allow_from_vlan, allow_from_ports) with SWOS_MANAGEMENT_CHANGE_REFUSED unless the new includeManagement parameter is true, the gate apply_swos_config already had. A dry run previews it without the flag. The preview and the write return warnings: static_ip and addr_acq are stored configuration that left the live address unchanged on SwOS Lite 2.21 (only writing ip moved it), and an allow_from_* change cuts off any session that does not match it, the writing one included. list_swos_endpoints now returns a notes entry per field that has one, such as ip (live) versus static_ip (stored). Calls that write these fields for real need includeManagement: true from now on (#142).
  • manage_firewall_rule now needs write access to /system scheduler for real writes: if the auto-revert job cannot be added, the call fails with AUTO_REVERT_ARM_FAILED and changes nothing. Pass autoRevertSeconds: 0 to write without the job, as before.

Fixed

  • manage_dhcp_lease with action: "make-static" now converts the lease. It used to patch the lease's dynamic flag, which RouterOS treats as read-only, so every real call failed with HTTP 400 "unknown parameter dynamic" and left the lease dynamic (the dry run looked fine). It now runs RouterOS's make-static command on the lease (POST ip/dhcp-server/lease/make-static with its .id) (#158).
  • get_swos_endpoint now decodes vlan.b on SwOS Lite: each row gives vid, members (one flag per port) and igmp (IGMP snooping) instead of only raw keys. The layout (i01 = VLAN ID, i02 = member ports, i03 = IGMP snooping) was matched against the web UI on one CSS610 running SwOS Lite 2.21. Reading the table also makes the lockout analysis in apply_swos_config see the real VLAN membership on SwOS Lite. Writing the VLAN table on SwOS Lite is still unsupported (#146).
  • reboot with a delay above 0 now pins the mikromcp-reboot scheduler entry's first run instead of leaving it to the router: the entry had only an interval, and RouterOS documents a new entry's start-date/start-time as defaulting to the moment it is added (RouterOS 7.23 then runs it one interval later, but that placement is not documented). start-date/start-time are now set from the router clock plus delay (ISO and mmm/dd/yyyy date formats) and returned as startDate/startTime. If the clock cannot be read, the call fails with REBOOT_CLOCK_UNREADABLE and leaves any pending delayed reboot in place.