Compare commits

...

9 Commits

Author SHA1 Message Date
Romuald Członkowski
77c92716a3 Merge pull request #686 from czlonkowski/feat/generate-workflow-tool
feat: add n8n_generate_workflow tool
2026-03-31 12:45:11 +02:00
czlonkowski
198e773bb3 feat: add n8n_generate_workflow tool for hosted workflow generation
Add new MCP tool that enables AI-powered workflow generation from natural
language descriptions. Uses handler delegation pattern — hosting environments
inject a GenerateWorkflowHandler via EngineOptions, self-hosted instances
receive a hosted-only informational response.

Handler flows through N8NMCPEngine → SingleSessionHTTPServer →
N8NDocumentationMCPServer with helpers for createWorkflow, validateWorkflow,
autofixWorkflow, and getWorkflow.

Includes full tool documentation, tests, and corrected tools overview count.

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 12:32:31 +02:00
Romuald Członkowski
3417c6701c Merge pull request #685 from czlonkowski/fix/patterns-docs-and-token-trim-683
fix: trim patterns response tokens and complete documentation (v2.42.3)
2026-03-31 08:11:50 +02:00
czlonkowski
5b68d7fa53 fix: trim patterns response tokens and add missing documentation (#683)
- Trim task-specific patterns ~64%: drop displayName, shorten field names
  (frequency→freq), cap chains at 5, use short node type names in chains
- Add patterns mode to tools_documentation essentials, full docs, and
  tools-documentation.ts overview (was completely missing)
- Document includeOperations omission behavior for trigger/freeform nodes
- Add patterns return shape to search_templates returns documentation
- Trim search_nodes examples from 11 to 6

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 00:03:35 +02:00
Romuald Członkowski
54e445bc6a Merge pull request #682 from czlonkowski/fix/include-patterns-in-npm-681
fix: include workflow-patterns.json in npm package (#681)
2026-03-30 22:27:13 +02:00
czlonkowski
49638b98cf fix: include workflow-patterns.json in npm package (#681)
Added data/workflow-patterns.json to the files array in package.json so
the patterns file ships with the npm package. Without this, the
search_templates patterns mode returns an error asking users to manually
run the mine script.

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 21:59:52 +02:00
Romuald Członkowski
fa766eff3c Merge pull request #680 from czlonkowski/fix/community-node-resource-grouping 2026-03-30 20:56:48 +02:00
czlonkowski
b890bd9601 fix: restore community nodes with resource-grouped operations (v2.42.1)
- Restore 584 community nodes from n8n 2.13.3 DB snapshot
- Re-extract operations from properties_schema with resource grouping
  (366 community nodes now have named resources, up from 10)
- Fix community-node-service.ts extractOperations() to extract resource
  from displayOptions.show.resource
- Bump version to 2.42.1

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 18:18:19 +02:00
czlonkowski
7f7150b2f3 fix: add resource grouping to community node operations and restore 584 community nodes
Community nodes copied from a pre-fix DB had flat operations without resource
grouping. Fixed by:

1. Updating community-node-service.ts extractOperations() to extract resource
   from displayOptions.show.resource (same fix as property-extractor.ts)
2. Re-extracting operations from properties_schema for all 1,396 nodes
3. Restoring 584 community nodes from the n8n 2.13.3 DB snapshot
4. Rebuilding FTS5 index

Result: 366 community nodes now have resource-grouped operations (up from 10).
64 community nodes remain flat (they have no resource/operation pattern).

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 17:46:22 +02:00
85 changed files with 867 additions and 208 deletions

View File

@@ -7,6 +7,54 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [2.43.0] - 2026-03-31
### Added
- **`n8n_generate_workflow` tool**: New MCP tool that enables AI-powered workflow generation from natural language descriptions. Available on the hosted service with handler delegation pattern for extensibility.
- **Handler injection API**: `EngineOptions.generateWorkflowHandler` allows hosting environments to provide custom workflow generation backends. Handler receives helpers for `createWorkflow`, `validateWorkflow`, `autofixWorkflow`, and `getWorkflow`.
- **Tool documentation**: Full essentials and deep documentation for `n8n_generate_workflow` via `tools_documentation`.
### Fixed
- **Tools documentation count**: Corrected n8n API tools count and added missing `n8n_manage_datatable` entry to tools overview.
Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
## [2.42.3] - 2026-03-30
### Improved
- **Patterns response trimmed for token efficiency** (Issue #683): Task-specific patterns response reduced ~64% — dropped redundant `displayName`, shortened field names (`frequency``freq`), capped chains at 5, and shortened chain node types to last segment.
- **`patterns` mode added to `tools_documentation`**: Was missing from both essentials and full docs. AI agents can now discover patterns mode through the standard documentation flow.
- **`includeOperations` omission behavior documented**: Added note that trigger nodes and freeform nodes (Code, HTTP Request) omit the `operationsTree` field.
- **`search_nodes` examples trimmed**: Reduced from 11 to 6 examples in full docs, removing near-duplicates.
Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
## [2.42.2] - 2026-03-30
### Fixed
- **`workflow-patterns.json` missing from npm package** (Issue #681): Added `data/workflow-patterns.json` to the `files` array in `package.json` so the patterns file is included in the published npm package and works out of the box without manual generation.
Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
## [2.42.1] - 2026-03-30
### Fixed
- **Community nodes missing from database after rebuild**: Restored 584 community nodes from the n8n 2.13.3 snapshot and re-extracted operations with resource grouping from `properties_schema`. 366 community nodes now have proper resource-grouped operations.
- **Community node service missing resource extraction**: `extractOperations()` in `community-node-service.ts` was not extracting `resource` from `displayOptions.show.resource`, same issue that was fixed in `property-extractor.ts` in v2.42.0.
Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en
## [2.42.0] - 2026-03-30
### Added

Binary file not shown.

View File

@@ -2,6 +2,10 @@
import express from 'express';
import { InstanceContext } from './types/instance-context';
import { SessionState } from './types/session-state';
import { GenerateWorkflowHandler } from './types/generate-workflow';
export interface SingleSessionHTTPServerOptions {
generateWorkflowHandler?: GenerateWorkflowHandler;
}
export declare class SingleSessionHTTPServer {
private transports;
private servers;
@@ -14,7 +18,8 @@ export declare class SingleSessionHTTPServer {
private sessionTimeout;
private authToken;
private cleanupTimer;
constructor();
private generateWorkflowHandler?;
constructor(options?: SingleSessionHTTPServerOptions);
private startSessionCleanup;
private cleanupExpiredSessions;
private removeSession;

View File

@@ -1 +1 @@
{"version":3,"file":"http-server-single-session.d.ts","sourceRoot":"","sources":["../src/http-server-single-session.ts"],"names":[],"mappings":";AAMA,OAAO,OAAO,MAAM,SAAS,CAAC;AAoB9B,OAAO,EAAE,eAAe,EAA2B,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAwErD,qBAAa,uBAAuB;IAElC,OAAO,CAAC,UAAU,CAA8D;IAChF,OAAO,CAAC,OAAO,CAA0D;IACzE,OAAO,CAAC,eAAe,CAAsE;IAC7F,OAAO,CAAC,eAAe,CAA4D;IACnF,OAAO,CAAC,kBAAkB,CAAyC;IACnE,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,cAAc,CAAwB;IAC9C,OAAO,CAAC,aAAa,CAAM;IAI3B,OAAO,CAAC,cAAc,CAER;IACd,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,YAAY,CAA+B;;IAcnD,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,sBAAsB;YAqChB,aAAa;IAuC3B,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,qBAAqB;IAa7B,OAAO,CAAC,sBAAsB;IAkC9B,OAAO,CAAC,mBAAmB;YASb,oBAAoB;YAwBpB,oBAAoB;IAwBlC,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,aAAa;IA2BrB,OAAO,CAAC,mBAAmB;IAoDrB,aAAa,CACjB,GAAG,EAAE,OAAO,CAAC,OAAO,EACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,EACrB,eAAe,CAAC,EAAE,eAAe,GAChC,OAAO,CAAC,IAAI,CAAC;YAoRF,eAAe;IA4D7B,OAAO,CAAC,SAAS;IAYjB,OAAO,CAAC,gBAAgB;IASlB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAgnBtB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IA2D/B,cAAc,IAAI;QAChB,MAAM,EAAE,OAAO,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE;YACT,KAAK,EAAE,MAAM,CAAC;YACd,MAAM,EAAE,MAAM,CAAC;YACf,OAAO,EAAE,MAAM,CAAC;YAChB,GAAG,EAAE,MAAM,CAAC;YACZ,UAAU,EAAE,MAAM,EAAE,CAAC;SACtB,CAAC;KACH;IAmDM,kBAAkB,IAAI,YAAY,EAAE;IAoEpC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM;CAsG7D"}
{"version":3,"file":"http-server-single-session.d.ts","sourceRoot":"","sources":["../src/http-server-single-session.ts"],"names":[],"mappings":";AAMA,OAAO,OAAO,MAAM,SAAS,CAAC;AAoB9B,OAAO,EAAE,eAAe,EAA2B,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAwEpE,MAAM,WAAW,8BAA8B;IAC7C,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD;AAED,qBAAa,uBAAuB;IAElC,OAAO,CAAC,UAAU,CAA8D;IAChF,OAAO,CAAC,OAAO,CAA0D;IACzE,OAAO,CAAC,eAAe,CAAsE;IAC7F,OAAO,CAAC,eAAe,CAA4D;IACnF,OAAO,CAAC,kBAAkB,CAAyC;IACnE,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,cAAc,CAAwB;IAC9C,OAAO,CAAC,aAAa,CAAM;IAG3B,OAAO,CAAC,cAAc,CAER;IACd,OAAO,CAAC,SAAS,CAAuB;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logger.info(`[SECURITY] ${event}`, logEntry);
}
class SingleSessionHTTPServer {
constructor() {
constructor(options) {
this.transports = {};
this.servers = {};
this.sessionMetadata = {};
@@ -53,9 +53,10 @@ class SingleSessionHTTPServer {
this.contextSwitchLocks = new Map();
this.session = null;
this.consoleManager = new console_manager_1.ConsoleManager();
this.sessionTimeout = parseInt(process.env.SESSION_TIMEOUT_MINUTES || '5', 10) * 60 * 1000;
this.sessionTimeout = parseInt(process.env.SESSION_TIMEOUT_MINUTES || '30', 10) * 60 * 1000;
this.authToken = null;
this.cleanupTimer = null;
this.generateWorkflowHandler = options?.generateWorkflowHandler;
this.validateEnvironment();
this.startSessionCleanup();
}
@@ -340,7 +341,9 @@ class SingleSessionHTTPServer {
else {
sessionIdToUse = sessionId || (0, uuid_1.v4)();
}
const server = new server_1.N8NDocumentationMCPServer(instanceContext);
const server = new server_1.N8NDocumentationMCPServer(instanceContext, undefined, {
generateWorkflowHandler: this.generateWorkflowHandler,
});
transport = new streamableHttp_js_1.StreamableHTTPServerTransport({
sessionIdGenerator: () => sessionIdToUse,
onsessioninitialized: (initializedSessionId) => {
@@ -504,7 +507,9 @@ class SingleSessionHTTPServer {
}
try {
logger_1.logger.info('Creating new N8NDocumentationMCPServer for SSE...');
const server = new server_1.N8NDocumentationMCPServer();
const server = new server_1.N8NDocumentationMCPServer(undefined, undefined, {
generateWorkflowHandler: this.generateWorkflowHandler,
});
const sessionId = (0, uuid_1.v4)();
logger_1.logger.info('Creating SSEServerTransport...');
const transport = new sse_js_1.SSEServerTransport('/mcp', res);

File diff suppressed because one or more lines are too long

1
dist/index.d.ts vendored
View File

@@ -5,6 +5,7 @@ export { N8NDocumentationMCPServer } from './mcp/server';
export type { InstanceContext } from './types/instance-context';
export { validateInstanceContext, isInstanceContext } from './types/instance-context';
export type { SessionState } from './types/session-state';
export type { GenerateWorkflowArgs, GenerateWorkflowResult, GenerateWorkflowHandler, GenerateWorkflowHelpers } from './types/generate-workflow';
export type { UIAppConfig, UIMetadata } from './mcp/ui/types';
export { UI_APP_CONFIGS } from './mcp/ui/app-configs';
export type { Tool, CallToolResult, ListToolsResult } from '@modelcontextprotocol/sdk/types.js';

2
dist/index.d.ts.map vendored
View File

@@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAGzD,YAAY,EACV,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,YAAY,EACb,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,YAAY,EACV,IAAI,EACJ,cAAc,EACd,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,eAAe,YAAY,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAGzD,YAAY,EACV,eAAe,EAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,YAAY,EACb,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD,YAAY,EACV,IAAI,EACJ,cAAc,EACd,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,eAAe,YAAY,CAAC"}

2
dist/index.js.map vendored
View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAOA,2CAAyE;AAAhE,0GAAA,YAAY,OAAA;AACrB,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,2DAAyD;AAAhD,iHAAA,cAAc,OAAA;AACvB,uCAAyD;AAAhD,mHAAA,yBAAyB,OAAA;AAMlC,6DAGkC;AAFhC,2HAAA,uBAAuB,OAAA;AACvB,qHAAA,iBAAiB,OAAA;AAQnB,oDAAsD;AAA7C,6GAAA,cAAc,OAAA;AAUvB,8DAAwC;AACxC,kBAAe,oBAAY,CAAC"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAOA,2CAAyE;AAAhE,0GAAA,YAAY,OAAA;AACrB,2EAAuE;AAA9D,qIAAA,uBAAuB,OAAA;AAChC,2DAAyD;AAAhD,iHAAA,cAAc,OAAA;AACvB,uCAAyD;AAAhD,mHAAA,yBAAyB,OAAA;AAMlC,6DAGkC;AAFhC,2HAAA,uBAAuB,OAAA;AACvB,qHAAA,iBAAiB,OAAA;AAcnB,oDAAsD;AAA7C,6GAAA,cAAc,OAAA;AAUvB,8DAAwC;AACxC,kBAAe,oBAAY,CAAC"}

View File

@@ -1,6 +1,7 @@
import { Request, Response } from 'express';
import { InstanceContext } from './types/instance-context';
import { SessionState } from './types/session-state';
import { GenerateWorkflowHandler } from './types/generate-workflow';
export interface EngineHealth {
status: 'healthy' | 'unhealthy';
uptime: number;
@@ -15,6 +16,7 @@ export interface EngineHealth {
export interface EngineOptions {
sessionTimeout?: number;
logLevel?: 'error' | 'warn' | 'info' | 'debug';
generateWorkflowHandler?: GenerateWorkflowHandler;
}
export declare class N8NMCPEngine {
private server;

View File

@@ -1 +1 @@
{"version":3,"file":"mcp-engine.d.ts","sourceRoot":"","sources":["../src/mcp-engine.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,SAAS,GAAG,WAAW,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAChD;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,SAAS,CAAO;gBAEZ,OAAO,GAAE,aAAkB;IA8BjC,cAAc,CAClB,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,eAAe,CAAC,EAAE,eAAe,GAChC,OAAO,CAAC,IAAI,CAAC;IAkBV,WAAW,IAAI,OAA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cAAc,CAClB,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,eAAe,CAAC,EAAE,eAAe,GAChC,OAAO,CAAC,IAAI,CAAC;IAkBV,WAAW,IAAI,OAAO,CAAC,YAAY,CAAC;IAgC1C,cAAc,IAAI;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE;IAoBvE,kBAAkB,IAAI,YAAY,EAAE;IAwBpC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM;IAiB/C,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IASzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B;AA2CD,eAAe,YAAY,CAAC"}

4
dist/mcp-engine.js vendored
View File

@@ -5,7 +5,9 @@ const http_server_single_session_1 = require("./http-server-single-session");
const logger_1 = require("./utils/logger");
class N8NMCPEngine {
constructor(options = {}) {
this.server = new http_server_single_session_1.SingleSessionHTTPServer();
this.server = new http_server_single_session_1.SingleSessionHTTPServer({
generateWorkflowHandler: options.generateWorkflowHandler,
});
this.startTime = new Date();
if (options.logLevel) {
process.env.LOG_LEVEL = options.logLevel;

View File

@@ -1 +1 @@
{"version":3,"file":"mcp-engine.js","sourceRoot":"","sources":["../src/mcp-engine.ts"],"names":[],"mappings":";;;AAQA,6EAAuE;AACvE,2CAAwC;AAqBxC,MAAa,YAAY;IAIvB,YAAY,UAAyB,EAAE;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,oDAAuB,EAAE,CAAC;QAC5C,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QAE5B,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC3C,CAAC;IACH,CAAC;IAuBD,KAAK,CAAC,cAAc,CAClB,GAAY,EAC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E,KAAK;gBACpB,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC9C,OAAO,EAAE,QAAQ;aAClB,CAAC;QACJ,CAAC;IACH,CAAC;IAMD,cAAc;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;IACtC,CAAC;IAkBD,kBAAkB;QAChB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,eAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;YAC9D,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC;IAC1C,CAAC;IAkBD,mBAAmB,CAAC,QAAwB;QAC1C,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,eAAM,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;YAC/D,OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACnD,CAAC;IAWD,KAAK,CAAC,QAAQ;QACZ,eAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAC/C,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;IAMD,KAAK,CAAC,KAAK;QACT,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF;AAnKD,oCAmKC;AA2CD,kBAAe,YAAY,CAAC"}

View File

@@ -26,6 +26,7 @@ export declare function handleDiagnostic(request: any, context?: InstanceContext
export declare function handleWorkflowVersions(args: unknown, repository: NodeRepository, context?: InstanceContext): Promise<McpToolResponse>;
export declare function handleDeployTemplate(args: unknown, templateService: TemplateService, repository: NodeRepository, context?: InstanceContext): Promise<McpToolResponse>;
export declare function handleTriggerWebhookWorkflow(args: unknown, context?: InstanceContext): Promise<McpToolResponse>;
export declare function tryParseJson(val: unknown): unknown;
export declare function handleCreateTable(args: unknown, context?: InstanceContext): Promise<McpToolResponse>;
export declare function handleListTables(args: unknown, context?: InstanceContext): Promise<McpToolResponse>;
export declare function handleGetTable(args: unknown, context?: InstanceContext): Promise<McpToolResponse>;

View File

@@ -1 +1 @@
{"version":3,"file":"handlers-n8n-manager.d.ts","sourceRoot":"","sources":["../../src/mcp/handlers-n8n-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAML,eAAe,EAGhB,MAAM,kBAAkB,CAAC;AAkB1B,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAA2B,MAAM,2BAA2B,CAAC;AAOrF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAqNhE,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAMD,wBAAgB,uBAAuB,gDAEtC;AAKD,wBAAgB,kBAAkB,IAAI,IAAI,CAIzC;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,YAAY,GAAG,IAAI,CAgF9E;AA4HD,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA8F7G;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAiC1G;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAoDjH;AAED,wBAAsB,0BAA0B,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAmDnH;AAED,wBA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,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CASvG;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAgB1G;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAS1G;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAuBtG;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAazG;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAazG;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAazG;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAiBzG"}

View File

@@ -56,6 +56,7 @@ exports.handleDiagnostic = handleDiagnostic;
exports.handleWorkflowVersions = handleWorkflowVersions;
exports.handleDeployTemplate = handleDeployTemplate;
exports.handleTriggerWebhookWorkflow = handleTriggerWebhookWorkflow;
exports.tryParseJson = tryParseJson;
exports.handleCreateTable = handleCreateTable;
exports.handleListTables = handleListTables;
exports.handleGetTable = handleGetTable;

File diff suppressed because one or more lines are too long

View File

@@ -55,7 +55,7 @@ const NODE_TARGETING_OPERATIONS = new Set([
]);
const workflowDiffSchema = zod_1.z.object({
id: zod_1.z.string(),
operations: zod_1.z.array(zod_1.z.object({
operations: zod_1.z.preprocess(handlers_n8n_manager_1.tryParseJson, zod_1.z.array(zod_1.z.object({
type: zod_1.z.string(),
description: zod_1.z.string().optional(),
node: zod_1.z.any().optional(),
@@ -93,7 +93,7 @@ const workflowDiffSchema = zod_1.z.object({
}
}
return op;
})),
}))),
validateOnly: zod_1.z.boolean().optional(),
continueOnError: zod_1.z.boolean().optional(),
createBackup: zod_1.z.boolean().optional(),

File diff suppressed because one or more lines are too long

11
dist/mcp/server.d.ts vendored
View File

@@ -1,5 +1,9 @@
import { InstanceContext } from '../types/instance-context';
import { GenerateWorkflowHandler } from '../types/generate-workflow';
import { EarlyErrorLogger } from '../telemetry/early-error-logger';
interface MCPServerOptions {
generateWorkflowHandler?: GenerateWorkflowHandler;
}
export declare class N8NDocumentationMCPServer {
private server;
private db;
@@ -16,7 +20,8 @@ export declare class N8NDocumentationMCPServer {
private useSharedDatabase;
private sharedDbState;
private isShutdown;
constructor(instanceContext?: InstanceContext, earlyLogger?: EarlyErrorLogger);
private generateWorkflowHandler?;
constructor(instanceContext?: InstanceContext, earlyLogger?: EarlyErrorLogger, options?: MCPServerOptions);
close(): Promise<void>;
private initializeDatabase;
private initializeInMemorySchema;
@@ -46,6 +51,7 @@ export declare class N8NDocumentationMCPServer {
private getNodeDocumentation;
private safeJsonParse;
private getDatabaseStatistics;
private buildOperationsTree;
private getNodeEssentials;
private getNode;
private handleInfoMode;
@@ -74,6 +80,8 @@ export declare class N8NDocumentationMCPServer {
private listNodeTemplates;
private getTemplate;
private searchTemplates;
private workflowPatternsCache;
private getWorkflowPatterns;
private getTemplatesForTask;
private searchTemplatesByMetadata;
private getTaskDescription;
@@ -83,4 +91,5 @@ export declare class N8NDocumentationMCPServer {
run(): Promise<void>;
shutdown(): Promise<void>;
}
export {};
//# sourceMappingURL=server.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AA0CA,OAAO,EA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O,CAAC,iBAAiB;YAqFX,WAAW;YAgCX,oBAAoB;IAuFlC,OAAO,CAAC,aAAa;YAQP,qBAAqB;IA4DnC,OAAO,CAAC,mBAAmB;YAyCb,iBAAiB;YAiKjB,OAAO;YAgDP,cAAc;YAwFd,iBAAiB;IAqC/B,OAAO,CAAC,iBAAiB;IA0BzB,OAAO,CAAC,iBAAiB;IA0BzB,OAAO,CAAC,eAAe;IAwCvB,OAAO,CAAC,kBAAkB;IAiC1B,OAAO,CAAC,aAAa;IAoCrB,OAAO,CAAC,0BAA0B;IAgClC,OAAO,CAAC,4BAA4B;YAKtB,oBAAoB;IAsDlC,OAAO,CAAC,gBAAgB;YAiBV,SAAS;YA6CT,kBAAkB;YAqElB,uBAAuB;YAsDvB,iBAAiB;IAqE/B,OAAO,CAAC,qBAAqB;IA8C7B,OAAO,CAAC,uBAAuB;IA4D/B,OAAO,CAAC,wBAAwB;IAkChC,OAAO,CAAC,iBAAiB;YAoDX,mBAAmB;YAoEnB,qBAAqB;IAS7B,OAAO,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;YAS9B,aAAa;YAcb,iBAAiB;YAoBjB,WAAW;YAwBX,eAAe;IAqB7B,OAAO,CAAC,qBAAqB,CASb;IAEhB,OAAO,CAAC,mBAAmB;YAsDb,mBAAmB;YAwBnB,yBAAyB;IA4CvC,OAAO,CAAC,kBAAkB;YAiBZ,gBAAgB;YA6HhB,2BAA2B;YAiE3B,2BAA2B;IAyEnC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA0BpB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAgEhC"}

186
dist/mcp/server.js vendored
View File

@@ -72,7 +72,7 @@ const protocol_version_1 = require("../utils/protocol-version");
const telemetry_1 = require("../telemetry");
const startup_checkpoints_1 = require("../telemetry/startup-checkpoints");
class N8NDocumentationMCPServer {
constructor(instanceContext, earlyLogger) {
constructor(instanceContext, earlyLogger, options) {
this.db = null;
this.repository = null;
this.templateService = null;
@@ -86,8 +86,10 @@ class N8NDocumentationMCPServer {
this.sharedDbState = null;
this.isShutdown = false;
this.dbHealthChecked = false;
this.workflowPatternsCache = null;
this.instanceContext = instanceContext;
this.earlyLogger = earlyLogger || null;
this.generateWorkflowHandler = options?.generateWorkflowHandler;
const envDbPath = process.env.NODE_DB_PATH;
let dbPath = null;
let possiblePaths = [];
@@ -499,6 +501,9 @@ class N8NDocumentationMCPServer {
}
}
processedArgs = this.coerceStringifiedJsonParams(name, processedArgs);
if (processedArgs) {
processedArgs = JSON.parse(JSON.stringify(processedArgs));
}
try {
logger_1.logger.debug(`Executing tool: ${name}`, { args: processedArgs });
const startTime = Date.now();
@@ -931,6 +936,7 @@ class N8NDocumentationMCPServer {
return this.searchNodes(args.query, limit, {
mode: args.mode,
includeExamples: args.includeExamples,
includeOperations: args.includeOperations,
source: args.source
});
case 'get_node':
@@ -1022,6 +1028,8 @@ class N8NDocumentationMCPServer {
requiredService: args.requiredService,
targetAudience: args.targetAudience
}, searchLimit, searchOffset);
case 'patterns':
return this.getWorkflowPatterns(args.task, searchLimit);
case 'keyword':
default:
if (!args.query) {
@@ -1132,6 +1140,44 @@ class N8NDocumentationMCPServer {
throw new Error(`Unknown action: ${dtAction}. Valid actions: createTable, listTables, getTable, updateTable, deleteTable, getRows, insertRows, updateRows, upsertRows, deleteRows`);
}
}
case 'n8n_generate_workflow': {
this.validateToolParams(name, args, ['description']);
if (this.generateWorkflowHandler && this.instanceContext) {
await this.ensureInitialized();
if (!this.repository) {
throw new Error('Repository not initialized');
}
const repo = this.repository;
const ctx = this.instanceContext;
const helpers = {
createWorkflow: (wfArgs) => n8nHandlers.handleCreateWorkflow(wfArgs, ctx),
validateWorkflow: (id) => n8nHandlers.handleValidateWorkflow({ id }, repo, ctx),
autofixWorkflow: (id) => n8nHandlers.handleAutofixWorkflow({ id }, repo, ctx),
getWorkflow: (id) => n8nHandlers.handleGetWorkflow({ id }, ctx),
};
try {
const result = await this.generateWorkflowHandler({ description: args.description, skip_cache: args.skip_cache }, ctx, helpers);
return result ?? { success: false, error: 'Handler returned no result' };
}
catch (err) {
const message = err instanceof Error ? err.message : String(err);
return { success: false, error: message };
}
}
return {
hosted_only: true,
message: 'The n8n_generate_workflow tool is available exclusively on the hosted version of n8n-mcp. ' +
'It uses AI to generate complete, validated n8n workflows from natural language descriptions.\n\n' +
'To access this feature:\n' +
'1. Register for free at https://dashboard.n8n-mcp.com\n' +
'2. Connect your n8n instance\n' +
'3. Use your hosted API key in your MCP client\n\n' +
'The hosted service includes:\n' +
'- 73,000+ pre-built workflow templates with instant deployment\n' +
'- AI-powered fresh generation for custom workflows\n' +
'- Automatic validation and error correction'
};
}
default:
throw new Error(`Unknown tool: ${name}`);
}
@@ -1270,7 +1316,7 @@ class N8NDocumentationMCPServer {
return { query, results: [], totalCount: 0 };
}
if (mode === 'FUZZY') {
return this.searchNodesFuzzy(cleanedQuery, limit);
return this.searchNodesFuzzy(cleanedQuery, limit, { includeOperations: options?.includeOperations });
}
let ftsQuery;
if (cleanedQuery.startsWith('"') && cleanedQuery.endsWith('"')) {
@@ -1338,7 +1384,7 @@ class N8NDocumentationMCPServer {
const hasHttpRequest = scoredNodes.some(n => n.node_type === 'nodes-base.httpRequest');
if (cleanedQuery.toLowerCase().includes('http') && !hasHttpRequest) {
logger_1.logger.debug('FTS missed HTTP Request node, augmenting with LIKE search');
return this.searchNodesLIKE(query, limit);
return this.searchNodesLIKE(query, limit, options);
}
const result = {
query,
@@ -1362,6 +1408,12 @@ class N8NDocumentationMCPServer {
nodeResult.npmDownloads = node.npm_downloads;
}
}
if (options?.includeOperations) {
const opsTree = this.buildOperationsTree(node.operations);
if (opsTree) {
nodeResult.operationsTree = opsTree;
}
}
return nodeResult;
}),
totalCount: scoredNodes.length
@@ -1412,7 +1464,7 @@ class N8NDocumentationMCPServer {
return this.searchNodesLIKE(query, limit);
}
}
async searchNodesFuzzy(query, limit) {
async searchNodesFuzzy(query, limit, options) {
if (!this.db)
throw new Error('Database not initialized');
const words = query.toLowerCase().split(/\s+/).filter(w => w.length > 0);
@@ -1440,14 +1492,23 @@ class N8NDocumentationMCPServer {
return {
query,
mode: 'FUZZY',
results: matchingNodes.map(node => ({
nodeType: node.node_type,
workflowNodeType: (0, node_utils_1.getWorkflowNodeType)(node.package_name, node.node_type),
displayName: node.display_name,
description: node.description,
category: node.category,
package: node.package_name
})),
results: matchingNodes.map(node => {
const nodeResult = {
nodeType: node.node_type,
workflowNodeType: (0, node_utils_1.getWorkflowNodeType)(node.package_name, node.node_type),
displayName: node.display_name,
description: node.description,
category: node.category,
package: node.package_name
};
if (options?.includeOperations) {
const opsTree = this.buildOperationsTree(node.operations);
if (opsTree) {
nodeResult.operationsTree = opsTree;
}
}
return nodeResult;
}),
totalCount: matchingNodes.length
};
}
@@ -1568,6 +1629,12 @@ class N8NDocumentationMCPServer {
nodeResult.npmDownloads = node.npm_downloads;
}
}
if (options?.includeOperations) {
const opsTree = this.buildOperationsTree(node.operations);
if (opsTree) {
nodeResult.operationsTree = opsTree;
}
}
return nodeResult;
}),
totalCount: rankedNodes.length
@@ -1635,6 +1702,12 @@ class N8NDocumentationMCPServer {
nodeResult.npmDownloads = node.npm_downloads;
}
}
if (options?.includeOperations) {
const opsTree = this.buildOperationsTree(node.operations);
if (opsTree) {
nodeResult.operationsTree = opsTree;
}
}
return nodeResult;
}),
totalCount: rankedNodes.length
@@ -1938,6 +2011,47 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
})),
};
}
buildOperationsTree(operationsRaw) {
if (!operationsRaw)
return undefined;
let ops;
if (typeof operationsRaw === 'string') {
try {
ops = JSON.parse(operationsRaw);
}
catch {
return undefined;
}
}
else if (Array.isArray(operationsRaw)) {
ops = operationsRaw;
}
else {
return undefined;
}
if (!Array.isArray(ops) || ops.length === 0)
return undefined;
const byResource = new Map();
for (const op of ops) {
const resource = op.resource || 'default';
const opName = op.name || op.operation;
if (!opName)
continue;
if (!byResource.has(resource)) {
byResource.set(resource, []);
}
const list = byResource.get(resource);
if (!list.includes(opName)) {
list.push(opName);
}
}
if (byResource.size === 0)
return undefined;
return Array.from(byResource.entries()).map(([resource, operations]) => ({
resource,
operations
}));
}
async getNodeEssentials(nodeType, includeExamples) {
await this.ensureInitialized();
if (!this.repository)
@@ -2795,6 +2909,54 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
tip: `Found ${result.total} templates matching "${query}". Showing ${result.items.length}.`
};
}
getWorkflowPatterns(category, limit = 10) {
if (!this.workflowPatternsCache) {
try {
const patternsPath = path_1.default.join(__dirname, '..', '..', 'data', 'workflow-patterns.json');
if ((0, fs_1.existsSync)(patternsPath)) {
this.workflowPatternsCache = JSON.parse((0, fs_1.readFileSync)(patternsPath, 'utf-8'));
}
else {
return { error: 'Workflow patterns not generated yet. Run: npm run mine:patterns' };
}
}
catch (e) {
return { error: `Failed to load workflow patterns: ${e instanceof Error ? e.message : String(e)}` };
}
}
const patterns = this.workflowPatternsCache;
if (category) {
const categoryData = patterns.categories[category];
if (!categoryData) {
const available = Object.keys(patterns.categories);
return { error: `Unknown category "${category}". Available: ${available.join(', ')}` };
}
const MAX_CHAINS = 5;
return {
category,
templateCount: categoryData.templateCount,
pattern: categoryData.pattern,
nodes: categoryData.nodes?.slice(0, limit).map(n => ({
type: n.type, freq: n.frequency, role: n.role
})),
chains: categoryData.commonChains?.slice(0, MAX_CHAINS).map(c => ({
path: c.chain.map(t => t.split('.').pop() ?? t), count: c.count, freq: c.frequency
})),
};
}
const overview = Object.entries(patterns.categories).map(([name, data]) => ({
category: name,
templateCount: data.templateCount,
pattern: data.pattern,
topNodes: data.nodes?.slice(0, 5).map(n => n.displayName || n.type),
}));
return {
templateCount: patterns.templateCount,
generatedAt: patterns.generatedAt,
categories: overview,
tip: 'Use search_templates({searchMode: "patterns", task: "category_name"}) for full pattern data with nodes, chains, and tips.',
};
}
async getTemplatesForTask(task, limit = 10, offset = 0) {
await this.ensureInitialized();
if (!this.templateService)

File diff suppressed because one or more lines are too long

View File

@@ -29,6 +29,16 @@ console.table = () => { };
console.clear = () => { };
console.count = () => { };
console.countReset = () => { };
const originalStdoutWrite = process.stdout.write.bind(process.stdout);
const stderrWrite = process.stderr.write.bind(process.stderr);
process.stdout.write = function (chunk, encodingOrCallback, callback) {
const str = typeof chunk === 'string' ? chunk : chunk.toString();
const trimmed = str.trimStart();
if (trimmed.startsWith('{') && trimmed.includes('"jsonrpc"')) {
return originalStdoutWrite(chunk, encodingOrCallback, callback);
}
return stderrWrite(chunk, encodingOrCallback, callback);
};
const server_1 = require("./server");
let server = null;
async function main() {

View File

@@ -1 +1 @@
{"version":3,"file":"stdio-wrapper.js","sourceRoot":"","sources":["../../src/mcp/stdio-wrapper.ts"],"names":[],"mappings":";;;AAQA,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC;AAC/B,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,MAAM,CAAC;AAC5C,OAAO,CAAC,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC;AAGhC,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;AACvC,MAAM,oBAAoB,GAAG,OAAO,CAAC,KAAK,CAAC;AAC3C,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;AACzC,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;AACzC,MAAM,oBAAoB,GAAG,OAAO,CAAC,KAAK,CAAC;AAC3C,MAAM,oBAAoB,GAAG,OAAO,CAAC,KAAK,CAAC;AAC3C,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC;AACvC,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;AACzC,MAAM,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;AAG/C,OAAO,CAAC,GAAG,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AACvB,OAAO,CAAC,KAAK,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AACzB,OAAO,CAAC,IA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,CAAC;YACX,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,oBAAoB,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IACxD,CAAC;IAGD,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACtB,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAGxB,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;IAGhB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAGD,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AACtD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpD,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAGpD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;IAC3B,oBAAoB,CAAC,gCAAgC,CAAC,CAAC;IACvD,KAAK,QAAQ,CAAC,aAAa,CAAC,CAAC;AAC/B,CAAC,CAAC,CAAC;AAEH,IAAI,EAAE,CAAC"}

View File

@@ -1 +1 @@
{"version":3,"file":"search-nodes.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/discovery/search-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,cAAc,EAAE,iBAiE5B,CAAC"}
{"version":3,"file":"search-nodes.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/discovery/search-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,cAAc,EAAE,iBA+D5B,CAAC"}

View File

@@ -6,7 +6,7 @@ exports.searchNodesDoc = {
category: 'discovery',
essentials: {
description: 'Text search across node names and descriptions. Returns most relevant nodes first, with frequently-used nodes (HTTP Request, Webhook, Set, Code, Slack) prioritized in results. Searches all 800+ nodes including 300+ verified community nodes.',
keyParameters: ['query', 'mode', 'limit', 'source', 'includeExamples'],
keyParameters: ['query', 'mode', 'limit', 'source', 'includeExamples', 'includeOperations'],
example: 'search_nodes({query: "webhook"})',
performance: '<20ms even for complex queries',
tips: [
@@ -15,7 +15,8 @@ exports.searchNodesDoc = {
'FUZZY mode: Handles typos and spelling errors',
'Use quotes for exact phrases: "google sheets"',
'Use source="community" to search only community nodes',
'Use source="verified" for verified community nodes only'
'Use source="verified" for verified community nodes only',
'Use includeOperations=true to get resource/operation trees without a separate get_node call'
]
},
full: {
@@ -25,20 +26,17 @@ exports.searchNodesDoc = {
limit: { type: 'number', description: 'Maximum results to return. Default: 20, Max: 100', required: false },
mode: { type: 'string', description: 'Search mode: "OR" (any word matches, default), "AND" (all words required), "FUZZY" (typo-tolerant)', required: false },
source: { type: 'string', description: 'Filter by node source: "all" (default, everything), "core" (n8n base nodes only), "community" (community nodes only), "verified" (verified community nodes only)', required: false },
includeExamples: { type: 'boolean', description: 'Include top 2 real-world configuration examples from popular templates for each node. Default: false. Adds ~200-400 tokens per node.', required: false }
includeExamples: { type: 'boolean', description: 'Include top 2 real-world configuration examples from popular templates for each node. Default: false. Adds ~200-400 tokens per node.', required: false },
includeOperations: { type: 'boolean', description: 'Include resource/operation tree per node. Default: false. Adds ~100-300 tokens per result but saves a get_node round-trip. Only returned for nodes with resource/operation patterns — trigger nodes and freeform nodes (Code, HTTP Request) omit this field.', required: false }
},
returns: 'Array of node objects sorted by relevance score. Each object contains: nodeType, displayName, description, category, relevance score. For community nodes, also includes: isCommunity (boolean), isVerified (boolean), authorName (string), npmDownloads (number). Common nodes appear first when relevance is similar.',
examples: [
'search_nodes({query: "webhook"}) - Returns Webhook node as top result',
'search_nodes({query: "database"}) - Returns MySQL, Postgres, MongoDB, Redis, etc.',
'search_nodes({query: "google sheets", mode: "AND"}) - Requires both words',
'search_nodes({query: "slak", mode: "FUZZY"}) - Finds Slack despite typo',
'search_nodes({query: "http api"}) - Finds HTTP Request, GraphQL, REST nodes',
'search_nodes({query: "transform data"}) - Finds Set, Code, Function, Item Lists nodes',
'search_nodes({query: "scraping", source: "community"}) - Find community scraping nodes',
'search_nodes({query: "pdf", source: "verified"}) - Find verified community PDF nodes',
'search_nodes({query: "brightdata"}) - Find BrightData community node',
'search_nodes({query: "slack", includeExamples: true}) - Get Slack with template examples'
'search_nodes({query: "slack", includeExamples: true}) - Get Slack with template examples',
'search_nodes({query: "slack", includeOperations: true}) - Get Slack with resource/operation tree (7 resources, 44 ops)'
],
useCases: [
'Finding nodes when you know partial names',

View File

@@ -1 +1 @@
{"version":3,"file":"search-nodes.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/discovery/search-nodes.ts"],"names":[],"mappings":";;;AAEa,QAAA,cAAc,GAAsB;IAC/C,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,WAAW;IACrB,UAAU,EAAE;QACV,WAAW,EAAE,kPAAkP;QAC/P,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,CAAC;QACtE,OAAO,EAAE,kCAAkC;QAC3C,WAAW,EAAE,gCAAgC;QAC7C,IAAI,EAAE;YACJ,4CAA4C;YAC5C,sCAAsC;YACtC,+CAA+C;YAC/C,+CAA+C;YAC/C,uDAAuD;YACvD,yDAAyD;SAC1D;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,qcAAqc;QACld,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAA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C;YAC3C,6EAA6E;YAC7E,mCAAmC;YACnC,6EAA6E;YAC7E,0DAA0D;YAC1D,qDAAqD;SACtD;QACD,WAAW,EAAE,uFAAuF;QACpG,aAAa,EAAE;YACb,iDAAiD;YACjD,qDAAqD;YACrD,2CAA2C;YAC3C,oDAAoD;YACpD,wEAAwE;YACxE,wDAAwD;SACzD;QACD,QAAQ,EAAE;YACR,sEAAsE;YACtE,8EAA8E;YAC9E,4CAA4C;YAC5C,2EAA2E;YAC3E,yEAAyE;SAC1E;QACD,YAAY,EAAE,CAAC,mCAAmC,EAAE,4CAA4C,EAAE,uCAAuC,CAAC;KAC3I;CACF,CAAC"}

View File

@@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp/tool-docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA6B5C,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAoChE,CAAC;AAGF,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mcp/tool-docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AA8B5C,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAqChE,CAAC;AAGF,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}

View File

@@ -30,6 +30,7 @@ exports.toolsDocumentation = {
n8n_executions: workflow_management_1.n8nExecutionsDoc,
n8n_workflow_versions: workflow_management_1.n8nWorkflowVersionsDoc,
n8n_deploy_template: workflow_management_1.n8nDeployTemplateDoc,
n8n_manage_datatable: workflow_management_1.n8nManageDatatableDoc
n8n_manage_datatable: workflow_management_1.n8nManageDatatableDoc,
n8n_generate_workflow: workflow_management_1.n8nGenerateWorkflowDoc
};
//# sourceMappingURL=index.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/tool-docs/index.ts"],"names":[],"mappings":";;;AAGA,2CAA6C;AAC7C,mDAA6C;AAC7C,6CAAoE;AACpE,2CAAiE;AACjE,qCAGkB;AAClB,qCAAyC;AACzC,+DAc+B;AAGlB,QAAA,kBAAkB,GAAsC;IAEnE,mBAAmB,EAAE,8BAAqB;IAC1C,gBAAgB,EAAE,0BAAiB;IAGnC,eAAe,EAAE,sBAAa;IAG9B,YAAY,EAAE,0BAAc;IAG5B,QAAQ,EAAE,0BAAU;IAGpB,aAAa,EAAE,4BAAe;IAC9B,iBAAiB,EAAE,gCAAmB;IAGtC,YAAY,EAAE,0BAAc;IAC5B,gBAAgB,EAAE,8BAAkB;IAGpC,mBAAmB,EAAE,0CAAoB;IACzC,gBAAgB,EAAE,uCAAiB;IACnC,wBAAwB,EAAE,8CAAwB;IAClD,2BAA2B,EAAE,iDAA2B;IACxD,mBAAmB,EAAE,0CAAoB;IACzC,kBAAkB,EAAE,yCAAmB;IACvC,qBAAqB,EAAE,4CAAsB;IAC7C,oBAAoB,EAAE,2CAAqB;IAC3C,iBAAiB,EAAE,wCAAkB;IACrC,cAAc,EAAE,sCAAgB;IAChC,qBAAqB,EAAE,4CAAsB;IAC7C,mBAAmB,EAAE,0CAAoB;IACzC,oBAAoB,EAAE,2CAAqB;CAC5C,CAAC"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/tool-docs/index.ts"],"names":[],"mappings":";;;AAGA,2CAA6C;AAC7C,mDAA6C;AAC7C,6CAAoE;AACpE,2CAAiE;AACjE,qCAGkB;AAClB,qCAAyC;AACzC,+DAe+B;AAGlB,QAAA,kBAAkB,GAAsC;IAEnE,mBAAmB,EAAE,8BAAqB;IAC1C,gBAAgB,EAAE,0BAAiB;IAGnC,eAAe,EAAE,sBAAa;IAG9B,YAAY,EAAE,0BAAc;IAG5B,QAAQ,EAAE,0BAAU;IAGpB,aAAa,EAAE,4BAAe;IAC9B,iBAAiB,EAAE,gCAAmB;IAGtC,YAAY,EAAE,0BAAc;IAC5B,gBAAgB,EAAE,8BAAkB;IAGpC,mBAAmB,EAAE,0CAAoB;IACzC,gBAAgB,EAAE,uCAAiB;IACnC,wBAAwB,EAAE,8CAAwB;IAClD,2BAA2B,EAAE,iDAA2B;IACxD,mBAAmB,EAAE,0CAAoB;IACzC,kBAAkB,EAAE,yCAAmB;IACvC,qBAAqB,EAAE,4CAAsB;IAC7C,oBAAoB,EAAE,2CAAqB;IAC3C,iBAAiB,EAAE,wCAAkB;IACrC,cAAc,EAAE,sCAAgB;IAChC,qBAAqB,EAAE,4CAAsB;IAC7C,mBAAmB,EAAE,0CAAoB;IACzC,oBAAoB,EAAE,2CAAqB;IAC3C,qBAAqB,EAAE,4CAAsB;CAC9C,CAAC"}

View File

@@ -1 +1 @@
{"version":3,"file":"search-templates.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/templates/search-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,kBAAkB,EAAE,iBA0IhC,CAAC"}
{"version":3,"file":"search-templates.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/templates/search-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,kBAAkB,EAAE,iBAoJhC,CAAC"}

View File

@@ -5,7 +5,7 @@ exports.searchTemplatesDoc = {
name: 'search_templates',
category: 'templates',
essentials: {
description: 'Unified template search with multiple modes: keyword search, by node types, by task type, or by metadata. 2,700+ templates available.',
description: 'Unified template search with multiple modes: keyword search, by node types, by task type, by metadata, or patterns. 2,700+ templates available.',
keyParameters: ['searchMode', 'query', 'nodeTypes', 'task', 'limit'],
example: 'search_templates({searchMode: "by_task", task: "webhook_processing"})',
performance: 'Fast (<100ms) - FTS5 full-text search',
@@ -13,7 +13,9 @@ exports.searchTemplatesDoc = {
'searchMode="keyword" (default): Search by name/description',
'searchMode="by_nodes": Find templates using specific nodes',
'searchMode="by_task": Get curated templates for common tasks',
'searchMode="by_metadata": Filter by complexity, services, audience'
'searchMode="by_metadata": Filter by complexity, services, audience',
'searchMode="patterns": Workflow pattern summaries across 10 task categories',
'patterns without task: overview of all categories. patterns with task: node frequencies + connection chains'
]
},
full: {
@@ -22,14 +24,15 @@ exports.searchTemplatesDoc = {
- by_nodes: Find templates that use specific node types
- by_task: Get curated templates for predefined task categories
- by_metadata: Filter by complexity, setup time, required services, or target audience
- patterns: Lightweight workflow pattern summaries mined from 2,700+ templates
**Available Task Types (for searchMode="by_task"):**
**Available Task Types (for searchMode="by_task" and "patterns"):**
ai_automation, data_sync, webhook_processing, email_automation, slack_integration, data_transformation, file_processing, scheduling, api_integration, database_operations`,
parameters: {
searchMode: {
type: 'string',
required: false,
description: 'Search mode: "keyword" (default), "by_nodes", "by_task", "by_metadata"'
description: 'Search mode: "keyword" (default), "by_nodes", "by_task", "by_metadata", "patterns"'
},
query: {
type: 'string',
@@ -44,7 +47,7 @@ ai_automation, data_sync, webhook_processing, email_automation, slack_integratio
task: {
type: 'string',
required: false,
description: 'For searchMode=by_task: Task type (ai_automation, data_sync, webhook_processing, email_automation, slack_integration, data_transformation, file_processing, scheduling, api_integration, database_operations)'
description: 'For searchMode=by_task: Task type. For searchMode=patterns: optional category filter (omit for overview of all categories). Values: ai_automation, data_sync, webhook_processing, email_automation, slack_integration, data_transformation, file_processing, scheduling, api_integration, database_operations'
},
complexity: {
type: 'string',
@@ -92,38 +95,45 @@ ai_automation, data_sync, webhook_processing, email_automation, slack_integratio
description: 'Pagination offset (default 0)'
}
},
returns: `Returns an object containing:
returns: `For keyword/by_nodes/by_task/by_metadata modes:
- templates: Array of matching templates
- id: Template ID for get_template()
- name: Template name
- description: What the workflow does
- author: Creator information
- nodes: Array of node types used
- views: Popularity metric
- created: Creation date
- url: Link to template
- metadata: AI-generated metadata (complexity, services, etc.)
- name, description, author, nodes, views, created, url, metadata
- totalFound: Total matching templates
- searchMode: The mode used`,
- searchMode: The mode used
For patterns mode (no task):
- templateCount, generatedAt
- categories: Array of {category, templateCount, pattern, topNodes}
- tip: How to drill into a specific category
For patterns mode (with task):
- category, templateCount, pattern
- nodes: Array of {type, freq, role} (top nodes by frequency, limited by 'limit')
- chains: Array of {path, count, freq} (top 5 connection chains, short node names)`,
examples: [
'// Keyword search (default)\nsearch_templates({query: "chatbot"})',
'// Find templates using specific nodes\nsearch_templates({searchMode: "by_nodes", nodeTypes: ["n8n-nodes-base.httpRequest", "n8n-nodes-base.slack"]})',
'// Get templates for a task type\nsearch_templates({searchMode: "by_task", task: "webhook_processing"})',
'// Filter by metadata\nsearch_templates({searchMode: "by_metadata", complexity: "simple", requiredService: "openai"})',
'// Combine metadata filters\nsearch_templates({searchMode: "by_metadata", maxSetupMinutes: 30, targetAudience: "developers"})'
'// Combine metadata filters\nsearch_templates({searchMode: "by_metadata", maxSetupMinutes: 30, targetAudience: "developers"})',
'// Pattern overview — all categories with top nodes (~550 tokens)\nsearch_templates({searchMode: "patterns"})',
'// Detailed patterns for a category — node frequencies + connection chains\nsearch_templates({searchMode: "patterns", task: "ai_automation"})'
],
useCases: [
'Find workflows by business purpose (keyword search)',
'Find templates using specific integrations (by_nodes)',
'Get pre-built solutions for common tasks (by_task)',
'Filter by complexity for team skill level (by_metadata)',
'Find templates requiring specific services (by_metadata)'
'Understand common workflow shapes before building (patterns)',
'Architecture planning — which nodes go together (patterns)'
],
performance: `Fast performance across all modes:
- keyword: <50ms with FTS5 indexing
- by_nodes: <100ms with indexed lookups
- by_task: <50ms from curated cache
- by_metadata: <100ms with filtered queries`,
- by_metadata: <100ms with filtered queries
- patterns: <10ms (pre-mined, cached in memory)`,
bestPractices: [
'Use searchMode="by_task" for common automation patterns',
'Use searchMode="by_nodes" when you know which integrations you need',

View File

@@ -1 +1 @@
{"version":3,"file":"search-templates.js","s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d,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,4FAA4F;aAC1G;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,yFAAyF;aACvG;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,oFAAoF;aAClG;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,OAAO;gBACb,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,iHAAiH;aAC/H;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,uCAAuC;aACrD;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,+BAA+B;aAC7C;SACF;QACD,OAAO,EAAE;;;;;;;;;;;;4BAYe;QACxB,QAAQ,EAAE;YACR,mEAAmE;YACnE,uJAAuJ;YACvJ,yGAAyG;YACzG,uHAAuH;YACvH,+HAA+H;SAChI;QACD,QAAQ,EAAE;YACR,qDAAqD;YACrD,uDAAuD;YACvD,oDAAoD;YACpD,yDAAyD;YACzD,0DAA0D;SAC3D;QACD,WAAW,EAAE;;;;4CAI2B;QACxC,aAAa,EAAE;YACb,yDAAyD;YACzD,qEAAqE;YACrE,gDAAgD;YAChD,kDAAkD;YAClD,oDAAoD;SACrD;QACD,QAAQ,EAAE;YACR,kEAAkE;YAClE,mEAAmE;YACnE,8CAA8C;YAC9C,0CAA0C;SAC3C;QACD,YAAY,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,mBAAmB,CAAC;KACpE;CACF,CAAC"}
{"version":3,"file":"search-templates.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/templates/search-templates.ts"],"names":[],"mappings":";;;AAEa,QAAA,kBAAkB,GAAsB;IACnD,IAAI,EAAE,kBAAkB;IACxB,QAAQ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;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,yFAAyF;aACvG;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,oFAAoF;aAClG;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,OAAO;gBACb,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,iHAAiH;aAC/H;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,uCAAuC;aACrD;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,WAAW,EAAE,+BAA+B;aAC7C;SACF;QACD,OAAO,EAAE;;;;;;;;;;;;;;;mFAesE;QAC/E,QAAQ,EAAE;YACR,mEAAmE;YACnE,uJAAuJ;YACvJ,yGAAyG;YACzG,uHAAuH;YACvH,+HAA+H;YAC/H,+GAA+G;YAC/G,+IAA+I;SAChJ;QACD,QAAQ,EAAE;YACR,qDAAqD;YACrD,uDAAuD;YACvD,oDAAoD;YACpD,yDAAyD;YACzD,8DAA8D;YAC9D,4DAA4D;SAC7D;QACD,WAAW,EAAE;;;;;gDAK+B;QAC5C,aAAa,EAAE;YACb,yDAAyD;YACzD,qEAAqE;YACrE,gDAAgD;YAChD,kDAAkD;YAClD,oDAAoD;SACrD;QACD,QAAQ,EAAE;YACR,kEAAkE;YAClE,mEAAmE;YACnE,8CAA8C;YAC9C,0CAA0C;SAC3C;QACD,YAAY,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,mBAAmB,CAAC;KACpE;CACF,CAAC"}

View File

@@ -11,4 +11,5 @@ export { n8nExecutionsDoc } from './n8n-executions';
export { n8nWorkflowVersionsDoc } from './n8n-workflow-versions';
export { n8nDeployTemplateDoc } from './n8n-deploy-template';
export { n8nManageDatatableDoc } from './n8n-manage-datatable';
export { n8nGenerateWorkflowDoc } from './n8n-generate-workflow';
//# sourceMappingURL=index.d.ts.map

View File

@@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC"}

View File

@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.n8nManageDatatableDoc = exports.n8nDeployTemplateDoc = exports.n8nWorkflowVersionsDoc = exports.n8nExecutionsDoc = exports.n8nTestWorkflowDoc = exports.n8nAutofixWorkflowDoc = exports.n8nValidateWorkflowDoc = exports.n8nListWorkflowsDoc = exports.n8nDeleteWorkflowDoc = exports.n8nUpdatePartialWorkflowDoc = exports.n8nUpdateFullWorkflowDoc = exports.n8nGetWorkflowDoc = exports.n8nCreateWorkflowDoc = void 0;
exports.n8nGenerateWorkflowDoc = exports.n8nManageDatatableDoc = exports.n8nDeployTemplateDoc = exports.n8nWorkflowVersionsDoc = exports.n8nExecutionsDoc = exports.n8nTestWorkflowDoc = exports.n8nAutofixWorkflowDoc = exports.n8nValidateWorkflowDoc = exports.n8nListWorkflowsDoc = exports.n8nDeleteWorkflowDoc = exports.n8nUpdatePartialWorkflowDoc = exports.n8nUpdateFullWorkflowDoc = exports.n8nGetWorkflowDoc = exports.n8nCreateWorkflowDoc = void 0;
var n8n_create_workflow_1 = require("./n8n-create-workflow");
Object.defineProperty(exports, "n8nCreateWorkflowDoc", { enumerable: true, get: function () { return n8n_create_workflow_1.n8nCreateWorkflowDoc; } });
var n8n_get_workflow_1 = require("./n8n-get-workflow");
@@ -27,4 +27,6 @@ var n8n_deploy_template_1 = require("./n8n-deploy-template");
Object.defineProperty(exports, "n8nDeployTemplateDoc", { enumerable: true, get: function () { return n8n_deploy_template_1.n8nDeployTemplateDoc; } });
var n8n_manage_datatable_1 = require("./n8n-manage-datatable");
Object.defineProperty(exports, "n8nManageDatatableDoc", { enumerable: true, get: function () { return n8n_manage_datatable_1.n8nManageDatatableDoc; } });
var n8n_generate_workflow_1 = require("./n8n-generate-workflow");
Object.defineProperty(exports, "n8nGenerateWorkflowDoc", { enumerable: true, get: function () { return n8n_generate_workflow_1.n8nGenerateWorkflowDoc; } });
//# sourceMappingURL=index.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/index.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AAApD,2HAAA,oBAAoB,OAAA;AAC7B,uDAAuD;AAA9C,qHAAA,iBAAiB,OAAA;AAC1B,uEAAsE;AAA7D,oIAAA,wBAAwB,OAAA;AACjC,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,6DAA6D;AAApD,2HAAA,oBAAoB,OAAA;AAC7B,2DAA2D;AAAlD,yHAAA,mBAAmB,OAAA;AAC5B,iEAAiE;AAAxD,+HAAA,sBAAsB,OAAA;AAC/B,+DAA+D;AAAtD,6HAAA,qBAAqB,OAAA;AAC9B,yDAAyD;AAAhD,uHAAA,kBAAkB,OAAA;AAC3B,mDAAoD;AAA3C,kHAAA,gBAAgB,OAAA;AACzB,iEAAiE;AAAxD,+HAAA,sBAAsB,OAAA;AAC/B,6DAA6D;AAApD,2HAAA,oBAAoB,OAAA;AAC7B,+DAA+D;AAAtD,6HAAA,qBAAqB,OAAA"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/index.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AAApD,2HAAA,oBAAoB,OAAA;AAC7B,uDAAuD;AAA9C,qHAAA,iBAAiB,OAAA;AAC1B,uEAAsE;AAA7D,oIAAA,wBAAwB,OAAA;AACjC,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,6DAA6D;AAApD,2HAAA,oBAAoB,OAAA;AAC7B,2DAA2D;AAAlD,yHAAA,mBAAmB,OAAA;AAC5B,iEAAiE;AAAxD,+HAAA,sBAAsB,OAAA;AAC/B,+DAA+D;AAAtD,6HAAA,qBAAqB,OAAA;AAC9B,yDAAyD;AAAhD,uHAAA,kBAAkB,OAAA;AAC3B,mDAAoD;AAA3C,kHAAA,gBAAgB,OAAA;AACzB,iEAAiE;AAAxD,+HAAA,sBAAsB,OAAA;AAC/B,6DAA6D;AAApD,2HAAA,oBAAoB,OAAA;AAC7B,+DAA+D;AAAtD,6HAAA,qBAAqB,OAAA;AAC9B,iEAAiE;AAAxD,+HAAA,sBAAsB,OAAA"}

View File

@@ -1 +1 @@
{"version":3,"file":"tools-documentation.d.ts","sourceRoot":"","sources":["../../src/mcp/tools-documentation.ts"],"names":[],"mappings":"AAEA,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,YAAY,GAAG,MAAqB,GAAG,MAAM,CA+D1G;AAED,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,YAAY,GAAG,MAAqB,GAAG,MAAM,CAsHpF;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAWjE;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAI7D;AAED,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAM3C"}
{"version":3,"file":"tools-documentation.d.ts","sourceRoot":"","sources":["../../src/mcp/tools-documentation.ts"],"names":[],"mappings":"AAEA,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,YAAY,GAAG,MAAqB,GAAG,MAAM,CA+D1G;AAED,wBAAgB,gBAAgB,CAAC,KAAK,GAAE,YAAY,GAAG,MAAqB,GAAG,MAAM,CAyHpF;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAWjE;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAI7D;AAED,wBAAgB,gBAAgB,IAAI,MAAM,EAAE,CAM3C"}

View File

@@ -98,7 +98,7 @@ When working with Code nodes, always start by calling the relevant guide:
- validate_node({nodeType: "nodes-base.slack", config: {...}}) - Full validation with errors/warnings/suggestions
- validate_workflow({workflow: {...}}) - Validate entire workflow
## Tool Categories (19 Tools Total)
## Tool Categories (21 Tools Total)
**Discovery Tools** (1 tool)
- search_nodes - Full-text search across all nodes (supports OR, AND, FUZZY modes)
@@ -121,8 +121,9 @@ When working with Code nodes, always start by calling the relevant guide:
- searchMode='by_nodes': Find templates using specific nodes
- searchMode='by_task': Curated task-based templates
- searchMode='by_metadata': Filter by complexity/services
- searchMode='patterns': Workflow pattern summaries from 2,700+ templates
**n8n API Tools** (13 tools, requires N8N_API_URL configuration)
**n8n API Tools** (15 tools, requires N8N_API_URL configuration)
- n8n_create_workflow - Create new workflows
- n8n_get_workflow - Get workflow with mode='full'/'details'/'structure'/'minimal'
- n8n_update_full_workflow - Full workflow replacement
@@ -136,6 +137,8 @@ When working with Code nodes, always start by calling the relevant guide:
- n8n_health_check - Check n8n API connectivity
- n8n_workflow_versions - Version history and rollback
- n8n_deploy_template - Deploy templates directly to n8n instance
- n8n_manage_datatable - Manage data tables and rows
- n8n_generate_workflow - Generate workflow from natural language description
## Performance Characteristics
- Instant (<10ms): search_nodes, get_node (minimal/standard)

View File

@@ -1 +1 @@
{"version":3,"file":"tools-documentation.js","sourceRoot":"","sources":["../../src/mcp/tools-documentation.ts"],"names":[],"mappings":";;AAEA,oDA+DC;AAED,4CAsHC;AAED,0DAWC;AAED,gDAIC;AAED,4CAMC;AApND,2CAAiD;AAEjD,SAAgB,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AAY,EAAE,CAAC;QAC3B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sFAgC2E,CAAC;IACrF,CAAC;IAGD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDAoO4C,CAAC;AACtD,CAAC"}

View File

@@ -1 +1 @@
{"version":3,"file":"tools-n8n-manager.d.ts","sourceRoot":"","sources":["../../src/mcp/tools-n8n-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQ1C,eAAO,MAAM,kBAAkB,EAAE,cAAc,EAwoB9C,CAAC"}
{"version":3,"file":"tools-n8n-manager.d.ts","sourceRoot":"","sources":["../../src/mcp/tools-n8n-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQ1C,eAAO,MAAM,kBAAkB,EAAE,cAAc,EAsqB9C,CAAC"}

View File

@@ -635,5 +635,35 @@ exports.n8nManagementTools = [
openWorldHint: true,
},
},
{
name: 'n8n_generate_workflow',
description: 'Generate an n8n workflow from a natural language description using AI. ' +
'Describe what the workflow should do (trigger type, services, logic) and this tool ' +
'will create and deploy a ready-to-use workflow to your n8n instance. ' +
'Set skip_cache=true to force fresh generation instead of using pre-built templates.',
inputSchema: {
type: 'object',
properties: {
description: {
type: 'string',
description: 'Clear description of what the workflow should do. Include: trigger type ' +
'(webhook, schedule, manual), services to integrate (Slack, Gmail, etc.), and the logic/flow.'
},
skip_cache: {
type: 'boolean',
description: 'Set to true to bypass the workflow cache and force fresh AI generation. ' +
'Default: false (uses cached workflows when a good match exists).'
}
},
required: ['description'],
},
annotations: {
title: 'Generate Workflow',
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: true,
},
},
];
//# sourceMappingURL=tools-n8n-manager.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQ1C,eAAO,MAAM,0BAA0B,EAAE,cAAc,EAwatD,CAAC"}
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAQ1C,eAAO,MAAM,0BAA0B,EAAE,cAAc,EA6atD,CAAC"}

13
dist/mcp/tools.js vendored
View File

@@ -52,6 +52,11 @@ exports.n8nDocumentationToolsFinal = [
description: 'Include top 2 real-world configuration examples from popular templates (default: false)',
default: false,
},
includeOperations: {
type: 'boolean',
default: false,
description: 'Include resource/operation tree per node. Adds ~100-300 tokens per result but saves a get_node round-trip.',
},
source: {
type: 'string',
enum: ['all', 'core', 'community', 'verified'],
@@ -237,14 +242,14 @@ exports.n8nDocumentationToolsFinal = [
},
{
name: 'search_templates',
description: `Search templates with multiple modes. Use searchMode='keyword' for text search, 'by_nodes' to find templates using specific nodes, 'by_task' for curated task-based templates, 'by_metadata' for filtering by complexity/setup time/services.`,
description: `Search templates with multiple modes. Use searchMode='keyword' for text search, 'by_nodes' to find templates using specific nodes, 'by_task' for curated task-based templates, 'by_metadata' for filtering by complexity/setup time/services, 'patterns' for lightweight workflow pattern summaries mined from 2700+ templates.`,
inputSchema: {
type: 'object',
properties: {
searchMode: {
type: 'string',
enum: ['keyword', 'by_nodes', 'by_task', 'by_metadata'],
description: 'Search mode. keyword=text search (default), by_nodes=find by node types, by_task=curated task templates, by_metadata=filter by complexity/services',
enum: ['keyword', 'by_nodes', 'by_task', 'by_metadata', 'patterns'],
description: 'Search mode. keyword=text search (default), by_nodes=find by node types, by_task=curated task templates, by_metadata=filter by complexity/services, patterns=lightweight workflow pattern summaries',
default: 'keyword',
},
query: {
@@ -278,7 +283,7 @@ exports.n8nDocumentationToolsFinal = [
'api_integration',
'database_operations'
],
description: 'For searchMode=by_task: the type of task',
description: 'For searchMode=by_task: the type of task. For searchMode=patterns: optional category filter (omit for overview of all categories).',
},
category: {
type: 'string',

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"property-extractor.d.ts","sourceRoot":"","sources":["../../src/parsers/property-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,qBAAa,iBAAiB;IAI5B,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE;IAqC9C,OAAO,CAAC,kBAAkB;IA6B1B,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE;IAiC9C,OAAO,CAAC,gCAAgC;IAmDxC,sBAAsB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO;IA4BrD,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE;IAqC/C,OAAO,CAAC,mBAAmB;CAgB5B"}
{"version":3,"file":"property-extractor.d.ts","sourceRoot":"","sources":["../../src/parsers/property-extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,qBAAa,iBAAiB;IAI5B,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE;IAqC9C,OAAO,CAAC,kBAAkB;IA6B1B,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE;IAiC9C,OAAO,CAAC,gCAAgC;IAwDxC,sBAAsB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO;IA4BrD,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,GAAG,EAAE;IAqC/C,OAAO,CAAC,mBAAmB;CAgB5B"}

View File

@@ -95,13 +95,17 @@ class PropertyExtractor {
}
}
if (description.properties && Array.isArray(description.properties)) {
const operationProp = description.properties.find((p) => p.name === 'operation' || p.name === 'action');
if (operationProp?.options) {
const operationProps = description.properties.filter((p) => p.name === 'operation' || p.name === 'action');
for (const operationProp of operationProps) {
if (!operationProp?.options)
continue;
const resource = operationProp.displayOptions?.show?.resource?.[0];
operationProp.options.forEach((op) => {
operations.push({
operation: op.value,
name: op.name,
description: op.description
description: op.description,
...(resource ? { resource } : {})
});
});
}

File diff suppressed because one or more lines are too long

View File

@@ -12,6 +12,7 @@ interface ExpressionContext {
hasInputData?: boolean;
}
export declare class ExpressionValidator {
private static readonly BARE_EXPRESSION_PATTERNS;
private static readonly EXPRESSION_PATTERN;
private static readonly VARIABLE_PATTERNS;
static validateExpression(expression: string, context: ExpressionContext): ExpressionValidationResult;
@@ -21,6 +22,7 @@ export declare class ExpressionValidator {
private static checkCommonMistakes;
private static checkNodeReferences;
static validateNodeExpressions(parameters: any, context: ExpressionContext): ExpressionValidationResult;
private static checkBareExpression;
private static validateParametersRecursive;
}
export {};

View File

@@ -1 +1 @@
{"version":3,"file":"expression-validator.d.ts","sourceRoot":"","sources":["../../src/services/expression-validator.ts"],"names":[],"mappings":"AAKA,UAAU,0BAA0B;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACxB;AAED,UAAU,iBAAiB;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,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AiB,CAcvC;IAKF,MAAM,CAAC,kBAAkB,CACvB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,iBAAiB,GACzB,0BAA0B;IA2C7B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IA+BhC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAcjC,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAwEvC,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAkDlC,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAgBlC,MAAM,CAAC,uBAAuB,CAC5B,UAAU,EAAE,GAAG,EACf,OAAO,EAAE,iBAAiB,GACzB,0BAA0B;IAoB7B,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAyBlC,OAAO,CAAC,MAAM,CAAC,2BAA2B;CAoD3C"}

View File

@@ -134,6 +134,20 @@ class ExpressionValidator {
combinedResult.valid = combinedResult.errors.length === 0;
return combinedResult;
}
static checkBareExpression(value, path, result) {
if (value.includes('{{') || value.startsWith('=')) {
return;
}
const trimmed = value.trim();
for (const { pattern, name } of this.BARE_EXPRESSION_PATTERNS) {
if (pattern.test(trimmed)) {
result.warnings.push((path ? `${path}: ` : '') +
`Possible unwrapped expression: "${trimmed}" looks like an n8n ${name} reference. ` +
`Use "={{ ${trimmed} }}" to evaluate it as an expression.`);
return;
}
}
}
static validateParametersRecursive(obj, context, result, path = '', visited = new WeakSet()) {
if (obj && typeof obj === 'object') {
if (visited.has(obj)) {
@@ -142,6 +156,7 @@ class ExpressionValidator {
visited.add(obj);
}
if (typeof obj === 'string') {
this.checkBareExpression(obj, path, result);
if (obj.includes('{{')) {
const validation = this.validateExpression(obj, context);
validation.errors.forEach(error => {
@@ -168,6 +183,16 @@ class ExpressionValidator {
}
}
exports.ExpressionValidator = ExpressionValidator;
ExpressionValidator.BARE_EXPRESSION_PATTERNS = [
{ pattern: /^\$json[.\[]/, name: '$json' },
{ pattern: /^\$node\[/, name: '$node' },
{ pattern: /^\$input\./, name: '$input' },
{ pattern: /^\$execution\./, name: '$execution' },
{ pattern: /^\$workflow\./, name: '$workflow' },
{ pattern: /^\$prevNode\./, name: '$prevNode' },
{ pattern: /^\$env\./, name: '$env' },
{ pattern: /^\$(now|today|itemIndex|runIndex)$/, name: 'built-in variable' },
];
ExpressionValidator.EXPRESSION_PATTERN = /\{\{([\s\S]+?)\}\}/g;
ExpressionValidator.VARIABLE_PATTERNS = {
json: /\$json(\.[a-zA-Z_][\w]*|\["[^"]+"\]|\['[^']+'\]|\[\d+\])*/g,

File diff suppressed because one or more lines are too long

View File

@@ -30,10 +30,10 @@ export declare const workflowNodeSchema: z.ZodObject<{
maxTries?: number | undefined;
waitBetweenTries?: number | undefined;
alwaysOutputData?: boolean | undefined;
executeOnce?: boolean | undefined;
disabled?: boolean | undefined;
notes?: string | undefined;
notesInFlow?: boolean | undefined;
executeOnce?: boolean | undefined;
}, {
type: string;
id: string;
@@ -47,10 +47,10 @@ export declare const workflowNodeSchema: z.ZodObject<{
maxTries?: number | undefined;
waitBetweenTries?: number | undefined;
alwaysOutputData?: boolean | undefined;
executeOnce?: boolean | undefined;
disabled?: boolean | undefined;
notes?: string | undefined;
notesInFlow?: boolean | undefined;
executeOnce?: boolean | undefined;
}>;
export declare const workflowConnectionSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
main: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodObject<{
@@ -413,6 +413,7 @@ export declare function cleanWorkflowForCreate(workflow: Partial<Workflow>): Par
export declare function cleanWorkflowForUpdate(workflow: Workflow): Partial<Workflow>;
export declare function validateWorkflowStructure(workflow: Partial<Workflow>): string[];
export declare function hasWebhookTrigger(workflow: Workflow): boolean;
export declare function validateConditionNodeStructure(node: WorkflowNode): string[];
export declare function validateFilterBasedNodeMetadata(node: WorkflowNode): string[];
export declare function validateOperatorStructure(operator: any, path: string): string[];
export declare function getWebhookUrl(workflow: Workflow): string | null;

View File

@@ -1 +1 @@
{"version":3,"file":"n8n-validation.d.ts","sourceRoot":"","sources":["../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leanWorkflowForCreate = cleanWorkflowForCreate;
exports.cleanWorkflowForUpdate = cleanWorkflowForUpdate;
exports.validateWorkflowStructure = validateWorkflowStructure;
exports.hasWebhookTrigger = hasWebhookTrigger;
exports.validateConditionNodeStructure = validateConditionNodeStructure;
exports.validateFilterBasedNodeMetadata = validateFilterBasedNodeMetadata;
exports.validateOperatorStructure = validateOperatorStructure;
exports.getWebhookUrl = getWebhookUrl;
@@ -229,7 +230,7 @@ function validateWorkflowStructure(workflow) {
}
if (workflow.nodes) {
workflow.nodes.forEach((node, index) => {
const filterErrors = validateFilterBasedNodeMetadata(node);
const filterErrors = validateConditionNodeStructure(node);
if (filterErrors.length > 0) {
errors.push(...filterErrors.map(err => `Node "${node.name}" (index ${index}): ${err}`));
}
@@ -332,73 +333,66 @@ function hasWebhookTrigger(workflow) {
return workflow.nodes.some(node => node.type === 'n8n-nodes-base.webhook' ||
node.type === 'n8n-nodes-base.webhookTrigger');
}
function validateFilterBasedNodeMetadata(node) {
function validateConditionNodeStructure(node) {
const errors = [];
const isIFNode = node.type === 'n8n-nodes-base.if' && node.typeVersion >= 2.2;
const isSwitchNode = node.type === 'n8n-nodes-base.switch' && node.typeVersion >= 3.2;
if (!isIFNode && !isSwitchNode) {
return errors;
}
if (isIFNode) {
const conditions = node.parameters.conditions;
if (!conditions?.options) {
errors.push('Missing required "conditions.options". ' +
'IF v2.2+ requires: {version: 2, leftValue: "", caseSensitive: true, typeValidation: "strict"}');
const typeVersion = node.typeVersion || 1;
if (node.type === 'n8n-nodes-base.if') {
if (typeVersion >= 2.2) {
errors.push(...validateFilterOptionsRequired(node.parameters?.conditions, 'conditions'));
errors.push(...validateFilterConditionOperators(node.parameters?.conditions, 'conditions'));
}
else {
const requiredFields = {
version: 2,
leftValue: '',
caseSensitive: 'boolean',
typeValidation: 'strict'
};
for (const [field, expectedValue] of Object.entries(requiredFields)) {
if (!(field in conditions.options)) {
errors.push(`Missing required field "conditions.options.${field}". ` +
`Expected value: ${typeof expectedValue === 'string' ? `"${expectedValue}"` : expectedValue}`);
}
else if (typeVersion >= 2) {
errors.push(...validateFilterConditionOperators(node.parameters?.conditions, 'conditions'));
}
}
else if (node.type === 'n8n-nodes-base.switch') {
if (typeVersion >= 3.2) {
const rules = node.parameters?.rules;
if (rules?.rules && Array.isArray(rules.rules)) {
rules.rules.forEach((rule, i) => {
errors.push(...validateFilterOptionsRequired(rule.conditions, `rules.rules[${i}].conditions`));
errors.push(...validateFilterConditionOperators(rule.conditions, `rules.rules[${i}].conditions`));
});
}
}
if (conditions?.conditions && Array.isArray(conditions.conditions)) {
conditions.conditions.forEach((condition, i) => {
const operatorErrors = validateOperatorStructure(condition.operator, `conditions.conditions[${i}].operator`);
errors.push(...operatorErrors);
});
}
}
if (isSwitchNode) {
const rules = node.parameters.rules;
if (rules?.rules && Array.isArray(rules.rules)) {
rules.rules.forEach((rule, ruleIndex) => {
if (!rule.conditions?.options) {
errors.push(`Missing required "rules.rules[${ruleIndex}].conditions.options". ` +
'Switch v3.2+ requires: {version: 2, leftValue: "", caseSensitive: true, typeValidation: "strict"}');
}
else {
const requiredFields = {
version: 2,
leftValue: '',
caseSensitive: 'boolean',
typeValidation: 'strict'
};
for (const [field, expectedValue] of Object.entries(requiredFields)) {
if (!(field in rule.conditions.options)) {
errors.push(`Missing required field "rules.rules[${ruleIndex}].conditions.options.${field}". ` +
`Expected value: ${typeof expectedValue === 'string' ? `"${expectedValue}"` : expectedValue}`);
}
}
}
if (rule.conditions?.conditions && Array.isArray(rule.conditions.conditions)) {
rule.conditions.conditions.forEach((condition, condIndex) => {
const operatorErrors = validateOperatorStructure(condition.operator, `rules.rules[${ruleIndex}].conditions.conditions[${condIndex}].operator`);
errors.push(...operatorErrors);
});
}
});
}
}
return errors;
}
function validateFilterOptionsRequired(conditions, path) {
const errors = [];
if (!conditions || typeof conditions !== 'object')
return errors;
if (!conditions.options) {
errors.push(`Missing required "${path}.options". ` +
'Filter-based nodes require: {version: 2, leftValue: "", caseSensitive: true, typeValidation: "strict"}');
}
else {
const requiredFields = [
['version', '2'],
['leftValue', '""'],
['caseSensitive', 'true'],
['typeValidation', '"strict"'],
];
for (const [field, display] of requiredFields) {
if (!(field in conditions.options)) {
errors.push(`Missing required field "${path}.options.${field}". Expected value: ${display}`);
}
}
}
return errors;
}
function validateFilterConditionOperators(conditions, path) {
const errors = [];
if (!conditions?.conditions || !Array.isArray(conditions.conditions))
return errors;
conditions.conditions.forEach((condition, i) => {
errors.push(...validateOperatorStructure(condition.operator, `${path}.conditions[${i}].operator`));
});
return errors;
}
function validateFilterBasedNodeMetadata(node) {
return validateConditionNodeStructure(node);
}
function validateOperatorStructure(operator, path) {
const errors = [];
if (!operator || typeof operator !== 'object') {

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"node-specific-validators.d.ts","sourceRoot":"","sources":["../../src/services/node-specific-validators.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAExE,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED,qBAAa,sBAAsB;IAIjC,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAqE1D,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAkDvC,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAsBzC,OAAO,CAAC,MAAM,CAAC,0BAA0B;IA4BzC,OAAO,CAAC,MAAM,CAAC,0BAA0B;IA2CzC,MAAM,CAAC,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAiDjE,OAAO,CAAC,M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6D5D,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IA8DzD,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAuDrC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAuDjC,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAyFtC,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAuKnC,OAAO,CAAC,MAAM,CAAC,oBAAoB;IA2EnC,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;CAwDzD"}

View File

@@ -1317,12 +1317,16 @@ class NodeSpecificValidators {
}
}
if (config.mode === 'manual') {
const hasFields = config.values && Object.keys(config.values).length > 0;
const hasFieldsViaValues = config.values && Object.keys(config.values).length > 0;
const hasFieldsViaAssignments = config.assignments?.assignments
&& Array.isArray(config.assignments.assignments)
&& config.assignments.assignments.length > 0;
const hasFields = hasFieldsViaValues || hasFieldsViaAssignments;
if (!hasFields && !config.jsonOutput) {
warnings.push({
type: 'missing_common',
message: 'Set node has no fields configured - will output empty items',
suggestion: 'Add fields in the Values section or use JSON mode'
suggestion: 'Add field assignments or use JSON mode'
});
}
}

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"workflow-validator.d.ts","sourceRoot":"","sources":["../../src/services/workflow-validator.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAiBtE,eAAO,MAAM,sBAAsB,aASjC,CAAC;AAEH,UAAU,YAAY;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,UAAU,EAAE,GAAG,CAAC;IAChB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,EAA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IAoCzB,OAAO,CAAC,2BAA2B;IA4EnC,OAAO,CAAC,QAAQ;IA4EhB,OAAO,CAAC,mBAAmB;IA4F3B,OAAO,CAAC,wBAAwB;IA2BhC,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,qBAAqB;IAgG7B,OAAO,CAAC,qBAAqB;IA8C7B,OAAO,CAAC,mBAAmB;IA4E3B,OAAO,CAAC,sBAAsB;IAyT9B,OAAO,CAAC,yBAAyB;IAqCjC,OAAO,CAAC,gCAAgC;IA8BxC,OAAO,CAAC,gCAAgC;IAsFxC,OAAO,CAAC,gBAAgB;IA4CxB,OAAO,CAAC,2BAA2B;CAmEpC"}

View File

@@ -14,6 +14,7 @@ const ai_node_validator_1 = require("./ai-node-validator");
const ai_tool_validators_1 = require("./ai-tool-validators");
const node_type_utils_1 = require("../utils/node-type-utils");
const node_classification_1 = require("../utils/node-classification");
const n8n_validation_1 = require("./n8n-validation");
const tool_variant_generator_1 = require("./tool-variant-generator");
const logger = new logger_1.Logger({ prefix: '[WorkflowValidator]' });
exports.VALID_CONNECTION_TYPES = new Set([
@@ -367,6 +368,17 @@ class WorkflowValidator {
message: typeof warning === 'string' ? warning : warning.message || String(warning)
});
});
if (node.type === 'n8n-nodes-base.if' || node.type === 'n8n-nodes-base.switch') {
const conditionErrors = (0, n8n_validation_1.validateConditionNodeStructure)(node);
for (const err of conditionErrors) {
result.errors.push({
type: 'error',
nodeId: node.id,
nodeName: node.name,
message: err
});
}
}
}
catch (error) {
result.errors.push({

File diff suppressed because one or more lines are too long

View File

@@ -2,6 +2,7 @@ export * from './node-types';
export * from './type-structures';
export * from './instance-context';
export * from './session-state';
export * from './generate-workflow';
export interface MCPServerConfig {
port: number;
host: string;

View File

@@ -1 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAA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AC;QAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,oBAAoB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACtD,CAAC;IAEF,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,KAAK,CAAC,EAAE;QACN,EAAE,CAAC,EAAE;YACH,WAAW,CAAC,EAAE,MAAM,CAAC;SACtB,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;CACJ"}

1
dist/types/index.js vendored
View File

@@ -18,4 +18,5 @@ __exportStar(require("./node-types"), exports);
__exportStar(require("./type-structures"), exports);
__exportStar(require("./instance-context"), exports);
__exportStar(require("./session-state"), exports);
__exportStar(require("./generate-workflow"), exports);
//# sourceMappingURL=index.js.map

View File

@@ -1 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,+CAA6B;AAC7B,oDAAkC;AAClC,qDAAmC;AACnC,kDAAgC"}
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,+CAA6B;AAC7B,oDAAkC;AAClC,qDAAmC;AACnC,kDAAgC;AAChC,sDAAoC"}

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "n8n-mcp",
"version": "2.41.3",
"version": "2.43.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "n8n-mcp",
"version": "2.41.3",
"version": "2.43.0",
"license": "MIT",
"dependencies": {
"@modelcontextprotocol/sdk": "1.28.0",

View File

@@ -1,6 +1,6 @@
{
"name": "n8n-mcp",
"version": "2.42.0",
"version": "2.43.0",
"description": "Integration between n8n workflow automation and Model Context Protocol (MCP)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -124,6 +124,7 @@
"dist/**/*",
"ui-apps/dist/**/*",
"data/nodes.db",
"data/workflow-patterns.json",
".env.example",
"README.md",
"LICENSE",

View File

@@ -343,10 +343,17 @@ export class CommunityNodeService {
const operations: any[] = [];
// Check properties for resource/operation pattern
// Nodes can have multiple operation properties, each mapped to a resource via displayOptions
if (nodeDesc.properties) {
for (const prop of nodeDesc.properties) {
if (prop.name === 'operation' && prop.options) {
operations.push(...prop.options);
if ((prop.name === 'operation' || prop.name === 'action') && prop.options) {
const resource = prop.displayOptions?.show?.resource?.[0];
for (const op of prop.options) {
operations.push({
...op,
...(resource ? { resource } : {})
});
}
}
}
}

View File

@@ -26,6 +26,7 @@ import {
} from './utils/protocol-version';
import { InstanceContext, validateInstanceContext } from './types/instance-context';
import { SessionState } from './types/session-state';
import { GenerateWorkflowHandler } from './types/generate-workflow';
import { closeSharedDatabase } from './database/shared-database';
dotenv.config();
@@ -97,6 +98,10 @@ function logSecurityEvent(
logger.info(`[SECURITY] ${event}`, logEntry);
}
export interface SingleSessionHTTPServerOptions {
generateWorkflowHandler?: GenerateWorkflowHandler;
}
export class SingleSessionHTTPServer {
// Map to store transports by session ID (following SDK pattern)
private transports: { [sessionId: string]: StreamableHTTPServerTransport } = {};
@@ -114,8 +119,10 @@ export class SingleSessionHTTPServer {
) * 60 * 1000;
private authToken: string | null = null;
private cleanupTimer: NodeJS.Timeout | null = null;
constructor() {
private generateWorkflowHandler?: GenerateWorkflowHandler;
constructor(options?: SingleSessionHTTPServerOptions) {
this.generateWorkflowHandler = options?.generateWorkflowHandler;
// Validate environment on construction
this.validateEnvironment();
// No longer pre-create session - will be created per initialize request following SDK pattern
@@ -565,8 +572,10 @@ export class SingleSessionHTTPServer {
sessionIdToUse = sessionId || uuidv4();
}
const server = new N8NDocumentationMCPServer(instanceContext);
const server = new N8NDocumentationMCPServer(instanceContext, undefined, {
generateWorkflowHandler: this.generateWorkflowHandler,
});
transport = new StreamableHTTPServerTransport({
sessionIdGenerator: () => sessionIdToUse,
onsessioninitialized: (initializedSessionId: string) => {
@@ -772,7 +781,9 @@ export class SingleSessionHTTPServer {
try {
// Create new session
logger.info('Creating new N8NDocumentationMCPServer for SSE...');
const server = new N8NDocumentationMCPServer();
const server = new N8NDocumentationMCPServer(undefined, undefined, {
generateWorkflowHandler: this.generateWorkflowHandler,
});
// Generate cryptographically secure session ID
const sessionId = uuidv4();

View File

@@ -21,6 +21,12 @@ export {
export type {
SessionState
} from './types/session-state';
export type {
GenerateWorkflowArgs,
GenerateWorkflowResult,
GenerateWorkflowHandler,
GenerateWorkflowHelpers
} from './types/generate-workflow';
// UI module exports
export type { UIAppConfig, UIMetadata } from './mcp/ui/types';

View File

@@ -10,6 +10,7 @@ import { SingleSessionHTTPServer } from './http-server-single-session';
import { logger } from './utils/logger';
import { InstanceContext } from './types/instance-context';
import { SessionState } from './types/session-state';
import { GenerateWorkflowHandler } from './types/generate-workflow';
export interface EngineHealth {
status: 'healthy' | 'unhealthy';
@@ -26,6 +27,7 @@ export interface EngineHealth {
export interface EngineOptions {
sessionTimeout?: number;
logLevel?: 'error' | 'warn' | 'info' | 'debug';
generateWorkflowHandler?: GenerateWorkflowHandler;
}
export class N8NMCPEngine {
@@ -33,9 +35,11 @@ export class N8NMCPEngine {
private startTime: Date;
constructor(options: EngineOptions = {}) {
this.server = new SingleSessionHTTPServer();
this.server = new SingleSessionHTTPServer({
generateWorkflowHandler: options.generateWorkflowHandler,
});
this.startTime = new Date();
if (options.logLevel) {
process.env.LOG_LEVEL = options.logLevel;
}

View File

@@ -41,6 +41,7 @@ import {
STANDARD_PROTOCOL_VERSION
} from '../utils/protocol-version';
import { InstanceContext } from '../types/instance-context';
import { GenerateWorkflowHandler, GenerateWorkflowHelpers } from '../types/generate-workflow';
import { telemetry } from '../telemetry';
import { EarlyErrorLogger } from '../telemetry/early-error-logger';
import { STARTUP_CHECKPOINTS } from '../telemetry/startup-checkpoints';
@@ -141,6 +142,10 @@ interface VersionComparisonInfo {
type NodeInfoResponse = NodeMinimalInfo | NodeStandardInfo | NodeFullInfo | VersionHistoryInfo | VersionComparisonInfo;
interface MCPServerOptions {
generateWorkflowHandler?: GenerateWorkflowHandler;
}
export class N8NDocumentationMCPServer {
private server: Server;
private db: DatabaseAdapter | null = null;
@@ -157,10 +162,12 @@ export class N8NDocumentationMCPServer {
private useSharedDatabase: boolean = false; // Track if using shared DB for cleanup
private sharedDbState: SharedDatabaseState | null = null; // Reference to shared DB state for release
private isShutdown: boolean = false; // Prevent double-shutdown
private generateWorkflowHandler?: GenerateWorkflowHandler;
constructor(instanceContext?: InstanceContext, earlyLogger?: EarlyErrorLogger) {
constructor(instanceContext?: InstanceContext, earlyLogger?: EarlyErrorLogger, options?: MCPServerOptions) {
this.instanceContext = instanceContext;
this.earlyLogger = earlyLogger || null;
this.generateWorkflowHandler = options?.generateWorkflowHandler;
// Check for test environment first
const envDbPath = process.env.NODE_DB_PATH;
let dbPath: string | null = null;
@@ -1531,6 +1538,57 @@ export class N8NDocumentationMCPServer {
}
}
case 'n8n_generate_workflow': {
this.validateToolParams(name, args, ['description']);
if (this.generateWorkflowHandler && this.instanceContext) {
await this.ensureInitialized();
if (!this.repository) {
throw new Error('Repository not initialized');
}
const repo = this.repository;
const ctx = this.instanceContext;
const helpers: GenerateWorkflowHelpers = {
createWorkflow: (wfArgs) =>
n8nHandlers.handleCreateWorkflow(wfArgs, ctx),
validateWorkflow: (id) =>
n8nHandlers.handleValidateWorkflow({ id }, repo, ctx),
autofixWorkflow: (id) =>
n8nHandlers.handleAutofixWorkflow({ id }, repo, ctx),
getWorkflow: (id) =>
n8nHandlers.handleGetWorkflow({ id }, ctx),
};
try {
const result = await this.generateWorkflowHandler(
{ description: args.description, skip_cache: args.skip_cache },
ctx,
helpers
);
return result ?? { success: false, error: 'Handler returned no result' };
} catch (err: any) {
const message = err instanceof Error ? err.message : String(err);
return { success: false, error: message };
}
}
// No handler and/or no instanceContext — self-hosted deployment
return {
hosted_only: true,
message: 'The n8n_generate_workflow tool is available exclusively on the hosted version of n8n-mcp. ' +
'It uses AI to generate complete, validated n8n workflows from natural language descriptions.\n\n' +
'To access this feature:\n' +
'1. Register for free at https://dashboard.n8n-mcp.com\n' +
'2. Connect your n8n instance\n' +
'3. Use your hosted API key in your MCP client\n\n' +
'The hosted service includes:\n' +
'- 73,000+ pre-built workflow templates with instant deployment\n' +
'- AI-powered fresh generation for custom workflows\n' +
'- Automatic validation and error correction'
};
}
default:
throw new Error(`Unknown tool: ${name}`);
}
@@ -3909,17 +3967,23 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
const patterns = this.workflowPatternsCache!;
if (category) {
// Return specific category pattern data
// Return specific category pattern data (trimmed for token efficiency)
const categoryData = patterns.categories[category];
if (!categoryData) {
const available = Object.keys(patterns.categories);
return { error: `Unknown category "${category}". Available: ${available.join(', ')}` };
}
const MAX_CHAINS = 5;
return {
category,
...categoryData,
nodes: categoryData.nodes?.slice(0, limit),
commonChains: categoryData.commonChains?.slice(0, limit),
templateCount: categoryData.templateCount,
pattern: categoryData.pattern,
nodes: categoryData.nodes?.slice(0, limit).map(n => ({
type: n.type, freq: n.frequency, role: n.role
})),
chains: categoryData.commonChains?.slice(0, MAX_CHAINS).map(c => ({
path: c.chain.map(t => t.split('.').pop() ?? t), count: c.count, freq: c.frequency
})),
};
}

View File

@@ -26,21 +26,16 @@ export const searchNodesDoc: ToolDocumentation = {
mode: { type: 'string', description: 'Search mode: "OR" (any word matches, default), "AND" (all words required), "FUZZY" (typo-tolerant)', required: false },
source: { type: 'string', description: 'Filter by node source: "all" (default, everything), "core" (n8n base nodes only), "community" (community nodes only), "verified" (verified community nodes only)', required: false },
includeExamples: { type: 'boolean', description: 'Include top 2 real-world configuration examples from popular templates for each node. Default: false. Adds ~200-400 tokens per node.', required: false },
includeOperations: { type: 'boolean', description: 'Include resource/operation tree per node. Default: false. Adds ~100-300 tokens per result but saves a get_node round-trip.', required: false }
includeOperations: { type: 'boolean', description: 'Include resource/operation tree per node. Default: false. Adds ~100-300 tokens per result but saves a get_node round-trip. Only returned for nodes with resource/operation patterns — trigger nodes and freeform nodes (Code, HTTP Request) omit this field.', required: false }
},
returns: 'Array of node objects sorted by relevance score. Each object contains: nodeType, displayName, description, category, relevance score. For community nodes, also includes: isCommunity (boolean), isVerified (boolean), authorName (string), npmDownloads (number). Common nodes appear first when relevance is similar.',
examples: [
'search_nodes({query: "webhook"}) - Returns Webhook node as top result',
'search_nodes({query: "database"}) - Returns MySQL, Postgres, MongoDB, Redis, etc.',
'search_nodes({query: "google sheets", mode: "AND"}) - Requires both words',
'search_nodes({query: "slak", mode: "FUZZY"}) - Finds Slack despite typo',
'search_nodes({query: "http api"}) - Finds HTTP Request, GraphQL, REST nodes',
'search_nodes({query: "transform data"}) - Finds Set, Code, Function, Item Lists nodes',
'search_nodes({query: "scraping", source: "community"}) - Find community scraping nodes',
'search_nodes({query: "pdf", source: "verified"}) - Find verified community PDF nodes',
'search_nodes({query: "brightdata"}) - Find BrightData community node',
'search_nodes({query: "slack", includeExamples: true}) - Get Slack with template examples',
'search_nodes({query: "slack", includeOperations: true}) - Get Slack with resource/operation tree'
'search_nodes({query: "slack", includeOperations: true}) - Get Slack with resource/operation tree (7 resources, 44 ops)'
],
useCases: [
'Finding nodes when you know partial names',

View File

@@ -23,7 +23,8 @@ import {
n8nExecutionsDoc,
n8nWorkflowVersionsDoc,
n8nDeployTemplateDoc,
n8nManageDatatableDoc
n8nManageDatatableDoc,
n8nGenerateWorkflowDoc
} from './workflow_management';
// Combine all tool documentations into a single object
@@ -62,7 +63,8 @@ export const toolsDocumentation: Record<string, ToolDocumentation> = {
n8n_executions: n8nExecutionsDoc,
n8n_workflow_versions: n8nWorkflowVersionsDoc,
n8n_deploy_template: n8nDeployTemplateDoc,
n8n_manage_datatable: n8nManageDatatableDoc
n8n_manage_datatable: n8nManageDatatableDoc,
n8n_generate_workflow: n8nGenerateWorkflowDoc
};
// Re-export types

View File

@@ -4,7 +4,7 @@ export const searchTemplatesDoc: ToolDocumentation = {
name: 'search_templates',
category: 'templates',
essentials: {
description: 'Unified template search with multiple modes: keyword search, by node types, by task type, or by metadata. 2,700+ templates available.',
description: 'Unified template search with multiple modes: keyword search, by node types, by task type, by metadata, or patterns. 2,700+ templates available.',
keyParameters: ['searchMode', 'query', 'nodeTypes', 'task', 'limit'],
example: 'search_templates({searchMode: "by_task", task: "webhook_processing"})',
performance: 'Fast (<100ms) - FTS5 full-text search',
@@ -12,7 +12,9 @@ export const searchTemplatesDoc: ToolDocumentation = {
'searchMode="keyword" (default): Search by name/description',
'searchMode="by_nodes": Find templates using specific nodes',
'searchMode="by_task": Get curated templates for common tasks',
'searchMode="by_metadata": Filter by complexity, services, audience'
'searchMode="by_metadata": Filter by complexity, services, audience',
'searchMode="patterns": Workflow pattern summaries across 10 task categories',
'patterns without task: overview of all categories. patterns with task: node frequencies + connection chains'
]
},
full: {
@@ -21,14 +23,15 @@ export const searchTemplatesDoc: ToolDocumentation = {
- by_nodes: Find templates that use specific node types
- by_task: Get curated templates for predefined task categories
- by_metadata: Filter by complexity, setup time, required services, or target audience
- patterns: Lightweight workflow pattern summaries mined from 2,700+ templates
**Available Task Types (for searchMode="by_task"):**
**Available Task Types (for searchMode="by_task" and "patterns"):**
ai_automation, data_sync, webhook_processing, email_automation, slack_integration, data_transformation, file_processing, scheduling, api_integration, database_operations`,
parameters: {
searchMode: {
type: 'string',
required: false,
description: 'Search mode: "keyword" (default), "by_nodes", "by_task", "by_metadata"'
description: 'Search mode: "keyword" (default), "by_nodes", "by_task", "by_metadata", "patterns"'
},
query: {
type: 'string',
@@ -43,7 +46,7 @@ ai_automation, data_sync, webhook_processing, email_automation, slack_integratio
task: {
type: 'string',
required: false,
description: 'For searchMode=by_task: Task type (ai_automation, data_sync, webhook_processing, email_automation, slack_integration, data_transformation, file_processing, scheduling, api_integration, database_operations)'
description: 'For searchMode=by_task: Task type. For searchMode=patterns: optional category filter (omit for overview of all categories). Values: ai_automation, data_sync, webhook_processing, email_automation, slack_integration, data_transformation, file_processing, scheduling, api_integration, database_operations'
},
complexity: {
type: 'string',
@@ -91,38 +94,45 @@ ai_automation, data_sync, webhook_processing, email_automation, slack_integratio
description: 'Pagination offset (default 0)'
}
},
returns: `Returns an object containing:
returns: `For keyword/by_nodes/by_task/by_metadata modes:
- templates: Array of matching templates
- id: Template ID for get_template()
- name: Template name
- description: What the workflow does
- author: Creator information
- nodes: Array of node types used
- views: Popularity metric
- created: Creation date
- url: Link to template
- metadata: AI-generated metadata (complexity, services, etc.)
- name, description, author, nodes, views, created, url, metadata
- totalFound: Total matching templates
- searchMode: The mode used`,
- searchMode: The mode used
For patterns mode (no task):
- templateCount, generatedAt
- categories: Array of {category, templateCount, pattern, topNodes}
- tip: How to drill into a specific category
For patterns mode (with task):
- category, templateCount, pattern
- nodes: Array of {type, freq, role} (top nodes by frequency, limited by 'limit')
- chains: Array of {path, count, freq} (top 5 connection chains, short node names)`,
examples: [
'// Keyword search (default)\nsearch_templates({query: "chatbot"})',
'// Find templates using specific nodes\nsearch_templates({searchMode: "by_nodes", nodeTypes: ["n8n-nodes-base.httpRequest", "n8n-nodes-base.slack"]})',
'// Get templates for a task type\nsearch_templates({searchMode: "by_task", task: "webhook_processing"})',
'// Filter by metadata\nsearch_templates({searchMode: "by_metadata", complexity: "simple", requiredService: "openai"})',
'// Combine metadata filters\nsearch_templates({searchMode: "by_metadata", maxSetupMinutes: 30, targetAudience: "developers"})'
'// Combine metadata filters\nsearch_templates({searchMode: "by_metadata", maxSetupMinutes: 30, targetAudience: "developers"})',
'// Pattern overview — all categories with top nodes (~550 tokens)\nsearch_templates({searchMode: "patterns"})',
'// Detailed patterns for a category — node frequencies + connection chains\nsearch_templates({searchMode: "patterns", task: "ai_automation"})'
],
useCases: [
'Find workflows by business purpose (keyword search)',
'Find templates using specific integrations (by_nodes)',
'Get pre-built solutions for common tasks (by_task)',
'Filter by complexity for team skill level (by_metadata)',
'Find templates requiring specific services (by_metadata)'
'Understand common workflow shapes before building (patterns)',
'Architecture planning — which nodes go together (patterns)'
],
performance: `Fast performance across all modes:
- keyword: <50ms with FTS5 indexing
- by_nodes: <100ms with indexed lookups
- by_task: <50ms from curated cache
- by_metadata: <100ms with filtered queries`,
- by_metadata: <100ms with filtered queries
- patterns: <10ms (pre-mined, cached in memory)`,
bestPractices: [
'Use searchMode="by_task" for common automation patterns',
'Use searchMode="by_nodes" when you know which integrations you need',

View File

@@ -11,3 +11,4 @@ export { n8nExecutionsDoc } from './n8n-executions';
export { n8nWorkflowVersionsDoc } from './n8n-workflow-versions';
export { n8nDeployTemplateDoc } from './n8n-deploy-template';
export { n8nManageDatatableDoc } from './n8n-manage-datatable';
export { n8nGenerateWorkflowDoc } from './n8n-generate-workflow';

View File

@@ -0,0 +1,62 @@
import { ToolDocumentation } from '../types';
export const n8nGenerateWorkflowDoc: ToolDocumentation = {
name: 'n8n_generate_workflow',
category: 'workflow_management',
essentials: {
description: 'Generate an n8n workflow from a natural language description using AI. Creates and deploys a ready-to-use workflow to your n8n instance.',
keyParameters: ['description', 'skip_cache'],
example: 'n8n_generate_workflow({description: "Send a Slack message every morning at 9am"})',
performance: 'Network-dependent (2-15s depending on cache hit vs fresh generation)',
tips: [
'Include trigger type (webhook, schedule, manual) in the description',
'Mention specific services to integrate (Slack, Gmail, Google Sheets, etc.)',
'Use skip_cache=true to force fresh AI generation instead of cached templates',
'Available exclusively on the hosted version of n8n-mcp'
]
},
full: {
description: 'Generates an n8n workflow from a natural language description using AI. On the hosted service, this tool first searches a cache of 73,000+ pre-built workflows for a match, and falls back to AI-powered fresh generation for custom workflows. Generated workflows are automatically validated and error-corrected before deployment. On self-hosted instances, this tool returns a message directing users to the hosted service.',
parameters: {
description: { type: 'string', required: true, description: 'Clear description of what the workflow should do. Include: trigger type (webhook, schedule, manual), services to integrate (Slack, Gmail, etc.), and the logic/flow.' },
skip_cache: { type: 'boolean', description: 'Set to true to bypass the workflow cache and force fresh AI generation. Default: false (uses cached workflows when a good match exists).' }
},
returns: 'Object with success, source (cache/generated), workflow_id, workflow_name, workflow_url, node_count, node_summary, and message. On self-hosted instances, returns hosted_only: true with information about the hosted service.',
examples: [
`// Generate a simple scheduled workflow
n8n_generate_workflow({
description: "Send a Slack message every morning at 9am with a daily standup reminder"
})`,
`// Generate with specific services
n8n_generate_workflow({
description: "When a new row is added to Google Sheets, create a task in Notion and notify via email"
})`,
`// Force fresh generation (skip cache)
n8n_generate_workflow({
description: "Webhook that receives JSON data, transforms it, and posts to a REST API",
skip_cache: true
})`
],
useCases: [
'Quickly create workflows from natural language descriptions',
'Generate complex multi-service integrations',
'Bootstrap automation projects with AI-generated workflows',
'Create workflows without deep knowledge of n8n node configuration'
],
performance: 'Cache hit: ~2s. Fresh generation: 5-15s. Both within typical MCP client timeout.',
bestPractices: [
'Be specific about trigger type and services in the description',
'Review generated workflows before activating',
'Use n8n_validate_workflow to check the generated workflow',
'Configure credentials in n8n UI before activating',
'Use skip_cache only when cached results do not match your needs'
],
pitfalls: [
'**Hosted-only feature** — self-hosted instances receive a redirect message',
'Generated workflows are created in INACTIVE state',
'Credentials must be configured manually in the n8n UI',
'Complex workflows may need manual adjustments after generation'
],
relatedTools: ['n8n_create_workflow', 'n8n_deploy_template', 'n8n_validate_workflow', 'n8n_autofix_workflow', 'search_templates']
}
};

View File

@@ -102,7 +102,7 @@ When working with Code nodes, always start by calling the relevant guide:
- validate_node({nodeType: "nodes-base.slack", config: {...}}) - Full validation with errors/warnings/suggestions
- validate_workflow({workflow: {...}}) - Validate entire workflow
## Tool Categories (19 Tools Total)
## Tool Categories (21 Tools Total)
**Discovery Tools** (1 tool)
- search_nodes - Full-text search across all nodes (supports OR, AND, FUZZY modes)
@@ -125,8 +125,9 @@ When working with Code nodes, always start by calling the relevant guide:
- searchMode='by_nodes': Find templates using specific nodes
- searchMode='by_task': Curated task-based templates
- searchMode='by_metadata': Filter by complexity/services
- searchMode='patterns': Workflow pattern summaries from 2,700+ templates
**n8n API Tools** (13 tools, requires N8N_API_URL configuration)
**n8n API Tools** (15 tools, requires N8N_API_URL configuration)
- n8n_create_workflow - Create new workflows
- n8n_get_workflow - Get workflow with mode='full'/'details'/'structure'/'minimal'
- n8n_update_full_workflow - Full workflow replacement
@@ -140,6 +141,8 @@ When working with Code nodes, always start by calling the relevant guide:
- n8n_health_check - Check n8n API connectivity
- n8n_workflow_versions - Version history and rollback
- n8n_deploy_template - Deploy templates directly to n8n instance
- n8n_manage_datatable - Manage data tables and rows
- n8n_generate_workflow - Generate workflow from natural language description
## Performance Characteristics
- Instant (<10ms): search_nodes, get_node (minimal/standard)

View File

@@ -654,4 +654,34 @@ export const n8nManagementTools: ToolDefinition[] = [
openWorldHint: true,
},
},
{
name: 'n8n_generate_workflow',
description: 'Generate an n8n workflow from a natural language description using AI. ' +
'Describe what the workflow should do (trigger type, services, logic) and this tool ' +
'will create and deploy a ready-to-use workflow to your n8n instance. ' +
'Set skip_cache=true to force fresh generation instead of using pre-built templates.',
inputSchema: {
type: 'object',
properties: {
description: {
type: 'string',
description: 'Clear description of what the workflow should do. Include: trigger type ' +
'(webhook, schedule, manual), services to integrate (Slack, Gmail, etc.), and the logic/flow.'
},
skip_cache: {
type: 'boolean',
description: 'Set to true to bypass the workflow cache and force fresh AI generation. ' +
'Default: false (uses cached workflows when a good match exists).'
}
},
required: ['description'],
},
annotations: {
title: 'Generate Workflow',
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: true,
},
},
];

View File

@@ -0,0 +1,32 @@
import { InstanceContext } from './instance-context';
export interface GenerateWorkflowArgs {
description: string;
skip_cache?: boolean;
}
export interface GenerateWorkflowResult {
success: boolean;
source?: 'cache' | 'generated';
workflow_id?: string;
workflow_name?: string;
workflow_url?: string;
node_count?: number;
node_summary?: string;
trigger_type?: string;
error?: string;
message?: string;
}
export type GenerateWorkflowHandler = (
args: GenerateWorkflowArgs,
context: InstanceContext,
helpers: GenerateWorkflowHelpers
) => Promise<GenerateWorkflowResult>;
export interface GenerateWorkflowHelpers {
createWorkflow(args: { name: string; nodes: any[]; connections: any }): Promise<any>;
validateWorkflow(workflowId: string): Promise<any>;
autofixWorkflow(workflowId: string): Promise<any>;
getWorkflow(workflowId: string): Promise<any>;
}

View File

@@ -3,6 +3,7 @@ export * from './node-types';
export * from './type-structures';
export * from './instance-context';
export * from './session-state';
export * from './generate-workflow';
export interface MCPServerConfig {
port: number;

View File

@@ -0,0 +1,90 @@
import { describe, it, expect, vi } from 'vitest';
import { n8nManagementTools } from '@/mcp/tools-n8n-manager';
import type {
GenerateWorkflowHandler,
GenerateWorkflowArgs,
GenerateWorkflowResult,
GenerateWorkflowHelpers,
} from '@/types/generate-workflow';
describe('n8n_generate_workflow', () => {
describe('tool definition', () => {
const tool = n8nManagementTools.find((t) => t.name === 'n8n_generate_workflow');
it('exists in n8nManagementTools', () => {
expect(tool).toBeDefined();
});
it('has correct input schema', () => {
expect(tool!.inputSchema.properties).toHaveProperty('description');
expect(tool!.inputSchema.properties).toHaveProperty('skip_cache');
expect(tool!.inputSchema.required).toEqual(['description']);
});
it('has correct annotations', () => {
expect(tool!.annotations).toEqual({
title: 'Generate Workflow',
readOnlyHint: false,
destructiveHint: false,
idempotentHint: false,
openWorldHint: true,
});
});
});
describe('types', () => {
it('GenerateWorkflowHandler accepts correct signature', () => {
const handler: GenerateWorkflowHandler = async (args, context, helpers) => {
return {
success: true,
source: 'generated',
workflow_id: '123',
workflow_name: 'Test',
message: 'Done',
};
};
expect(handler).toBeDefined();
});
it('GenerateWorkflowHelpers has required methods', () => {
const helpers: GenerateWorkflowHelpers = {
createWorkflow: vi.fn(),
validateWorkflow: vi.fn(),
autofixWorkflow: vi.fn(),
getWorkflow: vi.fn(),
};
expect(helpers.createWorkflow).toBeDefined();
expect(helpers.validateWorkflow).toBeDefined();
expect(helpers.autofixWorkflow).toBeDefined();
expect(helpers.getWorkflow).toBeDefined();
});
it('GenerateWorkflowResult supports both success and failure', () => {
const success: GenerateWorkflowResult = {
success: true,
source: 'cache',
workflow_id: 'abc',
workflow_name: 'Test',
workflow_url: 'https://example.com/workflow/abc',
node_summary: 'Trigger → HTTP Request → Slack',
};
expect(success.success).toBe(true);
const failure: GenerateWorkflowResult = {
success: false,
error: 'Generation failed',
message: 'Try again',
};
expect(failure.success).toBe(false);
});
it('GenerateWorkflowArgs has description and optional skip_cache', () => {
const minimal: GenerateWorkflowArgs = { description: 'test' };
expect(minimal.description).toBe('test');
expect(minimal.skip_cache).toBeUndefined();
const withSkip: GenerateWorkflowArgs = { description: 'test', skip_cache: true };
expect(withSkip.skip_cache).toBe(true);
});
});
});