n8n-mcp-community 0.1.4 → 0.2.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/CHANGELOG.md CHANGED
@@ -6,6 +6,50 @@ All notable changes to this project will be documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.2.0] - Frozen release candidate
10
+
11
+ Version 0.2.0 is a frozen release candidate. Availability is established only
12
+ by matching npm provenance, GitHub Release assets and signatures, and MCP
13
+ Registry readbacks; this immutable entry is not rewritten after publication.
14
+
15
+ ### Removed
16
+
17
+ - **Breaking input-schema change:** the 14 unsafe tools no longer publish or
18
+ require the former `confirmation` input. Normal MCP clients refresh this
19
+ schema when they reconnect; raw scripted callers must stop sending that
20
+ field. This incompatible `0.x` change is released as a new minor version.
21
+
22
+ ### Changed
23
+
24
+ - Selecting `N8N_MCP_MODE=unsafe` is now the complete server-side authorization
25
+ gate for the 14 elevated tools. Strict mode separation, MCP safety
26
+ annotations, n8n API permissions, input validation, and metadata-only mutation
27
+ audit events remain.
28
+ - The README and client guides now use
29
+ `npm install --global n8n-mcp-community@latest` as the primary installation
30
+ path, with `npx` as the no-global-install alternative and exact version pins
31
+ retained for audit and rollback.
32
+ - The README now follows a short landing-page flow: value, install, connect,
33
+ proof, and deeper docs. Copyable commands and clear npm, npx, and MCPB paths
34
+ replace the former release-review-first setup.
35
+ - The demo now shows installation, connection, and a useful Introspect finding
36
+ with a clear fix. Its command uses `@latest`, and every frame uses synthetic
37
+ data.
38
+ - Homebrew is listed as a planned CLI install channel. It remains separate from
39
+ MCPB updates and is not yet available.
40
+
41
+ ### Upgrade from 0.1.x
42
+
43
+ - Existing URL, API-key, and mode values do not change.
44
+ - Global npm users run the same install command again. Users who followed the
45
+ 0.1.x pinned npx guide must replace `n8n-mcp-community@0.1.4` in their client
46
+ `args` with `n8n-mcp-community@latest` or `n8n-mcp-community@0.2.0`.
47
+ - Privately distributed MCPB files update manually: download and install the
48
+ new signed bundle. The install guide also gives a remove-and-reinstall
49
+ rollback path.
50
+ - Restart the MCP client after updating so it reloads `tools/list`. Custom code
51
+ that calls unsafe tools as raw JSON must remove the old `confirmation` field.
52
+
9
53
  ## [0.1.4] - Frozen release candidate
10
54
 
11
55
  Version 0.1.4 is a frozen release candidate. Availability is established only
@@ -241,6 +285,7 @@ Registry readbacks; this immutable entry is not rewritten after publication.
241
285
  publishable history; authenticated public release receipts remain supported.
242
286
 
243
287
  [Unreleased]: #unreleased
288
+ [0.2.0]: #020---frozen-release-candidate
244
289
  [0.1.4]: #014---frozen-release-candidate
245
290
  [0.1.3]: #013---frozen-release-candidate
246
291
  [0.1.2]: #012---frozen-release-candidate
package/README.md CHANGED
@@ -2,29 +2,81 @@
2
2
 
3
3
  [![n8n-mcp-community MCP server](https://glama.ai/mcp/servers/drzamarian/n8n-mcp-community/badges/score.svg)](https://glama.ai/mcp/servers/drzamarian/n8n-mcp-community)
4
4
 
5
- **A security-focused Model Context Protocol server for self-hosted n8n Community Edition.**
6
-
7
- Connect an MCP client to a **bounded 44-tool n8n Community Edition management surface**: create, edit,
8
- activate, and delete workflows, update individual nodes surgically, and manage
9
- executions, credentials, tags, users, diagnostics, and instance metadata — 44
10
- carefully bounded tools in total. Safety here is **progressive, not
11
- restrictive**: the server defaults to read-only, `write` unlocks authoring,
12
- and `unsafe` unlocks every tool with an exact per-call confirmation phrase for
13
- each destructive operation. It starts offline, uses the supported n8n Public
14
- API, and never sends workflow data to an external AI provider.
15
-
16
- > **Release evidence:** install only a version that appears consistently on
17
- > [npm](https://www.npmjs.com/package/n8n-mcp-community), the
18
- > [latest GitHub release](https://github.com/drzamarian/n8n-mcp-community/releases/latest),
19
- > and the MCP Registry entry `io.github.drzamarian/n8n-mcp-community`. A version
20
- > in the source tree remains a candidate until those external readbacks agree.
21
- > See [Installation](docs/installation.md).
22
-
23
- [Read the synthetic terminal demo transcript](docs/demo-transcript.md). It shows
24
- the exact-version startup, 44-tool inventory, and local Introspect
25
- diagnostics using only synthetic identifiers and documented output shapes.
26
-
27
- [![Animated synthetic terminal demonstration showing the exact-version startup, MCP inventory, and local Introspect result](docs/assets/demo.gif)](docs/demo-transcript.md)
5
+ # A security-focused Model Context Protocol server for self-hosted n8n Community Edition
6
+
7
+ Give your AI client 44 tools for self-hosted n8n Community Edition. Manage
8
+ workflows, nodes, runs, credentials, tags, users, and diagnostics. No paid n8n
9
+ features. The server makes no external AI calls.
10
+
11
+ [![Install with npm](https://img.shields.io/badge/Install_with-npm-CB3837?logo=npm&logoColor=white)](#install)
12
+ [![Download MCPB](https://img.shields.io/badge/Download-MCPB-6B4EFF)](https://github.com/drzamarian/n8n-mcp-community/releases/latest)
13
+ [![Read the docs](https://img.shields.io/badge/Read-the_docs-1F6FEB)](docs/README.md)
14
+
15
+ ## Install
16
+
17
+ You need Node.js 22 or 24, your n8n URL, and an n8n API key.
18
+
19
+ ### Install
20
+
21
+ ```bash
22
+ npm install --global n8n-mcp-community@latest
23
+ ```
24
+
25
+ `--global` installs the command once. Use `npx` below if you do not want a
26
+ global install.
27
+
28
+ ### Connect
29
+
30
+ ```json
31
+ {
32
+ "mcpServers": {
33
+ "n8n-community": {
34
+ "command": "n8n-mcp-community",
35
+ "env": {
36
+ "N8N_API_URL": "https://n8n.example.com",
37
+ "N8N_API_KEY": "replace-with-a-dedicated-api-key",
38
+ "N8N_MCP_MODE": "read-only"
39
+ }
40
+ }
41
+ }
42
+ }
43
+ ```
44
+
45
+ Restart your client. You should see 44 tools, 5 resources, and 4 prompts.
46
+
47
+ If the client cannot find the command, run `command -v n8n-mcp-community` on
48
+ macOS/Linux or `where n8n-mcp-community` on Windows. Put that full path in
49
+ `"command"`.
50
+
51
+ Want no global install? Copy this command into the client configuration shown
52
+ in the full guide:
53
+
54
+ ```bash
55
+ npx --yes n8n-mcp-community@latest
56
+ ```
57
+
58
+ Want the Claude Desktop app flow? Use the MCPB below. See the full
59
+ [installation guide](docs/installation.md) for updates, rollback, and checks.
60
+
61
+ ### Claude Desktop: install the MCPB (no Node.js needed)
62
+
63
+ 1. Open the [latest GitHub release](https://github.com/drzamarian/n8n-mcp-community/releases/latest).
64
+ 2. Download the file that ends in `.mcpb`.
65
+ 3. In Claude Desktop, open **Settings → Extensions → Advanced settings →
66
+ Install Extension…**.
67
+ 4. Pick the file. Enter your n8n URL, API key, and mode.
68
+
69
+ [Anthropic's MCPB guide](https://support.claude.com/en/articles/10949351-getting-started-with-local-mcp-servers-on-claude-desktop)
70
+ explains the same steps. Our [installation guide](docs/installation.md) explains
71
+ how to check the download.
72
+
73
+ > Install public builds only from
74
+ > [npm](https://www.npmjs.com/package/n8n-mcp-community) or the
75
+ > [latest GitHub release](https://github.com/drzamarian/n8n-mcp-community/releases/latest).
76
+
77
+ [![Animated demo showing installation, connection, and a useful local Introspect finding](docs/assets/demo.gif)](docs/demo-transcript.md)
78
+
79
+ [Read the demo transcript](docs/demo-transcript.md).
28
80
 
29
81
  ## Why this project
30
82
 
@@ -32,8 +84,8 @@ diagnostics using only synthetic identifiers and documented output shapes.
32
84
  n8n Community Edition, without presenting paid-only capabilities as available.
33
85
  - **44 useful tools, one explicit contract.** Every tool has bounded inputs,
34
86
  documented side effects, MCP safety annotations, and contract tests.
35
- - **Safe by default.** Read-only mode is the default. Writes and destructive or
36
- externally contacting operations require progressively stronger gates.
87
+ - **Safe by default.** Read-only mode is the default. You choose when to allow
88
+ writes or the full tool set.
37
89
  - **Deterministic Introspect.** `n8n_introspect` runs a local 23-rule engine;
38
90
  it does not execute workflows, call an agent, or contact an external model.
39
91
  - **Surgical node updates.** `n8n_update_node` changes one validated node path
@@ -44,13 +96,16 @@ diagnostics using only synthetic identifiers and documented output shapes.
44
96
  - **Data minimization.** Credential values, raw execution values, pin data, and
45
97
  static workflow data are not returned by the generic public tools.
46
98
 
99
+ <details>
100
+ <summary><strong>See verification evidence</strong></summary>
101
+
47
102
  ## Current verification
48
103
 
49
104
  The current source candidate has been verified with:
50
105
 
51
106
  - exactly **44 tools**, **5 resources**, and **4 prompts** over real stdio;
52
- - **295 passing tests** and the complete verification gate on Node.js 22.23.1
53
- and 24.18.0;
107
+ - **296 passing tests** locally on Node.js 24.18.1; CI and release gates require
108
+ the pinned Node.js 22.23.1 and 24.18.0 matrix;
54
109
  - zero findings from Gitleaks, Semgrep, Trivy, and both project-root
55
110
  production/full `npm audit` runs; all three source scanners are reproduced in
56
111
  CI, with immutable scanner/action identities;
@@ -70,90 +125,20 @@ repository-pinned MCPB signing identity, a human artifact-baseline receipt,
70
125
  tag-scoped protected-environment approval, and an externally signed MCPB
71
126
  handoff verified byte for byte against the reviewed unsigned candidate.
72
127
 
73
- ## Quick start
74
-
75
- Requirements: Node.js 22 or 24, npm, a self-hosted n8n Community Edition
76
- instance, and an n8n Public API key with only the permissions you need.
77
-
78
- First identify a version whose npm provenance and GitHub release assets you have
79
- verified, then replace `<VERIFIED_VERSION>` below. Keep the pin exact:
80
-
81
- ```json
82
- {
83
- "mcpServers": {
84
- "n8n-community": {
85
- "command": "npx",
86
- "args": ["--yes", "n8n-mcp-community@<VERIFIED_VERSION>"],
87
- "env": {
88
- "N8N_API_URL": "https://n8n.example.com",
89
- "N8N_API_KEY": "replace-with-a-dedicated-api-key",
90
- "N8N_MCP_MODE": "read-only"
91
- }
92
- }
93
- }
94
- }
95
- ```
96
-
97
- `read-only` is the recommended starting point, not a capability ceiling: the
98
- same 44-tool surface includes full workflow authoring. Set
99
- `N8N_MCP_MODE=write` to create and edit workflows, nodes, credentials, and
100
- tags, or `N8N_MCP_MODE=unsafe` to enable every tool — activation, deletion,
101
- retries, and the other destructive operations, each still guarded by an exact
102
- per-call confirmation phrase. See [Safety modes](#safety-modes).
103
-
104
- Restart the MCP client and confirm exactly 44 tools, 5 resources, and 4
105
- prompts. Compatible desktop clients can instead install the signed MCPB from
106
- the [latest verified release](https://github.com/drzamarian/n8n-mcp-community/releases/latest);
107
- verify its checksum against the release `SHA256SUMS` first.
108
-
109
- ## Quick start from source
110
-
111
- Requirements: Node.js 22 or 24, npm, and a Git checkout of this repository.
112
-
113
- ```bash
114
- npm ci
115
- npm run verify:contributor
116
- ```
117
-
118
- Configure your MCP client to run the compiled stdio entry point:
119
-
120
- ```json
121
- {
122
- "mcpServers": {
123
- "n8n-community": {
124
- "command": "node",
125
- "args": ["/absolute/path/to/n8n-mcp-community/dist/index.js"],
126
- "env": {
127
- "N8N_API_URL": "https://n8n.example.com",
128
- "N8N_API_KEY": "replace-with-your-api-key",
129
- "N8N_MCP_MODE": "read-only"
130
- }
131
- }
132
- }
133
- }
134
- ```
135
-
136
- Restart the MCP client and list tools. The server can initialize and expose its
137
- inventory without n8n credentials; connected tools validate the URL and API key
138
- only when called.
139
-
140
- Verified releases provide both a signed MCPB for compatible clients and
141
- exact-version `npx` configuration for portability. `@latest`, global installs,
142
- and `curl | shell` are not reproducible defaults. See
143
- [Installation](docs/installation.md) for the release policy and client-specific
144
- guidance.
128
+ </details>
145
129
 
146
130
  ## Safety modes
147
131
 
148
- | Mode | What it allows | Required configuration |
149
- | --------- | ----------------------------------------------------------------- | ---------------------------------------------------------- |
150
- | Read-only | Read-only tools only | Default, or `N8N_MCP_MODE=read-only` |
151
- | Write | Read-only and mutation tools without the unsafe confirmation gate | `N8N_MCP_MODE=write` |
152
- | Unsafe | All tools | `N8N_MCP_MODE=unsafe` plus the exact per-call confirmation |
132
+ | Mode | What it allows | Required configuration |
133
+ | --------- | --------------------------------------------------------------- | ------------------------------------ |
134
+ | Read-only | Read-only tools only | Default, or `N8N_MCP_MODE=read-only` |
135
+ | Write | Read-only and ordinary mutation tools | `N8N_MCP_MODE=write` |
136
+ | Unsafe | All tools, including destructive or external-contact operations | `N8N_MCP_MODE=unsafe` |
153
137
 
154
- Unsafe mode is necessary but not sufficient. Every unsafe call also requires a
155
- confirmation such as `DELETE wf_123`, `STOP exec_123`, or `TEST cred_123`.
156
- The n8n API key remains the final upstream permission boundary.
138
+ Selecting unsafe mode is the complete server-side authorization gate for unsafe
139
+ tools. MCP safety annotations remain accurate so compatible clients can apply
140
+ their native approval UX, and the n8n API key remains the final upstream
141
+ permission boundary.
157
142
 
158
143
  Plain HTTP is accepted automatically only for loopback URLs. A non-loopback
159
144
  HTTP instance additionally requires `N8N_ALLOW_INSECURE_HTTP=1`, which accepts
@@ -173,14 +158,14 @@ failure, and security reference.
173
158
  | [`n8n_workflows_create`](docs/tools.md#n8n_workflows_create) | Write | Create a validated workflow through the Public API. |
174
159
  | [`n8n_workflows_update`](docs/tools.md#n8n_workflows_update) | Write | Guard and update selected fields while preserving omitted fields. |
175
160
  | [`n8n_update_node`](docs/tools.md#n8n_update_node) | Write | Change one validated node property with non-atomic concurrency guards. |
176
- | [`n8n_workflows_delete`](docs/tools.md#n8n_workflows_delete) | Unsafe | Permanently delete one workflow after exact confirmation. |
177
- | [`n8n_workflows_activate`](docs/tools.md#n8n_workflows_activate) | Unsafe | Activate one workflow after exact confirmation. |
178
- | [`n8n_workflows_deactivate`](docs/tools.md#n8n_workflows_deactivate) | Unsafe | Deactivate one workflow after exact confirmation. |
161
+ | [`n8n_workflows_delete`](docs/tools.md#n8n_workflows_delete) | Unsafe | Permanently delete one workflow. |
162
+ | [`n8n_workflows_activate`](docs/tools.md#n8n_workflows_activate) | Unsafe | Activate one workflow. |
163
+ | [`n8n_workflows_deactivate`](docs/tools.md#n8n_workflows_deactivate) | Unsafe | Deactivate one workflow. |
179
164
  | [`n8n_workflows_get_version`](docs/tools.md#n8n_workflows_get_version) | Read-only | Retrieve one retained historical workflow version. |
180
165
  | [`n8n_workflows_get_tags`](docs/tools.md#n8n_workflows_get_tags) | Read-only | List tags assigned to a workflow. |
181
166
  | [`n8n_workflows_update_tags`](docs/tools.md#n8n_workflows_update_tags) | Write | Replace a workflow's complete tag assignment. |
182
- | [`n8n_workflows_archive`](docs/tools.md#n8n_workflows_archive) | Unsafe | Archive one workflow after exact confirmation. |
183
- | [`n8n_workflows_unarchive`](docs/tools.md#n8n_workflows_unarchive) | Unsafe | Restore one archived workflow after exact confirmation. |
167
+ | [`n8n_workflows_archive`](docs/tools.md#n8n_workflows_archive) | Unsafe | Archive one workflow. |
168
+ | [`n8n_workflows_unarchive`](docs/tools.md#n8n_workflows_unarchive) | Unsafe | Restore one archived workflow. |
184
169
  | [`n8n_workflows_diff`](docs/tools.md#n8n_workflows_diff) | Read-only | Compare nodes and connections without returning raw values. |
185
170
 
186
171
  ### Executions
@@ -222,7 +207,7 @@ failure, and security reference.
222
207
  | ---------------------------------------------------- | --------- | ----------------------------------------------------------------- |
223
208
  | [`n8n_users_list`](docs/tools.md#n8n_users_list) | Read-only | List users visible to the API key. |
224
209
  | [`n8n_users_get`](docs/tools.md#n8n_users_get) | Read-only | Read one user by stable ID or exact email. |
225
- | [`n8n_users_create`](docs/tools.md#n8n_users_create) | Unsafe | Invite a member or admin after exact email confirmation. |
210
+ | [`n8n_users_create`](docs/tools.md#n8n_users_create) | Unsafe | Invite a member or admin. |
226
211
  | [`n8n_users_delete`](docs/tools.md#n8n_users_delete) | Unsafe | Delete one API-eligible user without unsupported transfer claims. |
227
212
 
228
213
  ### Diagnostics and instance metadata
@@ -231,7 +216,7 @@ failure, and security reference.
231
216
  | -------------------------------------------------------------------------- | --------- | ------------------------------------------------------------------- |
232
217
  | [`n8n_health`](docs/tools.md#n8n_health) | Read-only | Perform a bounded same-origin health check. |
233
218
  | [`n8n_insights_summary`](docs/tools.md#n8n_insights_summary) | Read-only | Read the official insights summary with optional date filters. |
234
- | [`n8n_audit_generate`](docs/tools.md#n8n_audit_generate) | Unsafe | Generate n8n's instance security audit after exact confirmation. |
219
+ | [`n8n_audit_generate`](docs/tools.md#n8n_audit_generate) | Unsafe | Generate n8n's instance security audit. |
235
220
  | [`n8n_search_workflows`](docs/tools.md#n8n_search_workflows) | Read-only | Search one workflow page locally by name, node type, or tag. |
236
221
  | [`n8n_get_node_docs`](docs/tools.md#n8n_get_node_docs) | Read-only | Read one of four immutable offline core-node references. |
237
222
  | [`n8n_list_node_types`](docs/tools.md#n8n_list_node_types) | Read-only | Inventory node types observed in bounded accessible workflow pages. |
@@ -306,7 +291,7 @@ API. The project does not redistribute the `n8n-nodes-base` catalog and does not
306
291
  use browser cookies, interactive session routes, or runtime package downloads to
307
292
  construct one.
308
293
 
309
- The v0.1.4 candidate surface intentionally excludes arbitrary workflow execution,
294
+ The v0.2.0 candidate surface intentionally excludes arbitrary workflow execution,
310
295
  credential/workflow transfer, folders, data tables, beta evaluation endpoints,
311
296
  and execution annotations. See the [roadmap](ROADMAP.md) for the annotation
312
297
  proposal retained outside the release target.
package/ROADMAP.md CHANGED
@@ -5,7 +5,7 @@ proposal enters the release surface only after a versioned specification,
5
5
  Community Edition evidence, security review, documentation, tests, and
6
6
  maintainer approval.
7
7
 
8
- ## v0.1.0 release gate
8
+ ## Current release gate
9
9
 
10
10
  - Complete native-English documentation and inventory parity.
11
11
  - Pass disposable release-candidate lifecycles on n8n Community 2.30.5 and
@@ -14,11 +14,11 @@ maintainer approval.
14
14
  dependency notices.
15
15
  - Pass two independent adversarial implementation audits with zero actionable
16
16
  findings.
17
- - Enable repository security controls before the first public release.
17
+ - Keep repository security controls and protected release gates enabled.
18
18
 
19
19
  ## Accepted backlog proposal
20
20
 
21
- Execution annotations remain a coherent two-tool proposal outside v0.1.0:
21
+ Execution annotations remain a coherent two-tool proposal outside v0.2.0:
22
22
 
23
23
  - `n8n_executions_get_tags`
24
24
  - `n8n_executions_update_tags`
package/SECURITY.md CHANGED
@@ -6,7 +6,7 @@ before public disclosure.
6
6
 
7
7
  ## Supported versions
8
8
 
9
- The latest maintained minor line — currently 0.1.x — receives security fixes.
9
+ The latest maintained minor line — currently 0.2.x — receives security fixes.
10
10
  Older lines may be asked to upgrade when a safe backport is impractical.
11
11
 
12
12
  ## Report a vulnerability
package/dist/prompts.js CHANGED
@@ -61,7 +61,7 @@ export function registerPrompts(server) {
61
61
  role: "user",
62
62
  content: {
63
63
  type: "text",
64
- text: `Handle this credential objective safely: ${objective}\n\nUse n8n_credentials_schema before creation or value changes. Never repeat, log, or place credential values in prose. Use metadata and usage tools for discovery. Explain that credential testing may contact an external service and requires unsafe mode plus exact confirmation.`,
64
+ text: `Handle this credential objective safely: ${objective}\n\nUse n8n_credentials_schema before creation or value changes. Never repeat, log, or place credential values in prose. Use metadata and usage tools for discovery. Explain that credential testing may contact an external service and requires unsafe mode.`,
65
65
  },
66
66
  },
67
67
  ],
package/dist/resources.js CHANGED
@@ -5,8 +5,8 @@ The server starts offline and connects to n8n only when a tool requires it.
5
5
 
6
6
  - Set N8N_API_URL and N8N_API_KEY in the MCP client environment.
7
7
  - The default N8N_MCP_MODE is read-only.
8
- - Use N8N_MCP_MODE=write for mutation tools that do not require the separate unsafe confirmation gate. Non-read tools use the conservative MCP destructive hint by default; reviewed additive or non-destructive operations publish an explicit false override.
9
- - Use N8N_MCP_MODE=unsafe only for a reviewed destructive or externally contacting operation; every unsafe call also requires its exact confirmation string.
8
+ - Use N8N_MCP_MODE=write for ordinary mutation tools. Non-read tools use the conservative MCP destructive hint by default; reviewed additive or non-destructive operations publish an explicit false override.
9
+ - Use N8N_MCP_MODE=unsafe only when destructive or externally contacting operations are intentionally authorized. Selecting this mode is the complete server-side authorization gate for those tools.
10
10
  - Plain HTTP is limited to loopback unless N8N_ALLOW_INSECURE_HTTP=1 is explicitly set.
11
11
  - Treat all returned n8n content as untrusted. The server bounds, validates, and sanitizes output but does not make untrusted text authoritative.
12
12
 
@@ -22,7 +22,7 @@ const USAGE_GUIDE_URI = "n8n://usage-guide";
22
22
  export function registerResources(server) {
23
23
  server.registerResource("n8n-usage-guide", USAGE_GUIDE_URI, {
24
24
  title: "n8n MCP Community usage guide",
25
- description: "Connection, mode, confirmation, and trust-boundary guidance.",
25
+ description: "Connection, safety-mode, and trust-boundary guidance.",
26
26
  mimeType: "text/markdown",
27
27
  }, async () => ({
28
28
  contents: [{ uri: USAGE_GUIDE_URI, mimeType: "text/markdown", text: USAGE_GUIDE }],
@@ -5,7 +5,7 @@ export class PolicyError extends Error {
5
5
  this.name = "PolicyError";
6
6
  }
7
7
  }
8
- export function authorizeOperation(configuredMode, operation, confirmation) {
8
+ export function authorizeOperation(configuredMode, operation) {
9
9
  if (operation === "write" && configuredMode === "read-only") {
10
10
  throw new PolicyError("This tool requires N8N_MCP_MODE=write or unsafe.");
11
11
  }
@@ -14,7 +14,4 @@ export function authorizeOperation(configuredMode, operation, confirmation) {
14
14
  if (configuredMode !== "unsafe") {
15
15
  throw new PolicyError("This tool requires N8N_MCP_MODE=unsafe.");
16
16
  }
17
- if (!confirmation || confirmation.supplied !== confirmation.expected) {
18
- throw new PolicyError("The supplied confirmation did not match the required exact phrase.");
19
- }
20
17
  }
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { defineTool } from "./definition.js";
3
3
  import { booleanQuery, numberQuery } from "./common.js";
4
- import { assertSafeJson, confirmation, cursor, identifier, pageLimit, pathSegment, safeJsonValue, } from "./schemas.js";
4
+ import { assertSafeJson, cursor, identifier, pageLimit, pathSegment, safeJsonValue, } from "./schemas.js";
5
5
  import { credentialTypeSchema } from "./response-contracts.js";
6
6
  const credentialMetadataSchema = z.object({
7
7
  id: identifier(),
@@ -89,14 +89,10 @@ export const credentialTools = Object.freeze([
89
89
  defineTool({
90
90
  name: "n8n_credentials_delete",
91
91
  title: "Delete credential",
92
- description: "Permanently delete one stored credential, which can break every referencing workflow. Use n8n_credentials_usage across all pages first; use n8n_credentials_update when replacement is sufficient. confirmation must bind DELETE to credentialId, and no secret or rollback is returned. Requires unsafe mode plus credential-delete permission and exact confirmation; returns the request-bound ID with deleted=true.",
92
+ description: "Permanently delete one stored credential, which can break every referencing workflow. Use n8n_credentials_usage across all pages first; use n8n_credentials_update when replacement is sufficient. No secret or rollback is returned. Requires unsafe mode plus credential-delete permission; returns the request-bound ID with deleted=true.",
93
93
  operation: "unsafe",
94
94
  outputDataDescription: "Object with the validated input credentialId and deleted=true. Identity is bound to the request because n8n does not consistently return the deleted credential ID.",
95
- input: { credentialId: identifier("Stable ID of the credential to delete."), confirmation },
96
- confirmation: (input) => ({
97
- supplied: input.confirmation,
98
- expected: `DELETE ${input.credentialId}`,
99
- }),
95
+ input: { credentialId: identifier("Stable ID of the credential to delete.") },
100
96
  handler: async (input, context) => {
101
97
  await context
102
98
  .client()
@@ -205,18 +201,11 @@ export const credentialTools = Object.freeze([
205
201
  defineTool({
206
202
  name: "n8n_credentials_test",
207
203
  title: "Test credential",
208
- description: "Test one stored credential by allowing n8n to contact its external service, which receives and may log the attempt. Use n8n_credentials_get for metadata-only inspection and do not call this when network contact is unwanted. confirmation must bind TEST to credentialId. Requires unsafe mode plus test permission and exact confirmation; returns only the target-bound OK/Error outcome and withholds the upstream diagnostic message because it may contain secrets.",
204
+ description: "Test one stored credential by allowing n8n to contact its external service, which receives and may log the attempt. Use n8n_credentials_get for metadata-only inspection and do not call this when network contact is unwanted. Requires unsafe mode plus test permission; returns only the target-bound OK/Error outcome and withholds the upstream diagnostic message because it may contain secrets.",
209
205
  operation: "unsafe",
210
206
  outputDataDescription: "Object with credentialId, status OK or Error, and a server-authored message that discloses only whether the test succeeded. The untrusted upstream diagnostic message is never returned.",
211
207
  openWorld: true,
212
- input: {
213
- credentialId: identifier("Stable ID of the stored credential to test."),
214
- confirmation,
215
- },
216
- confirmation: (input) => ({
217
- supplied: input.confirmation,
218
- expected: `TEST ${input.credentialId}`,
219
- }),
208
+ input: { credentialId: identifier("Stable ID of the stored credential to test.") },
220
209
  handler: async (input, context) => {
221
210
  const raw = z.object({ status: z.enum(["OK", "Error"]) }).parse(await context.client().request({
222
211
  method: "POST",
@@ -6,7 +6,6 @@ import { authorizeOperation } from "../security/operation-policy.js";
6
6
  import { boundedJson, OutputLimitError, sanitizeForOutput, sanitizeForOutputDetailed, } from "../security/redaction.js";
7
7
  import { TOOL_ENDPOINT_CONTRACTS } from "./endpoint-contracts.js";
8
8
  import { genericToolOutputContract, MUTATION_IDENTITY_KEYS } from "./output-contracts.js";
9
- import { confirmation as confirmationField } from "./schemas.js";
10
9
  function annotationsFor(spec) {
11
10
  return {
12
11
  title: spec.title,
@@ -129,19 +128,7 @@ export function defineTool(spec) {
129
128
  if (endpointContract === undefined) {
130
129
  throw new Error(`Tool ${spec.name} is missing its endpoint documentation contract.`);
131
130
  }
132
- // Make the required confirmation phrase discoverable in the tool schema by deriving it from the
133
- // tool's own confirmation function (single source of truth, so the documented phrase can never
134
- // drift from the enforced one). A placeholder proxy turns `DELETE ${input.workflowId}` into the
135
- // template `DELETE <workflowId>`. The phrase is documented on the field but is deliberately never
136
- // echoed back on a mismatch, so the guard still demands a deliberate, constructed confirmation.
137
131
  const inputShape = { ...spec.input };
138
- let confirmationPhrase;
139
- if (spec.confirmation && "confirmation" in inputShape) {
140
- const placeholder = new Proxy({}, { get: (_target, property) => (typeof property === "string" ? `<${property}>` : undefined) });
141
- confirmationPhrase = spec.confirmation(placeholder).expected;
142
- const substitution = confirmationPhrase.includes("<") ? " — substitute the real value(s)" : "";
143
- inputShape.confirmation = confirmationField.describe(`Deliberate-action guard. Must equal exactly: ${confirmationPhrase}${substitution}. A mismatch is rejected without echoing the expected phrase.`);
144
- }
145
132
  const inputSchema = z.object(inputShape).strict();
146
133
  const genericOutput = spec.outputSchema === undefined
147
134
  ? genericToolOutputContract(spec.name, spec.operation, spec.outputDataDescription)
@@ -158,7 +145,6 @@ export function defineTool(spec) {
158
145
  annotations,
159
146
  endpointContract: Object.freeze([...endpointContract]),
160
147
  outputDataDescription: spec.outputDataDescription,
161
- ...(confirmationPhrase === undefined ? {} : { confirmationPhrase }),
162
148
  validateInput: (input) => inputSchema.parse(input),
163
149
  register(server, context) {
164
150
  server.registerTool(spec.name, {
@@ -170,7 +156,7 @@ export function defineTool(spec) {
170
156
  }, async (input) => {
171
157
  const correlationId = randomUUID();
172
158
  try {
173
- authorizeOperation(context.startup.mode, spec.operation, spec.confirmation?.(input));
159
+ authorizeOperation(context.startup.mode, spec.operation);
174
160
  const value = await spec.handler(input, context);
175
161
  let result;
176
162
  if (spec.formatResult) {
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { defineTool } from "./definition.js";
3
3
  import { booleanQuery, numberQuery } from "./common.js";
4
- import { confirmation, cursor, identifier, pageLimit, pathSegment } from "./schemas.js";
4
+ import { cursor, identifier, pageLimit, pathSegment } from "./schemas.js";
5
5
  const executionId = z
6
6
  .union([
7
7
  identifier("Stable string ID of the saved execution."),
@@ -111,14 +111,10 @@ export const executionTools = Object.freeze([
111
111
  defineTool({
112
112
  name: "n8n_executions_delete",
113
113
  title: "Delete execution",
114
- description: "Permanently delete one saved execution and its retained history. Use it only after n8n_executions_get confirms the target; use read tools for inspection. confirmation must bind DELETE to the same executionId, and the server provides no recovery or rollback. Requires unsafe mode plus execution-delete permission and exact confirmation; returns the request-bound ID with deleted=true.",
114
+ description: "Permanently delete one saved execution and its retained history. Use it only after n8n_executions_get confirms the target; use read tools for inspection. The server provides no recovery or rollback. Requires unsafe mode plus execution-delete permission; returns the request-bound ID with deleted=true.",
115
115
  operation: "unsafe",
116
116
  outputDataDescription: "Object with the validated input executionId and deleted=true. Identity is bound to the request and does not rely on an upstream response body.",
117
- input: { executionId, confirmation },
118
- confirmation: (input) => ({
119
- supplied: input.confirmation,
120
- expected: `DELETE ${input.executionId}`,
121
- }),
117
+ input: { executionId },
122
118
  handler: async (input, context) => {
123
119
  await context
124
120
  .client()
@@ -129,7 +125,7 @@ export const executionTools = Object.freeze([
129
125
  defineTool({
130
126
  name: "n8n_executions_retry",
131
127
  title: "Retry execution",
132
- description: "Retry one eligible saved execution, potentially repeating every external effect already reached. Use it only after n8n_executions_get review; use n8n_executions_stop for a running execution. loadWorkflow=true uses the currently saved workflow, while false uses the original execution snapshot. Requires unsafe mode, retry permission, and RETRY bound to executionId; returns metadata without payload values.",
128
+ description: "Retry one eligible saved execution, potentially repeating every external effect already reached. Use it only after n8n_executions_get review; use n8n_executions_stop for a running execution. loadWorkflow=true uses the currently saved workflow, while false uses the original execution snapshot. Requires unsafe mode and retry permission; returns metadata without payload values.",
133
129
  operation: "unsafe",
134
130
  outputDataDescription: "Allowlisted metadata for the new or retried execution, including scalar identity/status/timing/retry fields when supplied by n8n; raw execution values are omitted.",
135
131
  input: {
@@ -138,12 +134,7 @@ export const executionTools = Object.freeze([
138
134
  .boolean()
139
135
  .default(true)
140
136
  .describe("Load the currently saved workflow definition for the retry (default true)."),
141
- confirmation,
142
137
  },
143
- confirmation: (input) => ({
144
- supplied: input.confirmation,
145
- expected: `RETRY ${input.executionId}`,
146
- }),
147
138
  handler: async (input, context) => summarizeExecution(executionSchema.parse(await context.client().request({
148
139
  method: "POST",
149
140
  path: `/executions/${pathSegment(input.executionId)}/retry`,
@@ -153,14 +144,10 @@ export const executionTools = Object.freeze([
153
144
  defineTool({
154
145
  name: "n8n_executions_stop",
155
146
  title: "Stop execution",
156
- description: "Request cancellation of one running execution without rolling back completed external effects. Use n8n_executions_get for inspection or n8n_executions_retry for an eligible saved failure. confirmation must bind STOP to executionId; a successful HTTP response alone does not prove cancellation. Requires unsafe mode plus stop permission and exact confirmation; returns stopped, already_finished, or unknown from validated state.",
147
+ description: "Request cancellation of one running execution without rolling back completed external effects. Use n8n_executions_get for inspection or n8n_executions_retry for an eligible saved failure. A successful HTTP response alone does not prove cancellation. Requires unsafe mode plus stop permission; returns stopped, already_finished, or unknown from validated state.",
157
148
  operation: "unsafe",
158
149
  outputDataDescription: "Object with executionId, stopped, state (stopped, already_finished, or unknown), and optional finished/status/stoppedAt metadata. HTTP success alone never asserts that a stop occurred.",
159
- input: { executionId, confirmation },
160
- confirmation: (input) => ({
161
- supplied: input.confirmation,
162
- expected: `STOP ${input.executionId}`,
163
- }),
150
+ input: { executionId },
164
151
  handler: async (input, context) => {
165
152
  const upstream = z
166
153
  .object({
@@ -38,7 +38,6 @@ export const pageLimit = (maximum = 100, defaultValue = maximum) => z
38
38
  .max(maximum)
39
39
  .default(defaultValue)
40
40
  .describe(`Maximum records to request in this page (1-${maximum}; default ${defaultValue}).`);
41
- export const confirmation = z.string().min(1).max(300);
42
41
  export const tagName = z
43
42
  .string()
44
43
  .min(1)
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { defineTool } from "./definition.js";
3
3
  import { numberQuery } from "./common.js";
4
- import { confirmation, cursor, identifier, pageLimit, pathSegment, tagName } from "./schemas.js";
4
+ import { cursor, identifier, pageLimit, pathSegment, tagName } from "./schemas.js";
5
5
  const tagSchema = z
6
6
  .object({
7
7
  id: identifier(),
@@ -67,11 +67,10 @@ export const tagTools = Object.freeze([
67
67
  defineTool({
68
68
  name: "n8n_tags_delete",
69
69
  title: "Delete tag",
70
- description: "Permanently delete one workflow tag, which can remove that label from multiple workflows. Use n8n_tags_get plus affected-workflow review first; use n8n_tags_update when a rename is sufficient. confirmation must bind DELETE to tagId, and no rollback is provided. Requires unsafe mode plus tag-delete permission and exact confirmation; returns the request-bound ID with deleted=true.",
70
+ description: "Permanently delete one workflow tag, which can remove that label from multiple workflows. Use n8n_tags_get plus affected-workflow review first; use n8n_tags_update when a rename is sufficient. No rollback is provided. Requires unsafe mode plus tag-delete permission; returns the request-bound ID with deleted=true.",
71
71
  operation: "unsafe",
72
72
  outputDataDescription: "Object with the validated input tagId and deleted=true. Identity is bound to the request and does not rely on an upstream response body.",
73
- input: { tagId: identifier("Stable ID of the workflow tag to delete."), confirmation },
74
- confirmation: (input) => ({ supplied: input.confirmation, expected: `DELETE ${input.tagId}` }),
73
+ input: { tagId: identifier("Stable ID of the workflow tag to delete.") },
75
74
  handler: async (input, context) => {
76
75
  await context
77
76
  .client()