@usex/mikrotik-mcp 5.6.0 → 5.8.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.
- package/README.md +61 -22
- package/dist/cli.js +75679 -4194
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15035 -66
- package/dist/shared/cli-ejryxvb3.js +13 -0
- package/dist/shared/library-hsq1a106.js +11 -0
- package/dist/shared/{cli-gyqfq9j6.js → library-srhzw8ym.js} +36138 -27615
- package/dist/ui/aaa.html +48 -58
- package/dist/ui/connected-devices.html +48 -58
- package/dist/ui/dashboard.html +48 -58
- package/dist/ui/firewall-audit.html +48 -58
- package/dist/ui/firewall.html +49 -59
- package/dist/ui/interfaces.html +48 -58
- package/dist/ui/observability.html +169 -69
- package/dist/ui/records.html +49 -59
- package/package.json +34 -25
- package/prompts/build-tunnel-transactionally.md +13 -10
- package/schemas/README.md +1 -1
- package/schemas/config.schema.json +79 -0
- package/schemas/tool-catalog.json +514 -10
- package/schemas/tools/audit_service_contracts.json +7 -0
- package/schemas/tools/create_investigation.json +42 -0
- package/schemas/tools/create_service_contract.json +53 -0
- package/schemas/tools/get_investigation.json +14 -0
- package/schemas/tools/inspect_flow_path.json +50 -0
- package/schemas/tools/list_client_flow_candidates.json +14 -0
- package/schemas/tools/list_investigations.json +7 -0
- package/schemas/tools/list_service_contracts.json +7 -0
- package/schemas/tools/list_service_probe_targets.json +7 -0
- package/schemas/tools/run_service_contract.json +14 -0
- package/schemas/tools/service_contract_history.json +14 -0
- package/schemas/tools/start_rollout.json +21 -0
- package/schemas/tools/trace_round_trip.json +129 -0
- package/dist/shared/cli-h41j14aw.js +0 -13
- package/dist/shared/library-135yzct0.js +0 -45586
- package/dist/shared/library-v52e871r.js +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usex/mikrotik-mcp",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"description": "MCP server for MikroTik RouterOS — 780+ tools over SSH for firewall, NAT, routing, DHCP, DNS, WireGuard, wireless, QoS and more.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -48,12 +48,13 @@
|
|
|
48
48
|
"access": "public"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
|
-
"build": "bunup && chmod +x dist/cli.js && bun run build:ui",
|
|
51
|
+
"build": "bunup && chmod +x dist/cli.js && bun run test:built && bun run build:ui",
|
|
52
52
|
"build:ui": "bun run --bun scripts/build-ui.ts",
|
|
53
53
|
"build:mcp": "bun run --bun scripts/build-mcpb.ts",
|
|
54
54
|
"build:mcp:all": "bun run --bun scripts/build-mcpb.ts --all",
|
|
55
55
|
"dev": "bunup --watch",
|
|
56
|
-
"
|
|
56
|
+
"dev:dashboard": "bunx vp dev -c ui/vite.observability.config.ts",
|
|
57
|
+
"prepack": "bun run build && bun run gen",
|
|
57
58
|
"auth-check": "bun run --bun src/cli.ts auth-check",
|
|
58
59
|
"gen:schemas": "bun run --bun scripts/gen-schemas.ts && vp fmt --write schemas",
|
|
59
60
|
"gen:docs": "bun run --bun scripts/gen-tool-docs.ts && vp fmt --write docs/tools-reference.md",
|
|
@@ -73,6 +74,7 @@
|
|
|
73
74
|
"security:all": "bun run security:audit && bun run security:licenses",
|
|
74
75
|
"prepublish:security": "npm run security:all",
|
|
75
76
|
"test": "vp test run",
|
|
77
|
+
"test:built": "bun run --bun scripts/check-mcp-build.ts",
|
|
76
78
|
"test:watch": "vp test",
|
|
77
79
|
"test:coverage": "vp test --ui --coverage --watch",
|
|
78
80
|
"release": "release-it",
|
|
@@ -85,59 +87,66 @@
|
|
|
85
87
|
"prepare": "vp config"
|
|
86
88
|
},
|
|
87
89
|
"dependencies": {
|
|
88
|
-
"@modelcontextprotocol/
|
|
90
|
+
"@modelcontextprotocol/client": "^2.0.0",
|
|
91
|
+
"@modelcontextprotocol/core": "^2.0.0",
|
|
92
|
+
"@modelcontextprotocol/ext-apps": "^2.0.0",
|
|
89
93
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
90
94
|
"@tikoci/centrs": "^0.1.0",
|
|
91
95
|
"figlet": "^1.11.4",
|
|
92
96
|
"gradient-string": "^3.0.0",
|
|
93
|
-
"ipaddr.js": "^2.
|
|
97
|
+
"ipaddr.js": "^2.5.0",
|
|
94
98
|
"ssh2": "^1.17.0",
|
|
95
|
-
"zod": "^4.
|
|
99
|
+
"zod": "^4.6.5"
|
|
96
100
|
},
|
|
97
101
|
"devDependencies": {
|
|
98
102
|
"@anthropic-ai/mcpb": "^2.1.2",
|
|
103
|
+
"@paper-design/shaders-react": "^0.0.80",
|
|
99
104
|
"@resvg/resvg-js": "^2.6.2",
|
|
100
105
|
"@tailwindcss/vite": "^4.3.3",
|
|
101
|
-
"@
|
|
106
|
+
"@tanstack/react-virtual": "^3.14.13",
|
|
107
|
+
"@types/bun": "1.4.2",
|
|
102
108
|
"@types/figlet": "^1.7.0",
|
|
103
|
-
"@types/node": "^26.1
|
|
104
|
-
"@types/react": "^19.
|
|
105
|
-
"@types/react-dom": "^19.
|
|
106
|
-
"@types/ssh2": "^1.15.
|
|
109
|
+
"@types/node": "^26.5.1",
|
|
110
|
+
"@types/react": "^19.3.0",
|
|
111
|
+
"@types/react-dom": "^19.3.0",
|
|
112
|
+
"@types/ssh2": "^1.15.6",
|
|
107
113
|
"@types/update-notifier": "^6.0.8",
|
|
108
|
-
"@
|
|
109
|
-
"@vitest/
|
|
114
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
115
|
+
"@vitest/coverage-v8": "5.0.0",
|
|
116
|
+
"@vitest/ui": "5.0.0",
|
|
110
117
|
"bunup": "^0.16.32",
|
|
111
118
|
"class-variance-authority": "^0.7.1",
|
|
112
119
|
"clsx": "^2.1.1",
|
|
113
120
|
"gsap": "^3.15.0",
|
|
121
|
+
"happy-dom": "^20.14.5",
|
|
122
|
+
"lenis": "^1.3.26",
|
|
114
123
|
"license-checker": "^25.0.1",
|
|
115
|
-
"lucide-react": "^1.
|
|
124
|
+
"lucide-react": "^1.46.0",
|
|
125
|
+
"motion": "^13.3.0",
|
|
116
126
|
"radix-ui": "^1.6.7",
|
|
117
|
-
"react": "^19.
|
|
118
|
-
"react-dom": "^19.
|
|
127
|
+
"react": "^19.3.0",
|
|
128
|
+
"react-dom": "^19.3.0",
|
|
119
129
|
"recharts": "^3.10.1",
|
|
120
|
-
"release-it": "^21.0.
|
|
121
|
-
"
|
|
122
|
-
"
|
|
130
|
+
"release-it": "^21.0.3",
|
|
131
|
+
"shiki": "^4.4.3",
|
|
132
|
+
"sonner": "^2.0.8",
|
|
133
|
+
"tailwind-merge": "^3.7.0",
|
|
123
134
|
"tailwindcss": "^4.3.3",
|
|
124
135
|
"tw-animate-css": "^1.4.0",
|
|
136
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
125
137
|
"vite": "catalog:",
|
|
126
138
|
"vite-plus": "catalog:"
|
|
127
139
|
},
|
|
128
|
-
"peerDependencies": {
|
|
129
|
-
"typescript": "^7.0.2"
|
|
130
|
-
},
|
|
131
140
|
"overrides": {
|
|
132
141
|
"vite": "catalog:"
|
|
133
142
|
},
|
|
134
143
|
"engines": {
|
|
135
144
|
"bun": ">=1.3.0"
|
|
136
145
|
},
|
|
137
|
-
"packageManager": "bun@1.
|
|
146
|
+
"packageManager": "bun@1.4.2",
|
|
138
147
|
"catalog": {
|
|
139
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.
|
|
140
|
-
"vite-plus": "0.
|
|
148
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.1",
|
|
149
|
+
"vite-plus": "0.3.1"
|
|
141
150
|
},
|
|
142
151
|
"changelog": {
|
|
143
152
|
"labels": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: build-tunnel-transactionally
|
|
3
3
|
title: Build a site-to-site tunnel as one cross-device transaction
|
|
4
|
-
description:
|
|
4
|
+
description: Preferred coordinated workflow for both ends of an approved site-to-site tunnel — stage, verify, then commit with explicit approval; partial commits require manual recovery.
|
|
5
5
|
arguments:
|
|
6
6
|
- name: site_a
|
|
7
7
|
description: Configured device name of the first router (one end of the tunnel).
|
|
@@ -15,7 +15,7 @@ arguments:
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
17
|
Build a tunnel between **{{site_a}}** and **{{site_b}}** as a single
|
|
18
|
-
cross-device transaction,
|
|
18
|
+
cross-device transaction, verifying both ends before issuing sequential commits.
|
|
19
19
|
|
|
20
20
|
Tunnel to build: {{tunnel}}
|
|
21
21
|
|
|
@@ -35,14 +35,15 @@ Follow these steps:
|
|
|
35
35
|
|
|
36
36
|
2. **Open the transaction.** Call `begin_transaction` with
|
|
37
37
|
`devices=["{{site_a}}", "{{site_b}}"]`, a `label`, and — this is the part that
|
|
38
|
-
|
|
38
|
+
improves verification — `assertions` for the expected router-side state:
|
|
39
39
|
- `{"kind": "ping", "from": "{{site_a}}", "to": "<{{site_b}} tunnel address>"}`
|
|
40
40
|
- `{"kind": "wireguard-peer-handshake", "device": "{{site_a}}", "peer": "<{{site_b}} public key>"}`
|
|
41
41
|
(WireGuard only)
|
|
42
|
-
- `{"kind": "reachable", "device": "{{site_b}}"}` —
|
|
42
|
+
- `{"kind": "reachable", "device": "{{site_b}}"}` — evidence that the
|
|
43
43
|
far end is still answering after its own changes.
|
|
44
44
|
Set `jump_host` if one router is reached through the other; the tool warns
|
|
45
|
-
when it is not committed last.
|
|
45
|
+
when it is not committed last. Set `commit_order` explicitly with that
|
|
46
|
+
participant last. Assertions do not prove client application health.
|
|
46
47
|
|
|
47
48
|
3. **Queue every command.** One `add_transaction_step` per RouterOS command,
|
|
48
49
|
naming the participant it runs on. Nothing executes yet. Cover both ends
|
|
@@ -51,15 +52,17 @@ Follow these steps:
|
|
|
51
52
|
|
|
52
53
|
4. **Prepare and verify.** Call `verify_transaction`. This snapshots each device,
|
|
53
54
|
applies its steps inside Safe Mode, and runs the assertions against the
|
|
54
|
-
still-uncommitted fleet.
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
still-uncommitted fleet. This changes live traffic and requires prior approval;
|
|
56
|
+
it is not a read-only check. Failure triggers rollback attempts. Report every
|
|
57
|
+
participant's state and rollback evidence before considering a revised plan.
|
|
57
58
|
|
|
58
|
-
5. **Commit.** Only after a clean verify
|
|
59
|
+
5. **Commit.** Only after a clean verify and approval covering this exact commit,
|
|
60
|
+
call `commit_transaction`. Read the
|
|
59
61
|
terminal state out loud:
|
|
60
62
|
- `COMMITTED` — both ends persisted; confirm with a final `ping` and
|
|
61
63
|
`get_wireguard_status`.
|
|
62
|
-
- `ABORTED` —
|
|
64
|
+
- `ABORTED` — no participant committed; inspect rollback results and live state
|
|
65
|
+
before proposing a retry. Staged changes may already have affected traffic.
|
|
63
66
|
- `PARTIAL` — **tell the user immediately and stop**. Name each device's state
|
|
64
67
|
and the snapshot id in the report; the fix is a manual restore
|
|
65
68
|
(`diff_config_snapshots <id> live`, then `config_reconcile` or
|
package/schemas/README.md
CHANGED
|
@@ -7,7 +7,7 @@ edit by hand — regenerate instead.
|
|
|
7
7
|
| File | Contents |
|
|
8
8
|
| -------------------- | ------------------------------------------------------------------------------------------ |
|
|
9
9
|
| `config.schema.json` | The runtime configuration object (env vars / CLI flags). |
|
|
10
|
-
| `tool-catalog.json` | Every one of the
|
|
10
|
+
| `tool-catalog.json` | Every one of the 903 tools: `name`, `risk`, `title`, `description`, and input JSON Schema. |
|
|
11
11
|
| `tools/<name>.json` | The input JSON Schema for a single tool. |
|
|
12
12
|
|
|
13
13
|
`risk` is derived from the MCP tool annotations:
|
|
@@ -3,6 +3,84 @@
|
|
|
3
3
|
"title": "MikrotikConfig",
|
|
4
4
|
"type": "object",
|
|
5
5
|
"properties": {
|
|
6
|
+
"serviceProbes": {
|
|
7
|
+
"default": {
|
|
8
|
+
"scheduled": {},
|
|
9
|
+
"targets": {},
|
|
10
|
+
"timeoutMs": 5000
|
|
11
|
+
},
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"scheduled": {
|
|
15
|
+
"default": {},
|
|
16
|
+
"type": "object",
|
|
17
|
+
"propertyNames": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"additionalProperties": {
|
|
21
|
+
"maxItems": 5,
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"format": "uuid",
|
|
26
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"targets": {
|
|
31
|
+
"default": {},
|
|
32
|
+
"type": "object",
|
|
33
|
+
"propertyNames": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"pattern": "^[a-z\\d_-]{1,64}$"
|
|
36
|
+
},
|
|
37
|
+
"additionalProperties": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"properties": {
|
|
40
|
+
"kind": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"enum": ["dns", "tcp", "tls", "https"]
|
|
43
|
+
},
|
|
44
|
+
"host": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"minLength": 1,
|
|
47
|
+
"maxLength": 253,
|
|
48
|
+
"pattern": "^[a-z\\d](?:[a-z\\d.-]*[a-z\\d])?$"
|
|
49
|
+
},
|
|
50
|
+
"port": {
|
|
51
|
+
"default": 443,
|
|
52
|
+
"type": "integer",
|
|
53
|
+
"minimum": 1,
|
|
54
|
+
"maximum": 65535
|
|
55
|
+
},
|
|
56
|
+
"path": {
|
|
57
|
+
"default": "/health",
|
|
58
|
+
"type": "string",
|
|
59
|
+
"maxLength": 1024
|
|
60
|
+
},
|
|
61
|
+
"addresses": {
|
|
62
|
+
"minItems": 1,
|
|
63
|
+
"maxItems": 32,
|
|
64
|
+
"type": "array",
|
|
65
|
+
"items": {
|
|
66
|
+
"type": "string"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": ["kind", "host", "port", "path", "addresses"],
|
|
71
|
+
"additionalProperties": false
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"timeoutMs": {
|
|
75
|
+
"default": 5000,
|
|
76
|
+
"type": "integer",
|
|
77
|
+
"minimum": 100,
|
|
78
|
+
"maximum": 10000
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"required": ["scheduled", "targets", "timeoutMs"],
|
|
82
|
+
"additionalProperties": false
|
|
83
|
+
},
|
|
6
84
|
"devices": {
|
|
7
85
|
"default": {
|
|
8
86
|
"default": {
|
|
@@ -808,6 +886,7 @@
|
|
|
808
886
|
}
|
|
809
887
|
},
|
|
810
888
|
"required": [
|
|
889
|
+
"serviceProbes",
|
|
811
890
|
"devices",
|
|
812
891
|
"defaultDevice",
|
|
813
892
|
"mcp",
|