@usex/mikrotik-mcp 6.14.0 → 6.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/cli.js +3366 -527
  2. package/dist/index.d.ts +115 -101
  3. package/dist/index.js +24 -10
  4. package/dist/shared/cli-8hn9vb7c.js +115 -0
  5. package/dist/shared/{cli-rcx7e9h4.js → cli-8j89p9xc.js} +4 -2
  6. package/dist/shared/cli-kb8zq3rx.js +9 -0
  7. package/dist/shared/{cli-w6km895r.js → cli-p7bt2fa3.js} +1 -1
  8. package/dist/shared/{cli-4xzq2n6j.js → cli-rmtax5nd.js} +1 -1
  9. package/dist/shared/{cli-r1ng5cjy.js → cli-rs00sr7q.js} +1 -1
  10. package/dist/shared/{cli-1vn2bbpy.js → cli-vf68spka.js} +5115 -1935
  11. package/dist/shared/cli-znnh8xtd.js +15 -0
  12. package/dist/shared/{library-1swafsvq.js → library-m6wrdeqa.js} +1 -1
  13. package/dist/shared/{library-0qn06vwr.js → library-nbtg49vh.js} +1 -1
  14. package/dist/shared/{library-1nhmbsv0.js → library-rc32xwsh.js} +1 -1
  15. package/dist/shared/{library-2wd7mt3g.js → library-rrzzp9qg.js} +4786 -1581
  16. package/dist/shared/{library-jpmbkkz7.js → library-s31n8vk4.js} +1 -1
  17. package/dist/ui/observability.html +296 -124
  18. package/package.json +25 -17
  19. package/schemas/README.md +5 -5
  20. package/schemas/config.schema.json +288 -6
  21. package/schemas/devtools-manifest.json +301 -5
  22. package/schemas/tool-catalog.json +1116 -42
  23. package/schemas/tools/add_alert_rule.json +1 -1
  24. package/schemas/tools/apply_config_template.json +56 -0
  25. package/schemas/tools/apply_wireless_to_wifi_migration.json +30 -0
  26. package/schemas/tools/deploy_container_stack.json +112 -0
  27. package/schemas/tools/design_zone_firewall.json +81 -0
  28. package/schemas/tools/discover_unmanaged_devices.json +49 -0
  29. package/schemas/tools/enrol_device.json +56 -0
  30. package/schemas/tools/expire_wireguard_users.json +19 -0
  31. package/schemas/tools/export_logs.json +2 -1
  32. package/schemas/tools/find_tools.json +1 -1
  33. package/schemas/tools/firmware_check.json +0 -5
  34. package/schemas/tools/firmware_post_upgrade.json +29 -0
  35. package/schemas/tools/firmware_repo_fetch.json +30 -0
  36. package/schemas/tools/firmware_repo_list.json +7 -0
  37. package/schemas/tools/firmware_stage_from_repo.json +19 -0
  38. package/schemas/tools/follow_ipv6_prefix.json +51 -0
  39. package/schemas/tools/generate_hotspot_vouchers.json +37 -1
  40. package/schemas/tools/get_container_logs.json +20 -0
  41. package/schemas/tools/get_logs.json +2 -1
  42. package/schemas/tools/get_logs_by_severity.json +2 -1
  43. package/schemas/tools/get_logs_by_topic.json +2 -1
  44. package/schemas/tools/get_security_logs.json +2 -1
  45. package/schemas/tools/get_system_events.json +2 -1
  46. package/schemas/tools/list_config_templates.json +7 -0
  47. package/schemas/tools/list_voucher_batches.json +7 -0
  48. package/schemas/tools/list_wireguard_users.json +12 -0
  49. package/schemas/tools/onboard_wireguard_user.json +17 -2
  50. package/schemas/tools/plan_wireless_to_wifi_migration.json +14 -0
  51. package/schemas/tools/protect_hotspot_login.json +32 -0
  52. package/schemas/tools/remove_config_template.json +14 -0
  53. package/schemas/tools/remove_threat_feed.json +1 -0
  54. package/schemas/tools/remove_voucher_batch.json +24 -0
  55. package/schemas/tools/remove_zone_firewall.json +14 -0
  56. package/schemas/tools/revoke_wireguard_user.json +1 -0
  57. package/schemas/tools/run_routeros_command.json +6 -1
  58. package/schemas/tools/save_config_template.json +20 -0
  59. package/schemas/tools/search_logs.json +2 -1
  60. package/schemas/tools/subscribe_threat_feed.json +1 -0
  61. package/schemas/tools/test_alert_channel.json +1 -1
  62. package/schemas/tools/unfollow_ipv6_prefix.json +18 -0
  63. package/schemas/tools/unprotect_hotspot_login.json +7 -0
  64. package/schemas/tools/update_alert_rule.json +1 -1
  65. package/schemas/tools/upgrade_container_image.json +29 -0
  66. package/schemas/tools/validate_routeros_command.json +13 -0
  67. package/scripts/service.ts +242 -34
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "version": "6.14.0",
3
+ "version": "6.16.0",
4
4
  "generated": "by scripts/gen-schemas.ts — do not edit by hand",
5
- "toolCount": 983,
5
+ "toolCount": 1009,
6
6
  "tools": [
7
7
  {
8
8
  "name": "create_client_check",
@@ -1715,7 +1715,7 @@
1715
1715
  "idempotentHint": true,
1716
1716
  "openWorldHint": false
1717
1717
  },
1718
- "description": "🔍 START HERE — this is the PRIMARY entry point for ANY MikroTik / RouterOS task. ALWAYS call this tool FIRST before attempting any other tool. This server has several hundred dedicated tools with full validation and structured output, but the host only surfaces a small subset — this tool searches the FULL catalog and finds the best match for your intent.\n\nDescribe what you want to do in natural language or keywords, e.g. 'block a LAN client by MAC', 'add an IPv4 firewall filter rule', 'import a TLS certificate', 'list DHCP leases', 'create a WireGuard peer'. Returns each match's exact tool name, description, parameters and a ready-to-run `invoke_tool` call.\n\nWorkflow: find_tools → (optional) describe_tool → invoke_tool. Only if this search returns zero results, run a raw command with `invoke_tool {\"name\":\"run_routeros_command\",\"arguments\":{\"command\":\"…\"}}`. For IPv4 vs IPv6, include 'ipv4' or 'ipv6' to disambiguate. For authorized changes that must be coordinated across multiple routers, search 'begin_transaction' BEFORE individual write tools (VPN tunnels, peering, routes or fleet ACLs). Discovery does not authorize verify_transaction or commit_transaction.",
1718
+ "description": "🔍 START HERE — this is the PRIMARY entry point for ANY MikroTik / RouterOS task. ALWAYS call this tool FIRST before attempting any other tool. A tool that is not in your tool list is NOT missing: this server has about a thousand tools and every one of them runs through `invoke_tool`. Never say a tool is unavailable before this search returned nothing.\n\nDescribe what you want to do in your own words, IN ENGLISH: the search reads English only, so translate a request the user wrote in another language. E.g. 'block a LAN client by MAC', 'change the nameservers the router uses', 'import a TLS certificate', 'list DHCP leases', 'create a WireGuard peer'. The search matches words AND meaning, so you do not need the tool's own terms. Returns a short list: each tool's exact name and one line on what it is for (no schemas). When it is sure of the best match it adds that tool's parameters and a ready call.\n\nWorkflow: find_tools → describe_tool (for the tool you picked) → invoke_tool. Only if this search returns zero results, run a raw command with `invoke_tool {\"name\":\"run_routeros_command\",\"arguments\":{\"command\":\"…\"}}`. For IPv4 vs IPv6, include 'ipv4' or 'ipv6' to disambiguate. For authorized changes that must be coordinated across multiple routers, search 'begin_transaction' BEFORE individual write tools (VPN tunnels, peering, routes or fleet ACLs). Discovery does not authorize verify_transaction or commit_transaction.",
1719
1719
  "inputSchema": {
1720
1720
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1721
1721
  "type": "object",
@@ -1723,7 +1723,7 @@
1723
1723
  "query": {
1724
1724
  "type": "string",
1725
1725
  "minLength": 1,
1726
- "description": "What you want to do, in words or keywords (e.g. 'add ipv4 nat masquerade rule')."
1726
+ "description": "What you want to do, in English words or keywords (e.g. 'add ipv4 nat masquerade rule'). Translate a request in another language to English first."
1727
1727
  },
1728
1728
  "limit": {
1729
1729
  "description": "Max results to return (default 8).",
@@ -1768,7 +1768,7 @@
1768
1768
  "destructiveHint": false,
1769
1769
  "openWorldHint": false
1770
1770
  },
1771
- "description": "Execute ANY tool in the catalog by its exact name with the given arguments — the way to run a tool you found via find_tools when it is not in your tool list. The call goes through the same pipeline as a direct call: the same schema validation, access and risk checks, safety guards and audit record (saved under the target tool's own name and Tool call ID). Put the target's arguments in `arguments`, exactly as describe_tool lists them — including `reason` when the target requires it. To choose a device, set `device` on THIS call or inside `arguments`. Unknown argument names are rejected, not ignored. If validation fails you get the expected parameters back; fix and retry.",
1771
+ "description": "Execute ANY tool in the catalog by its exact name with the given arguments — the way to run a tool you found via find_tools when it is not in your tool list. A tool that is not in your tool list is NOT missing; it runs here. The call goes through the same pipeline as a direct call: the same schema validation, access and risk checks, safety guards and audit record (saved under the target tool's own name and Tool call ID). Put the target's arguments in `arguments`, exactly as describe_tool lists them — including `reason` when the target requires it. To choose a device, set `device` on THIS call or inside `arguments`. Unknown argument names are rejected, not ignored. If validation fails, nothing runs and you get every parameter of the tool back with its description: correct the arguments and call again.",
1772
1772
  "inputSchema": {
1773
1773
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1774
1774
  "type": "object",
@@ -2336,7 +2336,7 @@
2336
2336
  "properties": {
2337
2337
  "channel": {
2338
2338
  "type": "string",
2339
- "enum": ["slack", "discord", "ntfy", "webhook", "mcp"],
2339
+ "enum": ["slack", "discord", "ntfy", "telegram", "email", "webhook", "mcp"],
2340
2340
  "description": "Which configured channel to test."
2341
2341
  }
2342
2342
  },
@@ -2371,7 +2371,7 @@
2371
2371
  "type": "array",
2372
2372
  "items": {
2373
2373
  "type": "string",
2374
- "enum": ["slack", "discord", "ntfy", "webhook", "mcp"]
2374
+ "enum": ["slack", "discord", "ntfy", "telegram", "email", "webhook", "mcp"]
2375
2375
  },
2376
2376
  "description": "Where to deliver."
2377
2377
  },
@@ -2425,7 +2425,7 @@
2425
2425
  "type": "array",
2426
2426
  "items": {
2427
2427
  "type": "string",
2428
- "enum": ["slack", "discord", "ntfy", "webhook", "mcp"]
2428
+ "enum": ["slack", "discord", "ntfy", "telegram", "email", "webhook", "mcp"]
2429
2429
  }
2430
2430
  },
2431
2431
  "severity": {
@@ -2508,7 +2508,7 @@
2508
2508
  "destructiveHint": false,
2509
2509
  "openWorldHint": false
2510
2510
  },
2511
- "description": "⚠️ LAST RESORT — do NOT call this tool directly. ALWAYS call `find_tools` first to locate the dedicated tool for your task, then run it via `invoke_tool`. Dedicated tools provide schema validation, structured output, and accurate risk annotations that this raw command lacks. Only use this tool when `find_tools` returned zero results for your query AND you are certain no dedicated tool exists.\n\nWhen you do use it: pass one RouterOS CLI command exactly as typed in the terminal. The command is executed as-is with NO validation — it can be destructive, so review carefully. Runs one command per call; call again with `… print` to verify a change. For multi-command scripts use add_script + run_script instead.",
2511
+ "description": "⚠️ LAST RESORT — do NOT call this tool directly. ALWAYS call `find_tools` first to locate the dedicated tool for your task, then run it via `invoke_tool`. Dedicated tools provide schema validation, structured output, and accurate risk annotations that this raw command lacks. Only use this tool when `find_tools` returned zero results for your query AND you are certain no dedicated tool exists.\n\nWhen you do use it: pass one RouterOS CLI command exactly as typed in the terminal. The command is executed as-is with NO validation — it can be destructive, so review carefully. By default the command is first parsed on the router WITHOUT running it; a command the router does not know (a wrong menu, a misspelled parameter, RouterOS v6 syntax) is refused with the place of the problem, and nothing runs. Runs one command per call; call again with `… print` to verify a change. For multi-command scripts use add_script + run_script instead.",
2512
2512
  "inputSchema": {
2513
2513
  "$schema": "https://json-schema.org/draft/2020-12/schema",
2514
2514
  "type": "object",
@@ -2516,6 +2516,34 @@
2516
2516
  "command": {
2517
2517
  "type": "string",
2518
2518
  "description": "Full RouterOS CLI command exactly as typed, e.g. '/ip address print'"
2519
+ },
2520
+ "check_syntax": {
2521
+ "default": true,
2522
+ "description": "Parse the command on the router first and refuse it when it is not valid",
2523
+ "type": "boolean"
2524
+ }
2525
+ },
2526
+ "required": ["command", "check_syntax"],
2527
+ "additionalProperties": false
2528
+ }
2529
+ },
2530
+ {
2531
+ "name": "validate_routeros_command",
2532
+ "title": "Validate a RouterOS Command (no execution)",
2533
+ "risk": "read",
2534
+ "annotations": {
2535
+ "readOnlyHint": true,
2536
+ "idempotentHint": true,
2537
+ "openWorldHint": false
2538
+ },
2539
+ "description": "Checks RouterOS CLI text on the router WITHOUT running it. The router's own parser compiles the text (`:parse`) and reports the first problem with its line and column: an unknown menu, a misspelled parameter, a syntax error, or RouterOS v6 syntax on a v7 router. Use it before you run or propose a command or a script you wrote yourself, so a wrong command is caught before it reaches a change. The answer is exact for that router's RouterOS version and packages. It does NOT check values that are only looked up at run time (an interface that does not exist, an address already in use). Accepts one command or a multi-line script. Returns 'valid' or the problem and where it is.",
2540
+ "inputSchema": {
2541
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
2542
+ "type": "object",
2543
+ "properties": {
2544
+ "command": {
2545
+ "type": "string",
2546
+ "description": "A RouterOS command, or a script of several lines"
2519
2547
  }
2520
2548
  },
2521
2549
  "required": ["command"],
@@ -4385,6 +4413,69 @@
4385
4413
  "additionalProperties": false
4386
4414
  }
4387
4415
  },
4416
+ {
4417
+ "name": "plan_wireless_to_wifi_migration",
4418
+ "title": "Plan the Move From 'wireless' to 'wifi'",
4419
+ "risk": "read",
4420
+ "annotations": {
4421
+ "readOnlyHint": true,
4422
+ "idempotentHint": true,
4423
+ "openWorldHint": false
4424
+ },
4425
+ "description": "Plans the migration of a router from the legacy `wireless` package (`/interface wireless`) to the new `wifi` driver (`/interface wifi`, formerly wifiwave2). It reads the wireless interfaces, their security profiles and the access list, and returns the equivalent `/interface wifi` commands with every setting translated to its new name (ssid, mode, band, channel width, frequency, country, hidden SSID, client isolation, VLAN, WPS, authentication types, virtual APs, access-list entries). It also reads a legacy CAPsMAN (`/caps-man`: security, channel, datapath, configuration, provisioning, the manager and the CAP setting) and returns the commands for the wifi CAPsMAN. It lists BLOCKERS that the new driver cannot do (Nv2 or Nstreme links, WDS, modes with no equivalent, legacy CAPs under a wifi manager) and notes for a person. It changes NOTHING on the router and does not read Wi-Fi passwords: the plan has a CHANGE-ME placeholder for each one. With `save=true` the plan is also stored on the MCP host, which you MUST do before the package is changed: afterwards the legacy menus are gone and cannot be read. The move is then: install the new package, reboot, `apply_wireless_to_wifi_migration`. Fails with a clear message when the router has no `wireless` menu.",
4426
+ "inputSchema": {
4427
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4428
+ "type": "object",
4429
+ "properties": {
4430
+ "save": {
4431
+ "default": false,
4432
+ "description": "Store the plan on the MCP host for apply_wireless_to_wifi_migration",
4433
+ "type": "boolean"
4434
+ }
4435
+ },
4436
+ "required": ["save"],
4437
+ "additionalProperties": false
4438
+ }
4439
+ },
4440
+ {
4441
+ "name": "apply_wireless_to_wifi_migration",
4442
+ "title": "Apply a Saved 'wireless' to 'wifi' Plan",
4443
+ "risk": "write",
4444
+ "annotations": {
4445
+ "destructiveHint": false,
4446
+ "openWorldHint": false
4447
+ },
4448
+ "description": "Applies the plan that `plan_wireless_to_wifi_migration save=true` stored for this router, AFTER you installed the new `wifi` package and rebooted. It refuses to run while the router still has no `/interface wifi` menu. Wi-Fi passwords do not pass through this call: `passwords_from` maps each security profile name to a secret reference (`env:NAME`, `file:/path` or `keyring:service/account`), which the server reads on the host. A profile with no reference stops the run. A plan with blockers is refused unless `ignore_blockers=true`. DEFAULTS TO A DRY RUN (`apply=false`) that shows the commands with passwords hidden. Every command is first parsed on the router; if one is not valid, nothing is written. Applying takes a config snapshot and writes in Safe Mode, so a setting that cuts your connection is rolled back. Wireless clients reconnect when the radios are configured. It does not install a package, does not reboot, and does not change bridge ports, DHCP or firewall rules that still name the old interfaces.",
4449
+ "inputSchema": {
4450
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4451
+ "type": "object",
4452
+ "properties": {
4453
+ "passwords_from": {
4454
+ "default": {},
4455
+ "description": "For each security profile: where its password is (a secret reference)",
4456
+ "type": "object",
4457
+ "propertyNames": {
4458
+ "type": "string"
4459
+ },
4460
+ "additionalProperties": {
4461
+ "type": "string",
4462
+ "pattern": "^(?:env:[A-Za-z_][A-Za-z0-9_]*|file:.+|keyring:[A-Za-z0-9][A-Za-z0-9._@-]{0,63}\\/[A-Za-z0-9][A-Za-z0-9._@-]{0,63})$"
4463
+ }
4464
+ },
4465
+ "ignore_blockers": {
4466
+ "default": false,
4467
+ "type": "boolean"
4468
+ },
4469
+ "apply": {
4470
+ "default": false,
4471
+ "description": "false = show the commands; true = apply",
4472
+ "type": "boolean"
4473
+ }
4474
+ },
4475
+ "required": ["passwords_from", "ignore_blockers", "apply"],
4476
+ "additionalProperties": false
4477
+ }
4478
+ },
4388
4479
  {
4389
4480
  "name": "run_capsman_audit",
4390
4481
  "title": "Run CAPsMAN Audit",
@@ -6881,7 +6972,7 @@
6881
6972
  "destructiveHint": false,
6882
6973
  "openWorldHint": false
6883
6974
  },
6884
- "description": "Creates `count` random guest login codes as `/ip hotspot user` entries (username = password = code), each with an optional uptime limit and hotspot user profile — the printable vouchers you hand to guests. DEFAULTS TO A DRY RUN (`apply=false`) that just shows the codes it would create; set `apply=true` to add them. Returns the generated codes.",
6975
+ "description": "Creates `count` random guest login codes as `/ip hotspot user` entries (username = password = code), each with an optional uptime limit and hotspot user profile — the printable vouchers you hand to guests. DEFAULTS TO A DRY RUN (`apply=false`) that just shows the codes it would create; set `apply=true` to add them. Every voucher of one call belongs to a batch (the `batch` name, or one made from the date), so `list_voucher_batches` can count how many were used and `remove_voucher_batch` can clear the unused ones. With `print=true` the tool also writes a print-ready HTML sheet (cards with cut lines, three across) and a CSV file to a folder on the MCP host and returns the paths; `title`, `validity`, `price` and `note` are printed on each card, and `login_url` adds a QR code that signs the guest in when scanned. Returns the generated codes.",
6885
6976
  "inputSchema": {
6886
6977
  "$schema": "https://json-schema.org/draft/2020-12/schema",
6887
6978
  "type": "object",
@@ -6892,6 +6983,42 @@
6892
6983
  "minimum": 1,
6893
6984
  "maximum": 200
6894
6985
  },
6986
+ "batch": {
6987
+ "description": "Batch name, e.g. 'hotel-2026-11'",
6988
+ "type": "string",
6989
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,30}$"
6990
+ },
6991
+ "print": {
6992
+ "default": false,
6993
+ "description": "Write a printable HTML sheet and a CSV file",
6994
+ "type": "boolean"
6995
+ },
6996
+ "title": {
6997
+ "default": "Guest Wi-Fi",
6998
+ "description": "Printed on each card",
6999
+ "type": "string",
7000
+ "maxLength": 60
7001
+ },
7002
+ "validity": {
7003
+ "description": "Printed text, e.g. '1 day'",
7004
+ "type": "string",
7005
+ "maxLength": 40
7006
+ },
7007
+ "price": {
7008
+ "description": "Printed text, e.g. '5 EUR'",
7009
+ "type": "string",
7010
+ "maxLength": 20
7011
+ },
7012
+ "note": {
7013
+ "description": "Small print, e.g. how to connect",
7014
+ "type": "string",
7015
+ "maxLength": 120
7016
+ },
7017
+ "login_url": {
7018
+ "description": "Hotspot login address, e.g. 'http://hotspot.lan/login', for a QR code",
7019
+ "type": "string",
7020
+ "format": "uri"
7021
+ },
6895
7022
  "uptime_limit": {
6896
7023
  "description": "Per-voucher uptime, e.g. '1h', '1d'",
6897
7024
  "type": "string"
@@ -6911,7 +7038,116 @@
6911
7038
  "type": "boolean"
6912
7039
  }
6913
7040
  },
6914
- "required": ["count", "code_prefix", "apply"],
7041
+ "required": ["count", "print", "title", "code_prefix", "apply"],
7042
+ "additionalProperties": false
7043
+ }
7044
+ },
7045
+ {
7046
+ "name": "list_voucher_batches",
7047
+ "title": "List Hotspot Voucher Batches",
7048
+ "risk": "read",
7049
+ "annotations": {
7050
+ "readOnlyHint": true,
7051
+ "idempotentHint": true,
7052
+ "openWorldHint": false
7053
+ },
7054
+ "description": "Lists the batches of vouchers made by generate_hotspot_vouchers: for each batch the number of vouchers, how many were used (the guest signed in at least once) and how many are still unused. Use it to see how a batch sells, or before you clear old unused codes with remove_voucher_batch. Hotspot users that were added another way are not listed.",
7055
+ "inputSchema": {
7056
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
7057
+ "type": "object",
7058
+ "properties": {},
7059
+ "additionalProperties": false
7060
+ }
7061
+ },
7062
+ {
7063
+ "name": "remove_voucher_batch",
7064
+ "title": "Remove a Hotspot Voucher Batch",
7065
+ "risk": "destructive",
7066
+ "annotations": {
7067
+ "destructiveHint": true,
7068
+ "idempotentHint": true,
7069
+ "openWorldHint": false
7070
+ },
7071
+ "description": "Removes the vouchers of one batch made by generate_hotspot_vouchers. By default only the UNUSED vouchers go (codes nobody signed in with), so a guest who is using one keeps access; `include_used=true` removes every voucher of the batch. DEFAULTS TO A DRY RUN (`apply=false`) that counts what would be removed. Use it to retire codes that were printed and not sold. A removed code can never sign in again.",
7072
+ "inputSchema": {
7073
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
7074
+ "type": "object",
7075
+ "properties": {
7076
+ "batch": {
7077
+ "type": "string",
7078
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,30}$",
7079
+ "description": "The batch name"
7080
+ },
7081
+ "include_used": {
7082
+ "default": false,
7083
+ "description": "Also remove vouchers that were used",
7084
+ "type": "boolean"
7085
+ },
7086
+ "apply": {
7087
+ "default": false,
7088
+ "description": "false = count only; true = remove",
7089
+ "type": "boolean"
7090
+ }
7091
+ },
7092
+ "required": ["batch", "include_used", "apply"],
7093
+ "additionalProperties": false
7094
+ }
7095
+ },
7096
+ {
7097
+ "name": "protect_hotspot_login",
7098
+ "title": "Rate-Limit the Hotspot Login",
7099
+ "risk": "write",
7100
+ "annotations": {
7101
+ "destructiveHint": false,
7102
+ "openWorldHint": false
7103
+ },
7104
+ "description": "Limits how fast one client can open connections to the hotspot login service, so guessing voucher codes or passwords by trying many of them is slowed and then blocked. It adds firewall rules in the `pre-hs-input` chain, which RouterOS runs before its own hotspot rules: a client that opens more than `per_minute` new connections to the login ports (tcp 64872-64875) is put in the address list `hs-login-flood` and dropped for `block_minutes`. DEFAULTS TO A DRY RUN (`apply=false`) that shows the rules. It limits connections for each client address, not attempts for each user name, so it cannot tell a wrong code from a page reload: keep `per_minute` well above normal use. Undo it with `unprotect_hotspot_login`. The router needs a hotspot for the chain to be used.",
7105
+ "inputSchema": {
7106
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
7107
+ "type": "object",
7108
+ "properties": {
7109
+ "per_minute": {
7110
+ "default": 30,
7111
+ "type": "integer",
7112
+ "minimum": 5,
7113
+ "maximum": 600
7114
+ },
7115
+ "burst": {
7116
+ "default": 15,
7117
+ "type": "integer",
7118
+ "minimum": 1,
7119
+ "maximum": 200
7120
+ },
7121
+ "block_minutes": {
7122
+ "default": 10,
7123
+ "type": "integer",
7124
+ "minimum": 1,
7125
+ "maximum": 1440
7126
+ },
7127
+ "apply": {
7128
+ "default": false,
7129
+ "description": "false = show the rules; true = add them",
7130
+ "type": "boolean"
7131
+ }
7132
+ },
7133
+ "required": ["per_minute", "burst", "block_minutes", "apply"],
7134
+ "additionalProperties": false
7135
+ }
7136
+ },
7137
+ {
7138
+ "name": "unprotect_hotspot_login",
7139
+ "title": "Remove the Hotspot Login Rate Limit",
7140
+ "risk": "destructive",
7141
+ "annotations": {
7142
+ "destructiveHint": true,
7143
+ "idempotentHint": true,
7144
+ "openWorldHint": false
7145
+ },
7146
+ "description": "Removes the rules `protect_hotspot_login` added and empties its block list. Clients that were blocked can sign in again at once. Rules you added yourself are not touched. Returns how many rules were removed.",
7147
+ "inputSchema": {
7148
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
7149
+ "type": "object",
7150
+ "properties": {},
6915
7151
  "additionalProperties": false
6916
7152
  }
6917
7153
  },
@@ -7460,10 +7696,9 @@
7460
7696
  {
7461
7697
  "name": "export_dns_config",
7462
7698
  "title": "Export DNS Configuration to File",
7463
- "risk": "read",
7699
+ "risk": "write",
7464
7700
  "annotations": {
7465
- "readOnlyHint": true,
7466
- "idempotentHint": true,
7701
+ "destructiveHint": false,
7467
7702
  "openWorldHint": false
7468
7703
  },
7469
7704
  "description": "Exports the full DNS configuration (resolver settings and static records) to a RouterOS script file on the router's flash storage (`/ip dns export file=<filename>`). The router appends `.rsc` to the filename automatically; defaults to `dns_config.rsc`. The exported file can be imported on another RouterOS device to replicate DNS configuration. To read current settings as structured output without writing a file use get_dns_settings. To list static records use list_dns_static. Returns the filename of the exported `.rsc` file on the router.",
@@ -7893,6 +8128,94 @@
7893
8128
  "additionalProperties": false
7894
8129
  }
7895
8130
  },
8131
+ {
8132
+ "name": "follow_ipv6_prefix",
8133
+ "title": "Keep IPv6 Address Lists on the Delegated Prefix",
8134
+ "risk": "write",
8135
+ "annotations": {
8136
+ "destructiveHint": false,
8137
+ "openWorldHint": false
8138
+ },
8139
+ "description": "Makes IPv6 firewall address lists follow the prefix your ISP delegates, so rules keep working when the ISP changes the prefix. It installs a script on the DHCPv6 client of `interface`; RouterOS runs it each time a prefix is bound, and it rewrites: the address list `list` with the whole delegated prefix, and for each entry in `hosts` a list `<list>-<name>` with that host's address (the new prefix plus its fixed `suffix`). Point your firewall rules at these lists instead of at literal addresses, for example `dst-address-list=isp-prefix-web` to allow inbound HTTPS to one server. The client must request a prefix (`request=prefix`). DEFAULTS TO A DRY RUN (`apply=false`) that shows the script. An existing script on the client that this tool did not write is kept unless `replace=true`. The lists are filled at the next bind: run `renew_ipv6_dhcp_client` afterwards to fill them now. A suffix names a host inside the prefix: `::10` is host ::10 in the first /64, `::1:0:0:0:10` is host ::10 in the second /64.",
8140
+ "inputSchema": {
8141
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
8142
+ "type": "object",
8143
+ "properties": {
8144
+ "interface": {
8145
+ "type": "string",
8146
+ "description": "Interface of the DHCPv6 client, e.g. 'ether1' or 'pppoe-out1'"
8147
+ },
8148
+ "list": {
8149
+ "default": "isp-prefix",
8150
+ "description": "Address list that gets the whole delegated prefix",
8151
+ "type": "string",
8152
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,30}$"
8153
+ },
8154
+ "hosts": {
8155
+ "default": [],
8156
+ "maxItems": 32,
8157
+ "type": "array",
8158
+ "items": {
8159
+ "type": "object",
8160
+ "properties": {
8161
+ "name": {
8162
+ "type": "string",
8163
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,30}$",
8164
+ "description": "Short name, becomes list '<list>-<name>'"
8165
+ },
8166
+ "suffix": {
8167
+ "type": "string",
8168
+ "pattern": "^::[0-9a-f]{1,4}(?::[0-9a-f]{1,4}){0,4}$",
8169
+ "description": "Fixed part of the address, e.g. '::10'"
8170
+ }
8171
+ },
8172
+ "required": ["name", "suffix"],
8173
+ "additionalProperties": false
8174
+ }
8175
+ },
8176
+ "replace": {
8177
+ "default": false,
8178
+ "description": "Replace a script this tool did not write",
8179
+ "type": "boolean"
8180
+ },
8181
+ "apply": {
8182
+ "default": false,
8183
+ "description": "false = show the script; true = install",
8184
+ "type": "boolean"
8185
+ }
8186
+ },
8187
+ "required": ["interface", "list", "hosts", "replace", "apply"],
8188
+ "additionalProperties": false
8189
+ }
8190
+ },
8191
+ {
8192
+ "name": "unfollow_ipv6_prefix",
8193
+ "title": "Stop Following the Delegated IPv6 Prefix",
8194
+ "risk": "destructive",
8195
+ "annotations": {
8196
+ "destructiveHint": true,
8197
+ "idempotentHint": true,
8198
+ "openWorldHint": false
8199
+ },
8200
+ "description": "Undoes `follow_ipv6_prefix`: clears the script it installed on the DHCPv6 client of `interface` and removes the address-list entries the script made for `list`. A script that this tool did not write is left alone. Firewall rules that use those lists then match nothing: change or remove them first. Returns what was cleared.",
8201
+ "inputSchema": {
8202
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
8203
+ "type": "object",
8204
+ "properties": {
8205
+ "interface": {
8206
+ "type": "string",
8207
+ "description": "Interface of the DHCPv6 client"
8208
+ },
8209
+ "list": {
8210
+ "default": "isp-prefix",
8211
+ "type": "string",
8212
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,30}$"
8213
+ }
8214
+ },
8215
+ "required": ["interface", "list"],
8216
+ "additionalProperties": false
8217
+ }
8218
+ },
7896
8219
  {
7897
8220
  "name": "add_ipv6_dhcp_relay",
7898
8221
  "title": "Add IPv6 DHCP Relay",
@@ -17744,6 +18067,120 @@
17744
18067
  "additionalProperties": false
17745
18068
  }
17746
18069
  },
18070
+ {
18071
+ "name": "design_zone_firewall",
18072
+ "title": "Design a Zone-Based Firewall",
18073
+ "risk": "write",
18074
+ "annotations": {
18075
+ "destructiveHint": false,
18076
+ "openWorldHint": false
18077
+ },
18078
+ "description": "Builds a zone-based firewall from a description instead of single rules. You name zones (each a set of interfaces, for example lan, guest, wan) and policies (what may go from one zone to another, optionally limited to a protocol and ports). The tool creates one interface list for each zone and filter rules for each policy, accepts replies to allowed connections, and drops everything else that enters from a zone. The special zone 'router' is the router itself: `from: lan, to: router` allows access TO the router (an input rule). DEFAULTS TO A DRY RUN (`apply=false`) that returns every command. With `apply=true` it takes a config snapshot and writes in Safe Mode, so a rule that cuts your own connection is rolled back. It refuses a design it cannot make safely: an interface in two zones, an unknown zone or interface, ports without a protocol, or `protect_router=true` with no accept policy to the router (that would lock everyone out). Rules are added at the END of each chain, so existing rules that match first still decide. Use `remove_zone_firewall` to take the whole design out. IPv4 only.",
18079
+ "inputSchema": {
18080
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
18081
+ "type": "object",
18082
+ "properties": {
18083
+ "zones": {
18084
+ "minItems": 1,
18085
+ "maxItems": 16,
18086
+ "type": "array",
18087
+ "items": {
18088
+ "type": "object",
18089
+ "properties": {
18090
+ "name": {
18091
+ "type": "string",
18092
+ "description": "Zone name: lowercase letters, digits, '-'"
18093
+ },
18094
+ "interfaces": {
18095
+ "type": "array",
18096
+ "items": {
18097
+ "type": "string",
18098
+ "minLength": 1
18099
+ },
18100
+ "description": "Interfaces in this zone"
18101
+ }
18102
+ },
18103
+ "required": ["name", "interfaces"],
18104
+ "additionalProperties": false
18105
+ }
18106
+ },
18107
+ "policies": {
18108
+ "default": [],
18109
+ "maxItems": 64,
18110
+ "type": "array",
18111
+ "items": {
18112
+ "type": "object",
18113
+ "properties": {
18114
+ "from": {
18115
+ "type": "string",
18116
+ "description": "Source zone, or 'router'"
18117
+ },
18118
+ "to": {
18119
+ "type": "string",
18120
+ "description": "Destination zone, or 'router'"
18121
+ },
18122
+ "action": {
18123
+ "default": "accept",
18124
+ "type": "string",
18125
+ "enum": ["accept", "drop", "reject"]
18126
+ },
18127
+ "protocol": {
18128
+ "type": "string",
18129
+ "enum": ["tcp", "udp", "icmp"]
18130
+ },
18131
+ "ports": {
18132
+ "description": "Destination ports, e.g. '443' or '80,443'",
18133
+ "type": "string"
18134
+ },
18135
+ "note": {
18136
+ "description": "A short note for the rule comment",
18137
+ "type": "string",
18138
+ "maxLength": 60
18139
+ }
18140
+ },
18141
+ "required": ["from", "to", "action"],
18142
+ "additionalProperties": false
18143
+ }
18144
+ },
18145
+ "protect_router": {
18146
+ "default": false,
18147
+ "description": "Also drop traffic to the router itself that no policy allows",
18148
+ "type": "boolean"
18149
+ },
18150
+ "apply": {
18151
+ "default": false,
18152
+ "description": "false = show the commands; true = apply",
18153
+ "type": "boolean"
18154
+ }
18155
+ },
18156
+ "required": ["zones", "policies", "protect_router", "apply"],
18157
+ "additionalProperties": false
18158
+ }
18159
+ },
18160
+ {
18161
+ "name": "remove_zone_firewall",
18162
+ "title": "Remove the Zone-Based Firewall",
18163
+ "risk": "destructive",
18164
+ "annotations": {
18165
+ "destructiveHint": true,
18166
+ "idempotentHint": true,
18167
+ "openWorldHint": false
18168
+ },
18169
+ "description": "Removes everything `design_zone_firewall` created on a router: its filter rules, zone interface-list members and zone interface lists (all carry a 'zone-fw:' comment). Rules you added yourself are not touched. After this, traffic between the former zones is decided by the rules that remain, which may be none: check before you remove a firewall on a router that faces the internet. DEFAULTS TO A DRY RUN (`apply=false`) that counts what would go.",
18170
+ "inputSchema": {
18171
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
18172
+ "type": "object",
18173
+ "properties": {
18174
+ "apply": {
18175
+ "default": false,
18176
+ "description": "false = count only; true = remove",
18177
+ "type": "boolean"
18178
+ }
18179
+ },
18180
+ "required": ["apply"],
18181
+ "additionalProperties": false
18182
+ }
18183
+ },
17747
18184
  {
17748
18185
  "name": "scan_for_attacks",
17749
18186
  "title": "Scan for Attacks Now",
@@ -21191,7 +21628,7 @@
21191
21628
  "destructiveHint": false,
21192
21629
  "openWorldHint": false
21193
21630
  },
21194
- "description": "Generates a ready-to-use WireGuard remote-access profile for one user: creates a client keypair, adds the peer to the server `interface` (allowed-address = the client's tunnel IP), reads the server's public key, and returns a complete client .conf to paste into the WireGuard app or a QR generator. The peer is tagged `vpn-user: <user>` so revoke_wireguard_user can remove it. NOTE: the returned config contains the client PRIVATE key (required to connect) — handle it securely. `endpoint` is the server's public host:port; `allowed_ips` controls split vs full tunnel. SSH devices only. Returns the client config.",
21631
+ "description": "Generates a ready-to-use WireGuard remote-access profile for one user: creates a client keypair, adds the peer to the server `interface` (allowed-address = the client's tunnel IP), reads the server's public key, and returns a complete client .conf to paste into the WireGuard app or a QR generator. The peer is tagged `vpn-user: <user>` so revoke_wireguard_user can remove it. NOTE: the returned config contains the client PRIVATE key (required to connect) — handle it securely. `endpoint` is the server's public host:port; `allowed_ips` controls split vs full tunnel. Leave `address` out and the tool picks the lowest free address in the interface's own subnet, so two users never get the same one. `expires` (YYYY-MM-DD) records an end date on the peer; `expire_wireguard_users` then disables or removes peers past their date. `save=true` writes `<user>.conf` and a `<user>.png` QR code (scan it in the WireGuard phone app) to a private folder on the MCP host and returns the paths. `email_to` sends the profile by email through the alert email channel; the message carries the private key, so use it only for a mailbox you trust. SSH devices only. Returns the client config.",
21195
21632
  "inputSchema": {
21196
21633
  "$schema": "https://json-schema.org/draft/2020-12/schema",
21197
21634
  "type": "object",
@@ -21202,11 +21639,26 @@
21202
21639
  },
21203
21640
  "user": {
21204
21641
  "type": "string",
21642
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._@-]{0,62}$",
21205
21643
  "description": "User/device label, e.g. 'alice-laptop'"
21206
21644
  },
21207
21645
  "address": {
21646
+ "description": "Tunnel IP for the client, e.g. '10.20.0.50'. Omit to take the lowest free one.",
21647
+ "type": "string"
21648
+ },
21649
+ "expires": {
21650
+ "description": "Last day the user may connect, e.g. '2026-12-31'",
21651
+ "type": "string"
21652
+ },
21653
+ "save": {
21654
+ "default": false,
21655
+ "description": "Write <user>.conf and a <user>.png QR code on the MCP host",
21656
+ "type": "boolean"
21657
+ },
21658
+ "email_to": {
21659
+ "description": "Email the profile to this address (needs the alert email channel)",
21208
21660
  "type": "string",
21209
- "description": "Tunnel IP to assign the client, e.g. '10.20.0.50'"
21661
+ "pattern": "^[^\\s<>@,;]+@[^\\s<>@,;]+$"
21210
21662
  },
21211
21663
  "endpoint": {
21212
21664
  "type": "string",
@@ -21227,7 +21679,7 @@
21227
21679
  "type": "string"
21228
21680
  }
21229
21681
  },
21230
- "required": ["interface", "user", "address", "endpoint", "allowed_ips", "keepalive"],
21682
+ "required": ["interface", "user", "save", "endpoint", "allowed_ips", "keepalive"],
21231
21683
  "additionalProperties": false
21232
21684
  }
21233
21685
  },
@@ -21247,6 +21699,7 @@
21247
21699
  "properties": {
21248
21700
  "user": {
21249
21701
  "type": "string",
21702
+ "minLength": 1,
21250
21703
  "description": "The user label used at onboarding"
21251
21704
  }
21252
21705
  },
@@ -21254,6 +21707,57 @@
21254
21707
  "additionalProperties": false
21255
21708
  }
21256
21709
  },
21710
+ {
21711
+ "name": "list_wireguard_users",
21712
+ "title": "List WireGuard Remote Users",
21713
+ "risk": "read",
21714
+ "annotations": {
21715
+ "readOnlyHint": true,
21716
+ "idempotentHint": true,
21717
+ "openWorldHint": false
21718
+ },
21719
+ "description": "Lists the remote-access users created by onboard_wireguard_user (peers tagged `vpn-user: <user>`): the label, interface, tunnel address, expiry date and whether it has passed, whether the peer is disabled, and the last handshake. Use it to see who has VPN access, who has not connected for a long time, and whose access has expired. Peers that were added another way are not listed; use list_wireguard_peers for all of them.",
21720
+ "inputSchema": {
21721
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
21722
+ "type": "object",
21723
+ "properties": {
21724
+ "interface": {
21725
+ "description": "Only users of this WireGuard interface",
21726
+ "type": "string"
21727
+ }
21728
+ },
21729
+ "additionalProperties": false
21730
+ }
21731
+ },
21732
+ {
21733
+ "name": "expire_wireguard_users",
21734
+ "title": "Disable or Remove Expired WireGuard Users",
21735
+ "risk": "destructive",
21736
+ "annotations": {
21737
+ "destructiveHint": true,
21738
+ "idempotentHint": true,
21739
+ "openWorldHint": false
21740
+ },
21741
+ "description": "Acts on the remote-access users whose `expires` date (set at onboard_wireguard_user) has passed. `action=disable` (the default) disables the peer, so access stops and the peer can be enabled again; `action=remove` deletes it. DEFAULTS TO A DRY RUN (`apply=false`) that lists who would be affected. Users without an expiry date are never touched. Run it on a schedule to make expiry dates take effect: a date alone does not stop a connection.",
21742
+ "inputSchema": {
21743
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
21744
+ "type": "object",
21745
+ "properties": {
21746
+ "action": {
21747
+ "default": "disable",
21748
+ "type": "string",
21749
+ "enum": ["disable", "remove"]
21750
+ },
21751
+ "apply": {
21752
+ "default": false,
21753
+ "description": "false = list only (default); true = act",
21754
+ "type": "boolean"
21755
+ }
21756
+ },
21757
+ "required": ["action", "apply"],
21758
+ "additionalProperties": false
21759
+ }
21760
+ },
21257
21761
  {
21258
21762
  "name": "create_ipsec_profile",
21259
21763
  "title": "Create IPsec Phase-1 Profile",
@@ -27771,16 +28275,11 @@
27771
28275
  "idempotentHint": true,
27772
28276
  "openWorldHint": false
27773
28277
  },
27774
- "description": "Discover available RouterOS updates for a single device or the entire fleet. Queries the configured update channel, compares installed vs. latest version, flags outdated firmware, and assesses upgrade readiness (CPU, memory, version jump). Optionally set the update channel before checking. Use `firmware_status` for detailed package/routerboard info; use `firmware_stage` to download packages after confirming an update is available.",
28278
+ "description": "Discover available RouterOS updates for a single device or the entire fleet. Queries the configured update channel, compares installed vs. latest version, flags outdated firmware, and assesses upgrade readiness (CPU, memory, version jump). It reads only: it does not change the update channel (set one with `firmware_stage`). Use `firmware_status` for detailed package/routerboard info; use `firmware_stage` to download packages after confirming an update is available.",
27775
28279
  "inputSchema": {
27776
28280
  "$schema": "https://json-schema.org/draft/2020-12/schema",
27777
28281
  "type": "object",
27778
28282
  "properties": {
27779
- "channel": {
27780
- "description": "Set the update channel before checking (default: keep current).",
27781
- "type": "string",
27782
- "enum": ["stable", "long-term", "testing"]
27783
- },
27784
28283
  "fleet": {
27785
28284
  "default": false,
27786
28285
  "description": "Check all configured devices instead of just one.",
@@ -27888,6 +28387,128 @@
27888
28387
  "additionalProperties": false
27889
28388
  }
27890
28389
  },
28390
+ {
28391
+ "name": "firmware_repo_list",
28392
+ "title": "List the Local Firmware Repository",
28393
+ "risk": "read",
28394
+ "annotations": {
28395
+ "readOnlyHint": true,
28396
+ "idempotentHint": true,
28397
+ "openWorldHint": false
28398
+ },
28399
+ "description": "Lists the RouterOS package files (`.npk`) kept on the MCP host, with size and SHA-256. These are the files `firmware_stage_from_repo` uploads to routers. Use it to see which versions and architectures are ready, or to compare a checksum. It contacts no router. Fill the repository with `firmware_repo_fetch`. Returns the directory and one line per file.",
28400
+ "inputSchema": {
28401
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
28402
+ "type": "object",
28403
+ "properties": {},
28404
+ "additionalProperties": false
28405
+ }
28406
+ },
28407
+ {
28408
+ "name": "firmware_repo_fetch",
28409
+ "title": "Download RouterOS Packages to the Local Repository",
28410
+ "risk": "write",
28411
+ "annotations": {
28412
+ "destructiveHint": false,
28413
+ "openWorldHint": false
28414
+ },
28415
+ "description": "Downloads RouterOS packages for one version and architecture from MikroTik (download.mikrotik.com, HTTPS only) into the firmware repository on the MCP host, and records their SHA-256. It changes no router. Use it once for each version, then `firmware_stage_from_repo` sends the same files to every router, so routers need no internet and all get identical packages. `packages` defaults to the main `routeros` package; add the extra packages your routers use (for example `wireless`, `container`, `user-manager`). A file that is already in the repository is kept, not downloaded again. Returns each file with its size and checksum, or the reason a download failed.",
28416
+ "inputSchema": {
28417
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
28418
+ "type": "object",
28419
+ "properties": {
28420
+ "version": {
28421
+ "type": "string",
28422
+ "pattern": "^\\d+\\.\\d+(?:\\.\\d+)?(?:(?:beta|rc)\\d+)?$",
28423
+ "description": "RouterOS version, for example '7.25.1'"
28424
+ },
28425
+ "architecture": {
28426
+ "type": "string",
28427
+ "enum": ["arm", "arm64", "mipsbe", "mmips", "smips", "ppc", "tile", "x86"],
28428
+ "description": "Package architecture. Use x86 for CHR and x86_64 routers."
28429
+ },
28430
+ "packages": {
28431
+ "default": ["routeros"],
28432
+ "description": "Package names without version, for example ['routeros','wireless']",
28433
+ "minItems": 1,
28434
+ "maxItems": 20,
28435
+ "type": "array",
28436
+ "items": {
28437
+ "type": "string",
28438
+ "pattern": "^[a-z][a-z0-9-]{0,40}$"
28439
+ }
28440
+ }
28441
+ },
28442
+ "required": ["version", "architecture", "packages"],
28443
+ "additionalProperties": false
28444
+ }
28445
+ },
28446
+ {
28447
+ "name": "firmware_stage_from_repo",
28448
+ "title": "Stage an Upgrade From the Local Repository",
28449
+ "risk": "write",
28450
+ "annotations": {
28451
+ "destructiveHint": false,
28452
+ "openWorldHint": false
28453
+ },
28454
+ "description": "Uploads the RouterOS packages of one version from the firmware repository on the MCP host to a router, ready to install at its next reboot. The router needs no internet. The tool reads the router's architecture and its installed packages, picks the matching files, checks free storage, uploads over SFTP and verifies each file arrived. It does NOT reboot: the router keeps running its current version until you reboot it (`reboot_system`), and RouterOS installs the packages during that reboot. DEFAULTS TO A DRY RUN (`apply=false`) that shows what would be uploaded and what is missing from the repository. Every installed package must be staged at the same version, so a missing file stops the upload; get it with `firmware_repo_fetch`. After the reboot, run `firmware_post_upgrade`. Not available for a MAC-Telnet device (no file transfer).",
28455
+ "inputSchema": {
28456
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
28457
+ "type": "object",
28458
+ "properties": {
28459
+ "version": {
28460
+ "type": "string",
28461
+ "pattern": "^\\d+\\.\\d+(?:\\.\\d+)?(?:(?:beta|rc)\\d+)?$",
28462
+ "description": "The version to stage, for example '7.25.1'"
28463
+ },
28464
+ "apply": {
28465
+ "default": false,
28466
+ "description": "false = show the plan (default); true = upload",
28467
+ "type": "boolean"
28468
+ }
28469
+ },
28470
+ "required": ["version", "apply"],
28471
+ "additionalProperties": false
28472
+ }
28473
+ },
28474
+ {
28475
+ "name": "firmware_post_upgrade",
28476
+ "title": "Finish an Upgrade After the Reboot",
28477
+ "risk": "write",
28478
+ "annotations": {
28479
+ "destructiveHint": false,
28480
+ "openWorldHint": false
28481
+ },
28482
+ "description": "The step after a RouterOS upgrade reboot. It (1) checks that the router now runs the expected version, (2) compares the RouterBOOT (bootloader) version with the one the NEW RouterOS carries and, with `upgrade_routerboard=true`, queues the bootloader upgrade, and (3) runs the commands you give, in order. RouterBOOT must be upgraded AFTER RouterOS: the new bootloader comes inside the new RouterOS, so upgrading it before the reboot installs the old one. A queued bootloader takes effect at one more reboot, which this tool does NOT do. Each command is first parsed on the router; if one is not valid, none runs. Running stops at the first command that fails. Use it after `firmware_upgrade` or after a reboot that followed `firmware_stage_from_repo`. Returns what was checked, queued and run.",
28483
+ "inputSchema": {
28484
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
28485
+ "type": "object",
28486
+ "properties": {
28487
+ "expected_version": {
28488
+ "description": "Stop when the router does not run this version, for example '7.25.1'",
28489
+ "type": "string",
28490
+ "pattern": "^\\d+\\.\\d+(?:\\.\\d+)?(?:(?:beta|rc)\\d+)?$"
28491
+ },
28492
+ "upgrade_routerboard": {
28493
+ "default": false,
28494
+ "description": "Queue the RouterBOOT upgrade when its version differs",
28495
+ "type": "boolean"
28496
+ },
28497
+ "commands": {
28498
+ "default": [],
28499
+ "description": "RouterOS commands to run after the checks, in order",
28500
+ "maxItems": 50,
28501
+ "type": "array",
28502
+ "items": {
28503
+ "type": "string",
28504
+ "minLength": 1
28505
+ }
28506
+ }
28507
+ },
28508
+ "required": ["upgrade_routerboard", "commands"],
28509
+ "additionalProperties": false
28510
+ }
28511
+ },
27891
28512
  {
27892
28513
  "name": "ping",
27893
28514
  "title": "Ping Host via Router",
@@ -28556,6 +29177,130 @@
28556
29177
  "additionalProperties": false
28557
29178
  }
28558
29179
  },
29180
+ {
29181
+ "name": "discover_unmanaged_devices",
29182
+ "title": "Discover Devices That Are Not Managed Yet",
29183
+ "risk": "read",
29184
+ "annotations": {
29185
+ "readOnlyHint": true,
29186
+ "idempotentHint": true,
29187
+ "openWorldHint": false
29188
+ },
29189
+ "description": "Finds MikroTik and other devices that are attached to your network but are NOT in this server's device list. It reads the neighbour table (`/ip neighbor`, filled by MNDP, CDP and LLDP) of every configured router, or of the routers you name, merges what they saw, and removes every neighbour that is already a configured device (matched by MAC, IP or identity). For each remaining device it returns the identity, board, RouterOS version, MAC, IP, which router saw it on which interface, and a ready device-config entry. Use it to answer 'which routers are not managed yet?' or before you add a device. It only reads; it does NOT add a device or log in to one. A person adds a device with its credentials in the dashboard (Topology page, or the configuration editor) or in the devices file. A neighbour is seen only on a directly attached Layer-2 segment, so a router behind another router does not appear.",
29190
+ "inputSchema": {
29191
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
29192
+ "type": "object",
29193
+ "properties": {
29194
+ "devices": {
29195
+ "description": "Routers to ask. Omit to ask every configured router that is not disabled.",
29196
+ "type": "array",
29197
+ "items": {
29198
+ "type": "string"
29199
+ }
29200
+ },
29201
+ "listen_seconds": {
29202
+ "default": 0,
29203
+ "description": "Also listen for MikroTik discovery (MNDP, UDP 5678) on the MCP host itself for this many seconds. Finds devices on the host's own network segment, also with no managed router.",
29204
+ "type": "integer",
29205
+ "minimum": 0,
29206
+ "maximum": 30
29207
+ },
29208
+ "scan": {
29209
+ "description": "Also scan a subnet from one router (`/tool ip-scan`). Finds hosts that announce nothing, by address and MAC. It sends probes on that network.",
29210
+ "type": "object",
29211
+ "properties": {
29212
+ "device": {
29213
+ "type": "string",
29214
+ "description": "The router that runs the scan"
29215
+ },
29216
+ "interface": {
29217
+ "description": "Scan the subnet on this interface",
29218
+ "type": "string"
29219
+ },
29220
+ "address_range": {
29221
+ "description": "Range or CIDR, e.g. '192.168.88.0/24'",
29222
+ "type": "string"
29223
+ },
29224
+ "seconds": {
29225
+ "default": 8,
29226
+ "type": "integer",
29227
+ "minimum": 1,
29228
+ "maximum": 60
29229
+ }
29230
+ },
29231
+ "required": ["device", "seconds"],
29232
+ "additionalProperties": false
29233
+ }
29234
+ },
29235
+ "required": ["listen_seconds"],
29236
+ "additionalProperties": false
29237
+ }
29238
+ },
29239
+ {
29240
+ "name": "enrol_device",
29241
+ "title": "Add a Device to This Server",
29242
+ "risk": "write",
29243
+ "annotations": {
29244
+ "destructiveHint": false,
29245
+ "openWorldHint": false
29246
+ },
29247
+ "description": "Adds a router to this server's device list, so the other tools can manage it. It is the step after discover_unmanaged_devices. The sign-in secret NEVER passes through this call: give `password_from` (a reference: `env:NAME`, `file:/path` or `keyring:service/account`), `ssh_agent=true`, or `key_filename`. A literal password is not accepted, so a person puts the secret in place first and you pass only where it is. The tool first connects to the device with those settings; a device that cannot be reached or signed in to is NOT added. DEFAULTS TO A CHECK ONLY (`apply=false`) that reports whether the connection works. With `apply=true` the device is written to the configuration file (a backup is kept) and is usable at once, with no restart. Give `host` for SSH, or `mac` for a device with no IP (MAC-Telnet; that needs a password reference). It changes nothing on the device itself. A name that already exists is refused.",
29248
+ "inputSchema": {
29249
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
29250
+ "type": "object",
29251
+ "properties": {
29252
+ "name": {
29253
+ "type": "string",
29254
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9 ._-]{0,40}$",
29255
+ "description": "Name for the device in this server"
29256
+ },
29257
+ "host": {
29258
+ "description": "IP address or host name (SSH)",
29259
+ "type": "string"
29260
+ },
29261
+ "mac": {
29262
+ "description": "MAC address, for a device with no IP (MAC-Telnet)",
29263
+ "type": "string"
29264
+ },
29265
+ "port": {
29266
+ "default": 22,
29267
+ "type": "integer",
29268
+ "minimum": 1,
29269
+ "maximum": 65535
29270
+ },
29271
+ "username": {
29272
+ "default": "admin",
29273
+ "type": "string",
29274
+ "minLength": 1
29275
+ },
29276
+ "password_from": {
29277
+ "description": "Where the password is: env:NAME, file:/path or keyring:service/account",
29278
+ "type": "string",
29279
+ "pattern": "^(?:env:[A-Za-z_][A-Za-z0-9_]*|file:.+|keyring:[A-Za-z0-9][A-Za-z0-9._@-]{0,63}\\/[A-Za-z0-9][A-Za-z0-9._@-]{0,63})$"
29280
+ },
29281
+ "ssh_agent": {
29282
+ "default": false,
29283
+ "description": "Sign in with the SSH agent of the host",
29284
+ "type": "boolean"
29285
+ },
29286
+ "key_filename": {
29287
+ "description": "Path of a private key file on the host",
29288
+ "type": "string"
29289
+ },
29290
+ "host_key_sha256": {
29291
+ "description": "Pin the SSH host key (SHA256:…)",
29292
+ "type": "string"
29293
+ },
29294
+ "apply": {
29295
+ "default": false,
29296
+ "description": "false = test the connection; true = add",
29297
+ "type": "boolean"
29298
+ }
29299
+ },
29300
+ "required": ["name", "port", "username", "ssh_agent", "apply"],
29301
+ "additionalProperties": false
29302
+ }
29303
+ },
28559
29304
  {
28560
29305
  "name": "map_l2_fabric",
28561
29306
  "title": "Map Hosts to Physical Switch Ports",
@@ -30966,6 +31711,7 @@
30966
31711
  "properties": {
30967
31712
  "name": {
30968
31713
  "type": "string",
31714
+ "pattern": "^[A-Za-z0-9][\\w.-]{0,40}$",
30969
31715
  "description": "Short feed id, e.g. 'spamhaus-drop'"
30970
31716
  },
30971
31717
  "url": {
@@ -31013,6 +31759,7 @@
31013
31759
  "properties": {
31014
31760
  "name": {
31015
31761
  "type": "string",
31762
+ "pattern": "^[A-Za-z0-9][\\w.-]{0,40}$",
31016
31763
  "description": "The feed id used when subscribing"
31017
31764
  }
31018
31765
  },
@@ -31399,10 +32146,9 @@
31399
32146
  {
31400
32147
  "name": "export_user_config",
31401
32148
  "title": "Export User Configuration to File",
31402
- "risk": "read",
32149
+ "risk": "write",
31403
32150
  "annotations": {
31404
- "readOnlyHint": true,
31405
- "idempotentHint": true,
32151
+ "destructiveHint": false,
31406
32152
  "openWorldHint": false
31407
32153
  },
31408
32154
  "description": "Export the router's user accounts and user-group configuration as a RouterOS script (`/user export file=<filename>`). The file is saved on the router's flash storage as `<filename>.rsc`. If `filename` is omitted, defaults to `user_config`. The exported script can be used to restore user accounts on another device.",
@@ -31506,7 +32252,8 @@
31506
32252
  "type": "string"
31507
32253
  },
31508
32254
  "time_filter": {
31509
- "type": "string"
32255
+ "type": "string",
32256
+ "pattern": "^\\d+(?:[wdhms](?:\\d+[wdhms])*)?$"
31510
32257
  },
31511
32258
  "message_filter": {
31512
32259
  "type": "string"
@@ -31552,7 +32299,8 @@
31552
32299
  "enum": ["debug", "info", "warning", "error", "critical"]
31553
32300
  },
31554
32301
  "time_filter": {
31555
- "type": "string"
32302
+ "type": "string",
32303
+ "pattern": "^\\d+(?:[wdhms](?:\\d+[wdhms])*)?$"
31556
32304
  },
31557
32305
  "limit": {
31558
32306
  "type": "integer",
@@ -31582,7 +32330,8 @@
31582
32330
  "type": "string"
31583
32331
  },
31584
32332
  "time_filter": {
31585
- "type": "string"
32333
+ "type": "string",
32334
+ "pattern": "^\\d+(?:[wdhms](?:\\d+[wdhms])*)?$"
31586
32335
  },
31587
32336
  "limit": {
31588
32337
  "type": "integer",
@@ -31612,7 +32361,8 @@
31612
32361
  "type": "string"
31613
32362
  },
31614
32363
  "time_filter": {
31615
- "type": "string"
32364
+ "type": "string",
32365
+ "pattern": "^\\d+(?:[wdhms](?:\\d+[wdhms])*)?$"
31616
32366
  },
31617
32367
  "case_sensitive": {
31618
32368
  "default": false,
@@ -31646,7 +32396,8 @@
31646
32396
  "type": "string"
31647
32397
  },
31648
32398
  "time_filter": {
31649
- "type": "string"
32399
+ "type": "string",
32400
+ "pattern": "^\\d+(?:[wdhms](?:\\d+[wdhms])*)?$"
31650
32401
  },
31651
32402
  "limit": {
31652
32403
  "type": "integer",
@@ -31672,7 +32423,8 @@
31672
32423
  "type": "object",
31673
32424
  "properties": {
31674
32425
  "time_filter": {
31675
- "type": "string"
32426
+ "type": "string",
32427
+ "pattern": "^\\d+(?:[wdhms](?:\\d+[wdhms])*)?$"
31676
32428
  },
31677
32429
  "limit": {
31678
32430
  "type": "integer",
@@ -31720,10 +32472,9 @@
31720
32472
  {
31721
32473
  "name": "export_logs",
31722
32474
  "title": "Export Log Entries to a Device File",
31723
- "risk": "read",
32475
+ "risk": "write",
31724
32476
  "annotations": {
31725
- "readOnlyHint": true,
31726
- "idempotentHint": true,
32477
+ "destructiveHint": false,
31727
32478
  "openWorldHint": false
31728
32479
  },
31729
32480
  "description": "Export RouterOS log entries to a file on the device filesystem (`/log print file=<name>`) with optional topic and time filters. Use when you need a persistent log file on the router for later retrieval (e.g. via FTP or SCP). For reading log entries directly to the MCP client use `get_logs`; for a quick count summary use `get_log_statistics`. `filename` defaults to `logs_export_<unix-timestamp>`; `time_filter` is a RouterOS duration string (e.g. `1h`); `topics` accepts a single RouterOS topic name. Returns the filename on success (file is written as `<filename>.txt` on the device).",
@@ -31738,7 +32489,8 @@
31738
32489
  "type": "string"
31739
32490
  },
31740
32491
  "time_filter": {
31741
- "type": "string"
32492
+ "type": "string",
32493
+ "pattern": "^\\d+(?:[wdhms](?:\\d+[wdhms])*)?$"
31742
32494
  },
31743
32495
  "format": {
31744
32496
  "default": "plain",
@@ -32066,10 +32818,9 @@
32066
32818
  {
32067
32819
  "name": "create_export",
32068
32820
  "title": "Create Full Configuration Export",
32069
- "risk": "read",
32821
+ "risk": "write",
32070
32822
  "annotations": {
32071
- "readOnlyHint": true,
32072
- "idempotentHint": true,
32823
+ "destructiveHint": false,
32073
32824
  "openWorldHint": false
32074
32825
  },
32075
32826
  "description": "Exports the complete device configuration to a `.rsc` plain-text script file (`/export file=<name>`), re-applicable via `import_configuration`. Unlike `create_backup`, the result is human-readable plain text — not a binary snapshot — and passwords are hidden by default (`hide_sensitive=true`). `file_format` changes only the file extension used when looking up the saved file — no `format=` flag is ever sent to RouterOS, so the content is always RouterOS script text regardless of the chosen extension; selecting `json` or `xml` will also cause the post-export file lookup to fail because RouterOS saves the file as `.rsc`. ALWAYS default to a FULL configuration export: leave `compact` and `verbose` off (the plain full export) unless the user explicitly asks for less or more. Set `compact` ONLY when the user wants a smaller diff that omits default values, or `verbose` ONLY when they want every parameter (including defaults). `export_type` only controls where the `file=` argument is positioned in the command and does not independently drive compactness or verbosity. For a single subsection only use `export_section`. Returns file details of the created export file.",
@@ -32113,10 +32864,9 @@
32113
32864
  {
32114
32865
  "name": "export_section",
32115
32866
  "title": "Export Configuration Section",
32116
- "risk": "read",
32867
+ "risk": "write",
32117
32868
  "annotations": {
32118
- "readOnlyHint": true,
32119
- "idempotentHint": true,
32869
+ "destructiveHint": false,
32120
32870
  "openWorldHint": false
32121
32871
  },
32122
32872
  "description": "Exports one RouterOS subsection to a `.rsc` script file (`/<section> export file=<name>`). Use when you need only a partial config snapshot rather than the full device export. `section` is the RouterOS command path without a leading slash — e.g. \"ip address\", \"interface vlan\", \"ip firewall filter\", \"ip firewall nat\", \"queue simple\". For the full device configuration use `create_export`; to apply the resulting file use `import_configuration`. Returns file details of the created `.rsc` file.",
@@ -33826,6 +34576,195 @@
33826
34576
  "additionalProperties": false
33827
34577
  }
33828
34578
  },
34579
+ {
34580
+ "name": "get_container_logs",
34581
+ "title": "Read Container Logs",
34582
+ "risk": "read",
34583
+ "annotations": {
34584
+ "readOnlyHint": true,
34585
+ "idempotentHint": true,
34586
+ "openWorldHint": false
34587
+ },
34588
+ "description": "Reads what containers wrote to the RouterOS log. A container's output reaches the log only when it was created or updated with `logging=yes`; the lines carry the `container` topic. Use it to see why a container stops, restarts or fails to start. `contains` keeps only the lines with that text (for example an error word or a process name), and `lines` limits the answer to the newest lines. RouterOS does not tag a line with the container's name, so with several logging containers the lines are mixed; filter with `contains`. Returns the newest matching lines, or says that there are none and why that may be.",
34589
+ "inputSchema": {
34590
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
34591
+ "type": "object",
34592
+ "properties": {
34593
+ "contains": {
34594
+ "description": "Keep only lines with this text",
34595
+ "type": "string",
34596
+ "maxLength": 80
34597
+ },
34598
+ "lines": {
34599
+ "default": 50,
34600
+ "type": "integer",
34601
+ "minimum": 1,
34602
+ "maximum": 500
34603
+ }
34604
+ },
34605
+ "required": ["lines"],
34606
+ "additionalProperties": false
34607
+ }
34608
+ },
34609
+ {
34610
+ "name": "upgrade_container_image",
34611
+ "title": "Upgrade a Container's Image",
34612
+ "risk": "write",
34613
+ "annotations": {
34614
+ "destructiveHint": false,
34615
+ "openWorldHint": false
34616
+ },
34617
+ "description": "Pulls the newest image for an existing container and keeps its settings (`/container repull`). The container must be stopped; pass `stop=true` to stop it first. What survives: everything in the container's MOUNTS, its env list and its settings. What is LOST: files the container wrote inside its own root directory, because the image is unpacked again. So a container with no mount is refused unless you pass `accept_data_loss=true`. DEFAULTS TO A DRY RUN (`apply=false`) that shows the image, the mounts that protect data, and the steps. The pull runs in the background: check `get_container` until the status is `stopped`, then `start_container`. On a RouterOS version without `repull`, the tool says so and changes nothing.",
34618
+ "inputSchema": {
34619
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
34620
+ "type": "object",
34621
+ "properties": {
34622
+ "name": {
34623
+ "type": "string",
34624
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,40}$",
34625
+ "description": "Container name"
34626
+ },
34627
+ "stop": {
34628
+ "default": false,
34629
+ "description": "Stop the container first when it runs",
34630
+ "type": "boolean"
34631
+ },
34632
+ "accept_data_loss": {
34633
+ "default": false,
34634
+ "description": "Allow the upgrade of a container that has no mount",
34635
+ "type": "boolean"
34636
+ },
34637
+ "apply": {
34638
+ "default": false,
34639
+ "description": "false = show the plan; true = upgrade",
34640
+ "type": "boolean"
34641
+ }
34642
+ },
34643
+ "required": ["name", "stop", "accept_data_loss", "apply"],
34644
+ "additionalProperties": false
34645
+ }
34646
+ },
34647
+ {
34648
+ "name": "deploy_container_stack",
34649
+ "title": "Deploy Containers From One Description",
34650
+ "risk": "write",
34651
+ "annotations": {
34652
+ "destructiveHint": false,
34653
+ "openWorldHint": false
34654
+ },
34655
+ "description": "Creates one or more containers from a single description, as a compose file does. For each service it creates the veth interface (and adds it to a bridge when you name one), an env list, the mounts, and the container itself with the image, in the right order. DEFAULTS TO A DRY RUN (`apply=false`) that returns every command, with env values hidden. Before it writes anything, every command is parsed on the router; if one is not valid for that RouterOS version, nothing is written. It picks the setting names the router knows (`envlists`/`mountlists`, or the older `envlist`/`mounts`). A service whose container name already exists is skipped, so the tool can be run again after a failure. It does NOT start the containers: the image is pulled in the background, so wait until `get_container` shows `stopped`, then `start_container`. The router must have the container package and container mode enabled (`get_routeros_container_guide`). It does not add firewall or NAT rules for the containers.",
34656
+ "inputSchema": {
34657
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
34658
+ "type": "object",
34659
+ "properties": {
34660
+ "services": {
34661
+ "minItems": 1,
34662
+ "maxItems": 12,
34663
+ "type": "array",
34664
+ "items": {
34665
+ "type": "object",
34666
+ "properties": {
34667
+ "name": {
34668
+ "type": "string",
34669
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,40}$",
34670
+ "description": "Container name; also names its env list and mounts"
34671
+ },
34672
+ "image": {
34673
+ "type": "string",
34674
+ "minLength": 1,
34675
+ "description": "Image to pull, e.g. 'pihole/pihole:latest'"
34676
+ },
34677
+ "veth": {
34678
+ "type": "object",
34679
+ "properties": {
34680
+ "name": {
34681
+ "type": "string",
34682
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,40}$"
34683
+ },
34684
+ "address": {
34685
+ "type": "string",
34686
+ "description": "Address with prefix, e.g. '172.20.0.2/24'"
34687
+ },
34688
+ "gateway": {
34689
+ "type": "string",
34690
+ "description": "Gateway, e.g. '172.20.0.1'"
34691
+ },
34692
+ "bridge": {
34693
+ "description": "Add the veth as a port of this existing bridge",
34694
+ "type": "string"
34695
+ }
34696
+ },
34697
+ "required": ["name", "address", "gateway"],
34698
+ "additionalProperties": false,
34699
+ "description": "The container's network interface, created when it does not exist"
34700
+ },
34701
+ "env": {
34702
+ "default": {},
34703
+ "type": "object",
34704
+ "propertyNames": {
34705
+ "type": "string",
34706
+ "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,80}$"
34707
+ },
34708
+ "additionalProperties": {
34709
+ "type": "string"
34710
+ }
34711
+ },
34712
+ "mounts": {
34713
+ "default": [],
34714
+ "type": "array",
34715
+ "items": {
34716
+ "type": "object",
34717
+ "properties": {
34718
+ "name": {
34719
+ "type": "string",
34720
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,40}$",
34721
+ "description": "Mount name (used by older RouterOS versions)"
34722
+ },
34723
+ "src": {
34724
+ "type": "string",
34725
+ "minLength": 1,
34726
+ "description": "Path on the router, e.g. '/usb1/pihole/etc'"
34727
+ },
34728
+ "dst": {
34729
+ "type": "string",
34730
+ "minLength": 1,
34731
+ "description": "Path in the container, e.g. '/etc/pihole'"
34732
+ }
34733
+ },
34734
+ "required": ["name", "src", "dst"],
34735
+ "additionalProperties": false
34736
+ }
34737
+ },
34738
+ "root_dir": {
34739
+ "description": "Where the image is unpacked, e.g. 'usb1/pihole/root'",
34740
+ "type": "string"
34741
+ },
34742
+ "cmd": {
34743
+ "type": "string"
34744
+ },
34745
+ "logging": {
34746
+ "default": true,
34747
+ "type": "boolean"
34748
+ },
34749
+ "start_on_boot": {
34750
+ "default": true,
34751
+ "type": "boolean"
34752
+ }
34753
+ },
34754
+ "required": ["name", "image", "veth", "env", "mounts", "logging", "start_on_boot"],
34755
+ "additionalProperties": false
34756
+ }
34757
+ },
34758
+ "apply": {
34759
+ "default": false,
34760
+ "description": "false = show the commands; true = create",
34761
+ "type": "boolean"
34762
+ }
34763
+ },
34764
+ "required": ["services", "apply"],
34765
+ "additionalProperties": false
34766
+ }
34767
+ },
33829
34768
  {
33830
34769
  "name": "set_safe_mode_timeout",
33831
34770
  "title": "Set Safe Mode Command Timeouts",
@@ -34689,6 +35628,141 @@
34689
35628
  "additionalProperties": false
34690
35629
  }
34691
35630
  },
35631
+ {
35632
+ "name": "list_config_templates",
35633
+ "title": "List Configuration Templates",
35634
+ "risk": "read",
35635
+ "annotations": {
35636
+ "readOnlyHint": true,
35637
+ "idempotentHint": true,
35638
+ "openWorldHint": false
35639
+ },
35640
+ "description": "Lists the configuration templates kept on the MCP host, each with the variables it needs. A template is RouterOS script text with `{{variable}}` places, applied to routers with apply_config_template. It contacts no router. Use it to see which templates exist before you provision a router. Returns one line per template.",
35641
+ "inputSchema": {
35642
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
35643
+ "type": "object",
35644
+ "properties": {},
35645
+ "additionalProperties": false
35646
+ }
35647
+ },
35648
+ {
35649
+ "name": "save_config_template",
35650
+ "title": "Save a Configuration Template",
35651
+ "risk": "write",
35652
+ "annotations": {
35653
+ "destructiveHint": false,
35654
+ "openWorldHint": false
35655
+ },
35656
+ "description": "Saves a configuration template on the MCP host. `content` is RouterOS script text: full commands, or export style with a menu line (`/ip address`) and `add …` lines under it. Write `{{name}}` where a value differs between routers, and `{{name|default}}` to give a default. A place stands for one whole value (`name={{identity}}`) and must NOT be inside quotes: the value is quoted for you when it is applied, which is also what stops a value from adding commands. A template with a place inside quotes is refused. Saving a name that exists replaces it. It changes no router. Returns the variables the template needs.",
35657
+ "inputSchema": {
35658
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
35659
+ "type": "object",
35660
+ "properties": {
35661
+ "name": {
35662
+ "type": "string",
35663
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,40}$",
35664
+ "description": "Template name"
35665
+ },
35666
+ "content": {
35667
+ "type": "string",
35668
+ "minLength": 1,
35669
+ "maxLength": 200000,
35670
+ "description": "RouterOS script text with {{variable}} places"
35671
+ }
35672
+ },
35673
+ "required": ["name", "content"],
35674
+ "additionalProperties": false
35675
+ }
35676
+ },
35677
+ {
35678
+ "name": "remove_config_template",
35679
+ "title": "Remove a Configuration Template",
35680
+ "risk": "destructive",
35681
+ "annotations": {
35682
+ "destructiveHint": true,
35683
+ "idempotentHint": true,
35684
+ "openWorldHint": false
35685
+ },
35686
+ "description": "Deletes one configuration template from the MCP host. It changes no router: a router that the template was applied to keeps its configuration. Returns whether a template was removed.",
35687
+ "inputSchema": {
35688
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
35689
+ "type": "object",
35690
+ "properties": {
35691
+ "name": {
35692
+ "type": "string",
35693
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,40}$",
35694
+ "description": "Template name"
35695
+ }
35696
+ },
35697
+ "required": ["name"],
35698
+ "additionalProperties": false
35699
+ }
35700
+ },
35701
+ {
35702
+ "name": "apply_config_template",
35703
+ "title": "Apply a Configuration Template to Routers",
35704
+ "risk": "write",
35705
+ "annotations": {
35706
+ "destructiveHint": false,
35707
+ "openWorldHint": false
35708
+ },
35709
+ "description": "Applies a saved configuration template to one or more routers, each with its own values: the way to provision a new router, or to give many routers the same reviewed configuration. `variables` holds the values for every router; `per_device` holds values for one router and wins. Two variables are always set for you: `device` (the name in this server's device list) and `host` (its address). DEFAULTS TO A DRY RUN (`apply=false`) that returns the rendered commands for each router. Before anything is written, every command is parsed on that router; a command that is not valid there stops that router with the place of the problem, and nothing is written to it. Applying takes a config snapshot and writes in Safe Mode, so a change that cuts the connection is rolled back. Routers are done one at a time, and the run stops at the first router that fails. To provision a factory-default router, first add it to the device list (by its MAC address for MAC-Telnet, or its default address); Safe Mode needs SSH, so a MAC-Telnet router is written directly.",
35710
+ "inputSchema": {
35711
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
35712
+ "type": "object",
35713
+ "properties": {
35714
+ "name": {
35715
+ "type": "string",
35716
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,40}$",
35717
+ "description": "Template name"
35718
+ },
35719
+ "devices": {
35720
+ "minItems": 1,
35721
+ "maxItems": 50,
35722
+ "type": "array",
35723
+ "items": {
35724
+ "type": "string"
35725
+ },
35726
+ "description": "Routers to apply the template to"
35727
+ },
35728
+ "variables": {
35729
+ "default": {},
35730
+ "description": "Values for every router",
35731
+ "type": "object",
35732
+ "propertyNames": {
35733
+ "type": "string"
35734
+ },
35735
+ "additionalProperties": {
35736
+ "type": "string"
35737
+ }
35738
+ },
35739
+ "per_device": {
35740
+ "default": {},
35741
+ "description": "Values for one router: { router: { variable: value } }",
35742
+ "type": "object",
35743
+ "propertyNames": {
35744
+ "type": "string"
35745
+ },
35746
+ "additionalProperties": {
35747
+ "type": "object",
35748
+ "propertyNames": {
35749
+ "type": "string"
35750
+ },
35751
+ "additionalProperties": {
35752
+ "type": "string"
35753
+ }
35754
+ }
35755
+ },
35756
+ "apply": {
35757
+ "default": false,
35758
+ "description": "false = show the commands; true = apply",
35759
+ "type": "boolean"
35760
+ }
35761
+ },
35762
+ "required": ["name", "devices", "variables", "per_device", "apply"],
35763
+ "additionalProperties": false
35764
+ }
35765
+ },
34692
35766
  {
34693
35767
  "name": "memory_get_scope",
34694
35768
  "title": "Inspect Memory Sharing Scope",