n8n-ops-mcp 0.8.1 → 0.10.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 +21 -0
- package/dist/mcp-server.js +755 -19
- package/index.ts +10 -0
- package/package.json +1 -1
- package/src/tools/audit-browser-bridge-usage.ts +269 -0
- package/src/tools/diff-workflow.ts +402 -0
- package/src/tools/scaffold-browser-bridge-node.ts +230 -0
package/README.md
CHANGED
|
@@ -25,7 +25,10 @@ For a catalog/docs tool that indexes n8n's node library, see [n8n-mcp](https://w
|
|
|
25
25
|
| `n8n_search_executions` | Text-search recent executions for an error fragment | |
|
|
26
26
|
| `n8n_list_webhooks` | Enumerate webhook + form-trigger URLs | |
|
|
27
27
|
| `n8n_validate_workflow` | Static checks: deprecated nodes, legacy Code-node API, orphans | |
|
|
28
|
+
| `n8n_diff_workflow` | Compare a workflow against a snapshot file or inline object - semantic diff (added/removed/modified nodes with field paths) | |
|
|
28
29
|
| `n8n_trigger` | Run a workflow via webhook (reliable) or workflow-id | |
|
|
30
|
+
| `n8n_audit_browser_bridge_usage` | Find every workflow that calls the [`browser-bridge`](https://github.com/solomonneas/browser-bridge) CLI (Execute Command, Code, SSH nodes) | |
|
|
31
|
+
| `n8n_scaffold_browser_bridge_node` | Generate a ready-to-paste n8n node that calls a `browser-bridge <platform> <action>` (no API call) | |
|
|
29
32
|
| `n8n_create_workflow` | Create a workflow (accepts `n8n_get_workflow` output directly; primary restore path) | ✓ |
|
|
30
33
|
| `n8n_activate` | Enable a workflow's triggers | ✓ |
|
|
31
34
|
| `n8n_deactivate` | Disable a workflow's triggers | ✓ |
|
|
@@ -57,6 +60,12 @@ Write tools are hidden unless `N8N_ENABLE_EDIT=true`.
|
|
|
57
60
|
|
|
58
61
|
**`n8n_validate_workflow`** - checks for deprecated node types (function → code), legacy Code-node API (`$node[]`, `items` global, `require()`), orphan nodes, disabled nodes, missing trigger. Returns issues with severity (error/warning/info) plus a summary count.
|
|
59
62
|
|
|
63
|
+
**`n8n_diff_workflow`** - compare a workflow's current state against a snapshot. Pass `id` plus exactly one of `snapshotPath` (absolute path; `~` resolved) or `snapshot` (inline object). Snapshot accepts both shapes: the flat backup written by `n8n_save_workflow` / `n8n_delete_workflow`, and the nested `n8n_get_workflow(includeDefinition=true)` shape (graph data under `definition`). Returns `summary` (counts: added/removed/modified/nameChanged/connectionsChanged/settingsChanged) plus `diff` with per-node `fieldsChanged` paths (e.g. `parameters.command`, `parameters.url`, `disabled`). Node matching is two-pass: id first, then name fallback for any unmatched nodes — handles legacy/hand-edited snapshots. Cosmetic changes (`position`, `webhookId`) are suppressed by default; pass `ignoreCosmetic: false` to surface them. Per-node detail is capped at `maxModifiedDetails` (default 50, max 500); `summary.nodesModified` counter is uncapped and `diff.nodesModifiedTruncated: true` flags when detail was clipped. Read-only.
|
|
64
|
+
|
|
65
|
+
**`n8n_audit_browser_bridge_usage`** - scans every workflow for nodes that invoke the `browser-bridge` CLI. Inspects `command` (Execute Command + SSH nodes) and `jsCode` / `pythonCode` / `functionCode` (Code + legacy Function nodes). Heuristic: `\bbrowser-bridge\.[cm]?js` followed by two kebab-slug args; the bare bin form is intentionally not detected to avoid false positives from path mentions like `cd /opt/browser-bridge`. Returns one finding per `(workflowId, nodeName, platform, action)` plus a `summary` of platform×action counts. Optional `platform`, `action`, `activeOnly` (default false), `includeArchived` (default false), `maxWorkflows` (default 250, max 1000), `concurrency` (default 3, max 8). Read-only. Pairs with `n8n_scaffold_browser_bridge_node` when you need to add another call. Companion repo: [browser-bridge](https://github.com/solomonneas/browser-bridge).
|
|
66
|
+
|
|
67
|
+
**`n8n_scaffold_browser_bridge_node`** - pure local generator (no n8n API call). Given `platform`, `action`, optional `input` JSON, and `mode: "code-node" | "execute-command"` (default `code-node`), emits a ready-to-paste n8n node JSON that mirrors `browser-bridge`'s `docs/n8n-usage.md` patterns. The Code node uses `spawnSync` with stdin JSON and surfaces `payload.exitCode` + `stderr` so downstream nodes can branch on `ok`. The Execute Command node uses a quoted `<<'JSON'` heredoc so the input passes through unmangled. Optional `bridgeDir` (default `/home/clawdbot/.openclaw/workspace/pipeline/work/browser-bridge`), `nodeName`, `position`. Platform/action are validated as kebab slugs - keeps them safe to interpolate into the shell command. Warns when `execute-command` is used with non-empty `input` (heredoc bakes the JSON in; no per-item upstream wiring).
|
|
68
|
+
|
|
60
69
|
**`n8n_trigger`** - two modes:
|
|
61
70
|
- `mode: "webhook"` + `webhookPath` - POST (or GET/PUT/DELETE) to the configured base URL + path, with an optional JSON `payload`. This is the reliable path.
|
|
62
71
|
- `mode: "workflow"` + `workflowId` - attempts `POST /api/v1/workflows/:id/execute`. Pre-checks that the workflow is active and has a webhook/manual/form trigger. Most n8n builds don't expose this endpoint on the Public API and will 405; the tool surfaces a hint to switch to webhook mode.
|
|
@@ -250,6 +259,18 @@ Calls `n8n_search_executions` with `query: "ECONNREFUSED"`.
|
|
|
250
259
|
|
|
251
260
|
Calls `n8n_list_webhooks` to find the path, then `n8n_trigger` with `mode=webhook`.
|
|
252
261
|
|
|
262
|
+
> What changed in my "intel pipeline" workflow since yesterday's backup?
|
|
263
|
+
|
|
264
|
+
Calls `n8n_diff_workflow` with `id` and `snapshotPath` pointing to the backup file. Returns added/removed/modified nodes with parameter-level field paths.
|
|
265
|
+
|
|
266
|
+
> Where am I calling Linktree sync from?
|
|
267
|
+
|
|
268
|
+
Calls `n8n_audit_browser_bridge_usage` with `platform: "linktree"` to list every node (across all workflows) that invokes `browser-bridge linktree <action>`.
|
|
269
|
+
|
|
270
|
+
> Add a CoderLegion `scan-comments` step to a new workflow
|
|
271
|
+
|
|
272
|
+
Calls `n8n_scaffold_browser_bridge_node` with `platform: "coderlegion"`, `action: "scan-comments"`, `input: {limit: 5}` to get a Code node JSON, then pastes it into n8n.
|
|
273
|
+
|
|
253
274
|
> Audit my workflows for deprecated Code-node API usage
|
|
254
275
|
|
|
255
276
|
Calls `n8n_list_workflows` then `n8n_validate_workflow` per id, filters for `code-node-old-node-ref` and `code-node-items-global` warnings.
|