@path58/p58-n8n 0.2.9 → 0.2.11

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/AGENT_INSTALL.md CHANGED
@@ -99,6 +99,38 @@ The API key cannot be auto-discovered. The user must provide it or create one.
99
99
 
100
100
  ---
101
101
 
102
+ ## Step 3b: Get n8n Login Credentials (Optional — for credential testing)
103
+
104
+ Some tools (`test_credential`, credential health checks) need REST session auth to access credential secrets. This requires the user's n8n login email and password.
105
+
106
+ **When to ask:** If the user wants credential management features (testing, health audits), ask:
107
+ > "To enable credential testing, I'll also need your n8n login email and password. These are the same credentials you use to log into the n8n web UI. Want to add them now?"
108
+
109
+ **If the user declines:** Tier 2-7 tools still work — only `test_credential` will prompt for credentials per-call.
110
+
111
+ **Security notes:**
112
+ - These credentials are stored in the MCP config file alongside the API key (same security model)
113
+ - The MCP server never logs credentials — they are only used to obtain a session cookie from n8n
114
+ - The session cookie is ephemeral and not persisted to disk
115
+ - If the user is uncomfortable storing their password in the config, they can omit it and provide credentials per-call when using `test_credential`
116
+
117
+ **Advanced: Use a credential manager instead of plaintext:**
118
+
119
+ If the user has 1Password CLI installed, they can reference secrets dynamically:
120
+ ```json
121
+ {
122
+ "mcpServers": {
123
+ "p58-n8n": {
124
+ "command": "sh",
125
+ "args": ["-c", "N8N_API_KEY=$(op read 'op://Vault/n8n/api-key') N8N_USER_EMAIL=$(op read 'op://Vault/n8n/email') N8N_USER_PASSWORD=$(op read 'op://Vault/n8n/password') N8N_API_URL=http://localhost:5678/api/v1 npx -y @path58/p58-n8n"]
126
+ }
127
+ }
128
+ }
129
+ ```
130
+ This way no secrets are stored in the config file — they're fetched from 1Password at startup with biometric approval.
131
+
132
+ ---
133
+
102
134
  ## Step 4: Write the Configuration
103
135
 
104
136
  ### For Claude Desktop / Cursor / Gemini CLI / VS Code (JSON config)
@@ -114,7 +146,9 @@ Read the existing config file, then add p58-n8n inside the `mcpServers` object.
114
146
  "args": ["-y", "@path58/p58-n8n"],
115
147
  "env": {
116
148
  "N8N_API_URL": "http://localhost:5678/api/v1",
117
- "N8N_API_KEY": "<paste-api-key-here>"
149
+ "N8N_API_KEY": "<paste-api-key-here>",
150
+ "N8N_USER_EMAIL": "<n8n-login-email>",
151
+ "N8N_USER_PASSWORD": "<n8n-login-password>"
118
152
  }
119
153
  }
120
154
  }
@@ -140,6 +174,8 @@ Read the existing config file, then add p58-n8n inside the `mcpServers` object.
140
174
  claude mcp add p58-n8n \
141
175
  -e N8N_API_URL=http://localhost:5678/api/v1 \
142
176
  -e N8N_API_KEY=<paste-api-key-here> \
177
+ -e N8N_USER_EMAIL=<n8n-login-email> \
178
+ -e N8N_USER_PASSWORD=<n8n-login-password> \
143
179
  -- npx -y @path58/p58-n8n
144
180
  ```
145
181
 
@@ -193,6 +229,8 @@ Ask: "List my n8n credentials"
193
229
  |----------|-----------|-------------|-------------|
194
230
  | `N8N_API_URL` | For Tier 2-7 tools | n8n instance API URL | See Step 2 above |
195
231
  | `N8N_API_KEY` | For Tier 2-7 tools | n8n API authentication key | n8n → Settings → API Keys |
232
+ | `N8N_USER_EMAIL` | For `test_credential` | n8n login email (REST session auth) | Same email you use to log into n8n UI |
233
+ | `N8N_USER_PASSWORD` | For `test_credential` | n8n login password (REST session auth) | Same password you use to log into n8n UI |
196
234
 
197
235
  > **Note:** `N8N_API_BASE_URL` is accepted as a fallback for `N8N_API_URL`. If neither is set, defaults to `http://localhost:5678/api/v1`.
198
236
 
@@ -215,6 +253,7 @@ Ask: "List my n8n credentials"
215
253
  | "npx: command not found" | Node.js not installed | Install from https://nodejs.org/ |
216
254
  | "Authentication failed" on deploy tools | N8N_API_KEY missing or invalid | Add API key to config, restart client |
217
255
  | "Connection refused" on server_health | n8n not running at configured URL | Start n8n or fix N8N_API_URL |
256
+ | `test_credential` returns `NEEDS_N8N_LOGIN` | Session auth vars not set | Add `N8N_USER_EMAIL` and `N8N_USER_PASSWORD` to config (Step 3b) |
218
257
  | All tools timeout | Firewall blocking localhost | Check firewall / VPN settings |
219
258
  | Server shows "failed" status | ANSI color issue (pre-v0.2.2) | Update to latest version: `npx -y @path58/p58-n8n@latest` |
220
259
 
package/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.11] - 2026-03-11
9
+
10
+ ### Added
11
+
12
+ - **Session auth env vars** — `N8N_USER_EMAIL` and `N8N_USER_PASSWORD` now defined in env schema with Zod validation. When set in MCP config, `test_credential` works without per-call password prompts.
13
+ - **Security documentation** — README now includes a full Security section documenting credential security model, auth layers, and user responsibilities.
14
+ - **Credential helper example** — AGENT_INSTALL.md includes a 1Password CLI config pattern for users who prefer not to store passwords in plaintext config files.
15
+ - **Step 3b in install guide** — AGENT_INSTALL.md now documents session auth setup as an optional step during installation.
16
+
17
+ ## [0.2.10] - 2026-03-11
18
+
19
+ ### Fixed
20
+
21
+ - **Webhook URL construction bug** — `extractWebhookPath` incorrectly prefixed `{workflowId}/{encodedNodeName}/` to the webhook path, producing URLs like `/webhook/4aDOC5YlrPOTUTgm/webhook/langchain-test-029` instead of `/webhook/langchain-test-029`. This caused 404 errors on every webhook-triggered `test_workflow` and `execute_workflow` call. n8n production webhooks listen at `/webhook/{path}` with no prefix.
22
+
8
23
  ## [0.2.9] - 2026-03-11
9
24
 
10
25
  ### Fixed
package/README.md CHANGED
@@ -280,6 +280,49 @@ p58-n8n is in **soft launch** (friends & family). Issues and feedback welcome:
280
280
 
281
281
  ---
282
282
 
283
+ ## Security
284
+
285
+ p58-n8n handles your n8n API keys, credentials, and server access. We take that responsibility seriously — here's exactly how your data is protected.
286
+
287
+ ### Your Data Stays on Your Machine
288
+
289
+ p58-n8n runs as a **local stdio process**. There is no cloud relay, no telemetry, no external servers. Your credentials, workflow data, and n8n API traffic never leave your machine. The MCP protocol communicates exclusively via stdin/stdout with your local AI client.
290
+
291
+ ### Credential Security
292
+
293
+ | Protection | How It Works |
294
+ |-----------|-------------|
295
+ | **No credential logging** | Passwords, API keys, and session tokens are never written to logs at any level — verified by automated grep checks |
296
+ | **Ephemeral sessions** | n8n session cookies are created per-operation, held in memory only, and never persisted to disk |
297
+ | **No secrets in responses** | MCP tool responses never include credential values — only metadata (name, type, health status) |
298
+ | **Schema-validated config** | All environment variables are validated with Zod at startup — malformed values are rejected immediately |
299
+ | **Fail-closed design** | Missing credentials produce clear error messages — the server never falls back to insecure defaults or guesses |
300
+ | **Per-call override** | Users who prefer not to store passwords in config files can provide credentials per-tool-call instead |
301
+
302
+ ### Authentication Layers
303
+
304
+ p58-n8n uses two independent auth mechanisms to talk to your n8n instance:
305
+
306
+ | Layer | Variables | What It Accesses | When Needed |
307
+ |-------|----------|-----------------|-------------|
308
+ | **API Key** | `N8N_API_KEY` | Workflow CRUD, activation, execution | All Tier 2-7 tools |
309
+ | **Session Auth** | `N8N_USER_EMAIL`, `N8N_USER_PASSWORD` | Credential secrets, credential testing | `test_credential` only |
310
+
311
+ Session auth is **optional**. Without it, all tools work except `test_credential`, which will prompt for credentials per-call.
312
+
313
+ ### Your Responsibility
314
+
315
+ While p58-n8n implements security best practices, **you are responsible for:**
316
+ - Securing access to your n8n instance and API keys
317
+ - Protecting your MCP config files (we recommend `chmod 600`)
318
+ - Rotating API keys and passwords periodically
319
+ - Using a credential manager (1Password, macOS Keychain) for production environments instead of plaintext config files
320
+ - Reviewing what workflows the AI builds before deploying to production
321
+
322
+ **We recommend:** Use a credential helper to inject secrets into your MCP config rather than storing them in plaintext. See [AGENT_INSTALL.md](https://github.com/tsvika58/p58-n8n/blob/main/AGENT_INSTALL.md) for setup options.
323
+
324
+ ---
325
+
283
326
  ## Architecture
284
327
 
285
328
  p58-n8n runs as a local stdio MCP server. No cloud services required for basic use.
@@ -18473,7 +18473,7 @@ var import_types22 = require("@modelcontextprotocol/sdk/types.js");
18473
18473
  var config = {
18474
18474
  // Server identity
18475
18475
  SERVER_NAME: "p58-n8n",
18476
- SERVER_VERSION: "0.2.9",
18476
+ SERVER_VERSION: "0.2.11",
18477
18477
  // Database configuration (from environment)
18478
18478
  SUPABASE_URL: process.env.SUPABASE_URL,
18479
18479
  SUPABASE_KEY: process.env.SUPABASE_KEY,
@@ -37464,16 +37464,7 @@ function extractWebhookPath(workflow) {
37464
37464
  if (!trigger)
37465
37465
  return null;
37466
37466
  const params = trigger.parameters ?? {};
37467
- const shortPath = typeof params.path === "string" && params.path.length > 0 && params.path || typeof params.webhookId === "string" && params.webhookId.length > 0 && params.webhookId || typeof trigger.webhookId === "string" && trigger.webhookId.length > 0 && trigger.webhookId || null;
37468
- if (!shortPath)
37469
- return null;
37470
- const wfId = workflow.id;
37471
- const nodeName = trigger.name ?? "Webhook";
37472
- if (wfId) {
37473
- const encodedNodeName = encodeURIComponent(String(nodeName).toLowerCase());
37474
- return `${wfId}/${encodedNodeName}/${shortPath}`;
37475
- }
37476
- return shortPath;
37467
+ return typeof params.path === "string" && params.path.length > 0 && params.path || typeof params.webhookId === "string" && params.webhookId.length > 0 && params.webhookId || typeof trigger.webhookId === "string" && trigger.webhookId.length > 0 && trigger.webhookId || null;
37477
37468
  }
37478
37469
  function buildN8nHostUrl() {
37479
37470
  const apiBase = process.env.N8N_API_BASE_URL ?? process.env.N8N_API_URL ?? "http://localhost:5678/api/v1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@path58/p58-n8n",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "The smartest and fastest n8n MCP server — validate, fix, and discover workflows inside your LLM",
5
5
  "keywords": [
6
6
  "mcp",