mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-01-30 14:32:04 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce2c94c1a5 | ||
|
|
861005eeed | ||
|
|
7b0ff990ec | ||
|
|
25cb8bb455 |
@@ -37,9 +37,11 @@ MCP_SERVER_HOST=localhost
|
||||
# Server mode: stdio (local) or http (remote)
|
||||
MCP_MODE=stdio
|
||||
|
||||
# Use fixed HTTP implementation (recommended for stability)
|
||||
# Set to true to bypass StreamableHTTPServerTransport issues
|
||||
USE_FIXED_HTTP=true
|
||||
# DEPRECATED: USE_FIXED_HTTP is deprecated as of v2.31.8
|
||||
# The fixed HTTP implementation does not support SSE streaming required by
|
||||
# clients like OpenAI Codex. Use the default SingleSessionHTTPServer instead.
|
||||
# See: https://github.com/czlonkowski/n8n-mcp/issues/524
|
||||
# USE_FIXED_HTTP=true # DO NOT USE - deprecated
|
||||
|
||||
# HTTP Server Configuration (only used when MCP_MODE=http)
|
||||
PORT=3000
|
||||
|
||||
6881
CHANGELOG.md
6881
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,8 @@ ENV AUTH_TOKEN="REPLACE_THIS_AUTH_TOKEN_32_CHARS_MIN_abcdefgh"
|
||||
ENV NODE_ENV=production
|
||||
ENV IS_DOCKER=true
|
||||
ENV MCP_MODE=http
|
||||
ENV USE_FIXED_HTTP=true
|
||||
# NOTE: USE_FIXED_HTTP is deprecated. SingleSessionHTTPServer is now the default.
|
||||
# See: https://github.com/czlonkowski/n8n-mcp/issues/524
|
||||
ENV LOG_LEVEL=info
|
||||
ENV TRUST_PROXY=1
|
||||
ENV HOST=0.0.0.0
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
[](https://www.npmjs.com/package/n8n-mcp)
|
||||
[](https://codecov.io/gh/czlonkowski/n8n-mcp)
|
||||
[](https://github.com/czlonkowski/n8n-mcp/actions)
|
||||
[](https://github.com/n8n-io/n8n)
|
||||
[](https://github.com/n8n-io/n8n)
|
||||
[](https://github.com/czlonkowski/n8n-mcp/pkgs/container/n8n-mcp)
|
||||
[](https://railway.com/deploy/n8n-mcp?referralCode=n8n-mcp)
|
||||
|
||||
|
||||
BIN
data/nodes.db
BIN
data/nodes.db
Binary file not shown.
2
dist/mcp/tool-docs/templates/get-template.js
vendored
2
dist/mcp/tool-docs/templates/get-template.js
vendored
@@ -43,7 +43,7 @@ exports.getTemplateDoc = {
|
||||
- url: Link to template on n8n.io
|
||||
- workflow: Complete workflow JSON with structure:
|
||||
- nodes: Array of node objects (id, name, type, typeVersion, position, parameters)
|
||||
- connections: Object mapping source nodes to targets
|
||||
- connections: Object mapping source node names to targets
|
||||
- settings: Workflow configuration (timezone, error handling, etc.)
|
||||
- usage: Instructions for using the workflow`,
|
||||
examples: [
|
||||
|
||||
@@ -21,7 +21,7 @@ exports.n8nCreateWorkflowDoc = {
|
||||
parameters: {
|
||||
name: { type: 'string', required: true, description: 'Workflow name' },
|
||||
nodes: { type: 'array', required: true, description: 'Array of nodes with id, name, type, typeVersion, position, parameters' },
|
||||
connections: { type: 'object', required: true, description: 'Node connections. Keys are source node IDs' },
|
||||
connections: { type: 'object', required: true, description: 'Node connections. Keys are source node names (not IDs)' },
|
||||
settings: { type: 'object', description: 'Optional workflow settings (timezone, error handling, etc.)' }
|
||||
},
|
||||
returns: 'Minimal summary (id, name, active, nodeCount) for token efficiency. Use n8n_get_workflow with mode "structure" to verify current state if needed.',
|
||||
@@ -56,8 +56,8 @@ n8n_create_workflow({
|
||||
}
|
||||
],
|
||||
connections: {
|
||||
"webhook_1": {
|
||||
"main": [[{node: "slack_1", type: "main", index: 0}]]
|
||||
"Webhook": {
|
||||
"main": [[{node: "Slack", type: "main", index: 0}]]
|
||||
}
|
||||
}
|
||||
})`,
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"n8n-create-workflow.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/n8n-create-workflow.ts"],"names":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QACD,YAAY,EAAE,CAAC,mBAAmB,EAAE,6BAA6B,EAAE,mBAAmB,CAAC;KACxF;CACF,CAAC"}
|
||||
{"version":3,"file":"n8n-create-workflow.js","sourceRoot":"","sources":["../../../../src/mcp/tool-docs/workflow_management/n8n-create-workflow.ts"],"names":[],"mappings":";;;AAEa,QAAA,oBAAoB,GAAsB;IACrD,IAAI,EAAE,qBAAqB;IAC3B,QAAQ,EAAE,qBAAqB;IAC/B,UAAU,EAAE;QACV,WAAW,EAAE,sGAAsG;QACnH,aAAa,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC;QAC/C,OAAO,EAAE,0EAA0E;QACnF,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE;YACJ,2BAA2B;YAC3B,+BAA+B;YAC/B,uCAAuC;YACvC,kFAAkF;SACnF;KACF;IACD,IAAI,EAAE;QACJ,WAAW,EAAE,uLAAuL;QACpM,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE;YACtE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,uEAAuE,EAAE;YAC9H,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,wDAAwD,EAAE;YACtH,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6DAA6D,EAAE;SACzG;QACD,OAAO,EAAE,mJAAmJ;QAC5J,QAAQ,EAAE;YACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCH;YACG;;;;;;;;;;;GAWH;SACE;QACD,QAAQ,EAAE;YACR,4BAA4B;YAC5B,4BAA4B;YAC5B,2BAA2B;YAC3B,qBAAqB;SACtB;QACD,WAAW,EAAE,oEAAoE;QACjF,aAAa,EAAE;YACb,uCAAuC;YACvC,qBAAqB;YACrB,gCAAgC;YAChC,6BAA6B;SAC9B;QACD,QAAQ,EAAE;YACR,0GAA0G;YAC1G,gEAAgE;YAChE,yCAAyC;YACzC,kDAAkD;YAClD,4EAA4E;YAC5E,yIAAyI;YACzI,uIAAuI;SACxI;QACD,YAAY,EAAE,CAAC,mBAAmB,EAAE,6BAA6B,EAAE,mBAAmB,CAAC;KACxF;CACF,CAAC"}
|
||||
2
dist/mcp/tools-n8n-manager.d.ts.map
vendored
2
dist/mcp/tools-n8n-manager.d.ts.map
vendored
@@ -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,EAogB9C,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,EAqlB9C,CAAC"}
|
||||
109
dist/mcp/tools-n8n-manager.js
vendored
109
dist/mcp/tools-n8n-manager.js
vendored
@@ -42,7 +42,7 @@ exports.n8nManagementTools = [
|
||||
},
|
||||
connections: {
|
||||
type: 'object',
|
||||
description: 'Workflow connections object. Keys are source node IDs, values define output connections'
|
||||
description: 'Workflow connections object. Keys are source node names (the name field, not id), values define output connections'
|
||||
},
|
||||
settings: {
|
||||
type: 'object',
|
||||
@@ -60,7 +60,13 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['name', 'nodes', 'connections']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Create Workflow',
|
||||
readOnlyHint: false,
|
||||
destructiveHint: false,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_get_workflow',
|
||||
@@ -80,7 +86,13 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['id']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Get Workflow',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_update_full_workflow',
|
||||
@@ -114,7 +126,14 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['id']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Update Full Workflow',
|
||||
readOnlyHint: false,
|
||||
destructiveHint: false,
|
||||
idempotentHint: true,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_update_partial_workflow',
|
||||
@@ -145,7 +164,14 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['id', 'operations']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Update Partial Workflow',
|
||||
readOnlyHint: false,
|
||||
destructiveHint: false,
|
||||
idempotentHint: true,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_delete_workflow',
|
||||
@@ -159,7 +185,13 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['id']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Delete Workflow',
|
||||
readOnlyHint: false,
|
||||
destructiveHint: true,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_list_workflows',
|
||||
@@ -193,7 +225,13 @@ exports.n8nManagementTools = [
|
||||
description: 'Exclude pinned data from response (default: true)'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'List Workflows',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_validate_workflow',
|
||||
@@ -230,7 +268,13 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['id']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Validate Workflow',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_autofix_workflow',
|
||||
@@ -265,7 +309,14 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['id']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Autofix Workflow',
|
||||
readOnlyHint: false,
|
||||
destructiveHint: false,
|
||||
idempotentHint: true,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_test_workflow',
|
||||
@@ -317,7 +368,13 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['workflowId']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Test Workflow',
|
||||
readOnlyHint: false,
|
||||
destructiveHint: false,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_executions',
|
||||
@@ -395,7 +452,13 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['action']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Manage Executions',
|
||||
readOnlyHint: false,
|
||||
destructiveHint: true,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_health_check',
|
||||
@@ -414,7 +477,13 @@ exports.n8nManagementTools = [
|
||||
description: 'Include extra details in diagnostic mode (default: false)'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Health Check',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_workflow_versions',
|
||||
@@ -468,7 +537,13 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['mode']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Workflow Versions',
|
||||
readOnlyHint: false,
|
||||
destructiveHint: true,
|
||||
openWorldHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'n8n_deploy_template',
|
||||
@@ -501,7 +576,13 @@ exports.n8nManagementTools = [
|
||||
}
|
||||
},
|
||||
required: ['templateId']
|
||||
}
|
||||
},
|
||||
annotations: {
|
||||
title: 'Deploy Template',
|
||||
readOnlyHint: false,
|
||||
destructiveHint: false,
|
||||
openWorldHint: true,
|
||||
},
|
||||
}
|
||||
];
|
||||
//# sourceMappingURL=tools-n8n-manager.js.map
|
||||
2
dist/mcp/tools-n8n-manager.js.map
vendored
2
dist/mcp/tools-n8n-manager.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/mcp/tools.d.ts.map
vendored
2
dist/mcp/tools.d.ts.map
vendored
@@ -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,EA+XtD,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,EAkatD,CAAC"}
|
||||
35
dist/mcp/tools.js
vendored
35
dist/mcp/tools.js
vendored
@@ -20,6 +20,11 @@ exports.n8nDocumentationToolsFinal = [
|
||||
},
|
||||
},
|
||||
},
|
||||
annotations: {
|
||||
title: 'Tools Documentation',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'search_nodes',
|
||||
@@ -50,6 +55,11 @@ exports.n8nDocumentationToolsFinal = [
|
||||
},
|
||||
required: ['query'],
|
||||
},
|
||||
annotations: {
|
||||
title: 'Search Nodes',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'get_node',
|
||||
@@ -103,6 +113,11 @@ exports.n8nDocumentationToolsFinal = [
|
||||
},
|
||||
required: ['nodeType'],
|
||||
},
|
||||
annotations: {
|
||||
title: 'Get Node Info',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'validate_node',
|
||||
@@ -183,6 +198,11 @@ exports.n8nDocumentationToolsFinal = [
|
||||
},
|
||||
required: ['nodeType', 'displayName', 'valid']
|
||||
},
|
||||
annotations: {
|
||||
title: 'Validate Node Config',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'get_template',
|
||||
@@ -203,6 +223,11 @@ exports.n8nDocumentationToolsFinal = [
|
||||
},
|
||||
required: ['templateId'],
|
||||
},
|
||||
annotations: {
|
||||
title: 'Get Template',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'search_templates',
|
||||
@@ -293,6 +318,11 @@ exports.n8nDocumentationToolsFinal = [
|
||||
},
|
||||
},
|
||||
},
|
||||
annotations: {
|
||||
title: 'Search Templates',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'validate_workflow',
|
||||
@@ -378,6 +408,11 @@ exports.n8nDocumentationToolsFinal = [
|
||||
},
|
||||
required: ['valid', 'summary']
|
||||
},
|
||||
annotations: {
|
||||
title: 'Validate Workflow',
|
||||
readOnlyHint: true,
|
||||
idempotentHint: true,
|
||||
},
|
||||
},
|
||||
];
|
||||
//# sourceMappingURL=tools.js.map
|
||||
2
dist/mcp/tools.js.map
vendored
2
dist/mcp/tools.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"node-similarity-service.d.ts","sourceRoot":"","sources":["../../src/services/node-similarity-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,qBAAqB;IAEhC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAM;IAC/C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAK;IAC/C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAK;IAChD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAiB;IAC1D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAO;IAElD,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,cAAc,CAAsC;IAC5D,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,YAAY,CAAa;gBAErB,UAAU,EAAE,cAAc;IAStC,OAAO,CAAC,wBAAw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M,CAAC;CAChB;AAED,qBAAa,qBAAqB;IAEhC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAM;IAC/C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAK;IAC/C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAK;IAChD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAiB;IAC1D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAO;IAElD,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,cAAc,CAAsC;IAC5D,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,YAAY,CAAa;gBAErB,UAAU,EAAE,cAAc;IAStC,OAAO,CAAC,wBAAwB;IAkDhC,OAAO,CAAC,yBAAyB;IAuB3B,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAiEzF,OAAO,CAAC,mBAAmB;IA0E3B,OAAO,CAAC,wBAAwB;IAuEhC,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,mBAAmB;IAgB3B,OAAO,CAAC,eAAe;YAgDT,cAAc;IAqCrB,eAAe,IAAI,IAAI;IAUjB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ1C,uBAAuB,CAAC,WAAW,EAAE,cAAc,EAAE,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM;IA8BnF,aAAa,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO;IAQlD,UAAU,IAAI,IAAI;CAGnB"}
|
||||
17
dist/services/node-similarity-service.js
vendored
17
dist/services/node-similarity-service.js
vendored
@@ -2,6 +2,7 @@
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.NodeSimilarityService = void 0;
|
||||
const logger_1 = require("../utils/logger");
|
||||
const tool_variant_generator_1 = require("./tool-variant-generator");
|
||||
class NodeSimilarityService {
|
||||
constructor(repository) {
|
||||
this.nodeCache = null;
|
||||
@@ -67,6 +68,22 @@ class NodeSimilarityService {
|
||||
if (!invalidType || invalidType.trim() === '') {
|
||||
return [];
|
||||
}
|
||||
if (tool_variant_generator_1.ToolVariantGenerator.isToolVariantNodeType(invalidType)) {
|
||||
const baseNodeType = tool_variant_generator_1.ToolVariantGenerator.getBaseNodeType(invalidType);
|
||||
if (baseNodeType) {
|
||||
const baseNode = this.repository.getNode(baseNodeType);
|
||||
if (baseNode) {
|
||||
return [{
|
||||
nodeType: invalidType,
|
||||
displayName: `${baseNode.displayName} Tool`,
|
||||
confidence: 0.98,
|
||||
reason: `Dynamic AI Tool variant of ${baseNode.displayName}`,
|
||||
category: baseNode.category,
|
||||
description: 'Runtime-generated Tool variant for AI Agent integration'
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
const suggestions = [];
|
||||
const mistakeSuggestion = this.checkCommonMistakes(invalidType);
|
||||
if (mistakeSuggestion) {
|
||||
|
||||
2
dist/services/node-similarity-service.js.map
vendored
2
dist/services/node-similarity-service.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/services/workflow-validator.d.ts.map
vendored
2
dist/services/workflow-validator.d.ts.map
vendored
@@ -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;AAatE,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,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;YAkInB,gBAAgB;IAmO9B,OAAO,CAAC,mBAAmB;IA8H3B,OAAO,CAAC,yBAAyB;IAgGjC,OAAO,CAAC,gCAAgC;IAoFxC,OAAO,CAAC,wBAAwB;IAsChC,OAAO,CAAC,oBAAoB;IAuE5B,OAAO,CAAC,QAAQ;IAsFhB,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"}
|
||||
29
dist/services/workflow-validator.js
vendored
29
dist/services/workflow-validator.js
vendored
@@ -236,7 +236,31 @@ class WorkflowValidator {
|
||||
}
|
||||
}
|
||||
const normalizedType = node_type_normalizer_1.NodeTypeNormalizer.normalizeToFullForm(node.type);
|
||||
const nodeInfo = this.nodeRepository.getNode(normalizedType);
|
||||
let nodeInfo = this.nodeRepository.getNode(normalizedType);
|
||||
if (!nodeInfo && tool_variant_generator_1.ToolVariantGenerator.isToolVariantNodeType(normalizedType)) {
|
||||
const baseNodeType = tool_variant_generator_1.ToolVariantGenerator.getBaseNodeType(normalizedType);
|
||||
if (baseNodeType) {
|
||||
const baseNodeInfo = this.nodeRepository.getNode(baseNodeType);
|
||||
if (baseNodeInfo) {
|
||||
result.warnings.push({
|
||||
type: 'warning',
|
||||
nodeId: node.id,
|
||||
nodeName: node.name,
|
||||
message: `Node type "${node.type}" is inferred as a dynamic AI Tool variant of "${baseNodeType}". ` +
|
||||
`This Tool variant is created by n8n at runtime when connecting "${baseNodeInfo.displayName}" to an AI Agent.`,
|
||||
code: 'INFERRED_TOOL_VARIANT'
|
||||
});
|
||||
nodeInfo = {
|
||||
...baseNodeInfo,
|
||||
nodeType: normalizedType,
|
||||
displayName: `${baseNodeInfo.displayName} Tool`,
|
||||
isToolVariant: true,
|
||||
toolVariantOf: baseNodeType,
|
||||
isInferred: true
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!nodeInfo) {
|
||||
const suggestions = await this.similarityService.findSimilarNodes(node.type, 3);
|
||||
let message = `Unknown node type: "${node.type}".`;
|
||||
@@ -310,6 +334,9 @@ class WorkflowValidator {
|
||||
if (normalizedType.startsWith('nodes-langchain.')) {
|
||||
continue;
|
||||
}
|
||||
if (nodeInfo.isInferred) {
|
||||
continue;
|
||||
}
|
||||
const paramsWithVersion = {
|
||||
'@version': node.typeVersion || 1,
|
||||
...node.parameters
|
||||
|
||||
2
dist/services/workflow-validator.js.map
vendored
2
dist/services/workflow-validator.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/telemetry/batch-processor.d.ts.map
vendored
2
dist/telemetry/batch-processor.d.ts.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"batch-processor.d.ts","sourceRoot":"","sources":["../../src/telemetry/batch-processor.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,sBAAsB,EAAoB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAyBlI,qBAAa,uBAAuB;IAoBhC,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,SAAS;IApBnB,OAAO,CAAC,UAAU,CAAC,CAAiB;IACpC,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,mBAAmB,CAAkB;IAC7C,OAAO,CAAC,mBAAmB,CAAkB;IAC7C,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,OAAO,CAQb;IACF,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,eAAe,CAAuE;IAC9F,OAAO,CAAC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AiB,CAAO;gBAG/B,QAAQ,EAAE,cAAc,GAAG,IAAI,EAC/B,SAAS,EAAE,MAAM,OAAO;IAQlC,KAAK,IAAI,IAAI;IA+Bb,IAAI,IAAI,IAAI;IAWN,KAAK,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,EAAE,SAAS,CAAC,EAAE,iBAAiB,EAAE,EAAE,SAAS,CAAC,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;YAgD9G,WAAW;YAmDX,cAAc;YAuDd,cAAc;YAiEd,gBAAgB;IAgD9B,OAAO,CAAC,aAAa;IAarB,OAAO,CAAC,oBAAoB;IAiB5B,OAAO,CAAC,oBAAoB;YAmBd,sBAAsB;IAgCpC,OAAO,CAAC,eAAe;IAiBvB,UAAU,IAAI,gBAAgB,GAAG;QAAE,mBAAmB,EAAE,GAAG,CAAC;QAAC,mBAAmB,EAAE,MAAM,CAAA;KAAE;IAW1F,YAAY,IAAI,IAAI;CAarB"}
|
||||
20
dist/telemetry/batch-processor.js
vendored
20
dist/telemetry/batch-processor.js
vendored
@@ -4,19 +4,13 @@ exports.TelemetryBatchProcessor = void 0;
|
||||
const telemetry_types_1 = require("./telemetry-types");
|
||||
const telemetry_error_1 = require("./telemetry-error");
|
||||
const logger_1 = require("../utils/logger");
|
||||
function toSnakeCase(obj) {
|
||||
if (obj === null || obj === undefined)
|
||||
return obj;
|
||||
if (Array.isArray(obj))
|
||||
return obj.map(toSnakeCase);
|
||||
if (typeof obj !== 'object')
|
||||
return obj;
|
||||
function keyToSnakeCase(key) {
|
||||
return key.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);
|
||||
}
|
||||
function mutationToSupabaseFormat(mutation) {
|
||||
const result = {};
|
||||
for (const key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
const snakeKey = key.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`);
|
||||
result[snakeKey] = toSnakeCase(obj[key]);
|
||||
}
|
||||
for (const [key, value] of Object.entries(mutation)) {
|
||||
result[keyToSnakeCase(key)] = value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -185,7 +179,7 @@ class TelemetryBatchProcessor {
|
||||
const batches = this.createBatches(mutations, telemetry_types_1.TELEMETRY_CONFIG.MAX_BATCH_SIZE);
|
||||
for (const batch of batches) {
|
||||
const result = await this.executeWithRetry(async () => {
|
||||
const snakeCaseBatch = batch.map(mutation => toSnakeCase(mutation));
|
||||
const snakeCaseBatch = batch.map(mutation => mutationToSupabaseFormat(mutation));
|
||||
const { error } = await this.supabase
|
||||
.from('workflow_mutations')
|
||||
.insert(snakeCaseBatch);
|
||||
|
||||
2
dist/telemetry/batch-processor.js.map
vendored
2
dist/telemetry/batch-processor.js.map
vendored
File diff suppressed because one or more lines are too long
8
dist/types/index.d.ts
vendored
8
dist/types/index.d.ts
vendored
@@ -7,6 +7,13 @@ export interface MCPServerConfig {
|
||||
host: string;
|
||||
authToken?: string;
|
||||
}
|
||||
export interface ToolAnnotations {
|
||||
title?: string;
|
||||
readOnlyHint?: boolean;
|
||||
destructiveHint?: boolean;
|
||||
idempotentHint?: boolean;
|
||||
openWorldHint?: boolean;
|
||||
}
|
||||
export interface ToolDefinition {
|
||||
name: string;
|
||||
description: string;
|
||||
@@ -22,6 +29,7 @@ export interface ToolDefinition {
|
||||
required?: string[];
|
||||
additionalProperties?: boolean | Record<string, any>;
|
||||
};
|
||||
annotations?: ToolAnnotations;
|
||||
}
|
||||
export interface ResourceDefinition {
|
||||
uri: string;
|
||||
|
||||
2
dist/types/index.d.ts.map
vendored
2
dist/types/index.d.ts.map
vendored
@@ -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,cAAc,iBAAiB,CAAC;AAEhC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MA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B,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"}
|
||||
@@ -12,7 +12,8 @@ services:
|
||||
environment:
|
||||
# Mode configuration
|
||||
MCP_MODE: ${MCP_MODE:-http}
|
||||
USE_FIXED_HTTP: ${USE_FIXED_HTTP:-true} # Use fixed implementation for stability
|
||||
# NOTE: USE_FIXED_HTTP is deprecated. SingleSessionHTTPServer is now the default.
|
||||
# See: https://github.com/czlonkowski/n8n-mcp/issues/524
|
||||
AUTH_TOKEN: ${AUTH_TOKEN:?AUTH_TOKEN is required for HTTP mode}
|
||||
|
||||
# Application settings
|
||||
|
||||
@@ -21,7 +21,6 @@ cd n8n-mcp
|
||||
# Create .env file with auth token
|
||||
cat > .env << EOF
|
||||
AUTH_TOKEN=$(openssl rand -base64 32)
|
||||
USE_FIXED_HTTP=true
|
||||
EOF
|
||||
|
||||
# Start the server
|
||||
@@ -46,7 +45,6 @@ docker pull ghcr.io/czlonkowski/n8n-mcp:latest
|
||||
docker run -d \
|
||||
--name n8n-mcp \
|
||||
-e MCP_MODE=http \
|
||||
-e USE_FIXED_HTTP=true \
|
||||
-e AUTH_TOKEN=your-secure-token \
|
||||
-p 3000:3000 \
|
||||
ghcr.io/czlonkowski/n8n-mcp:latest
|
||||
|
||||
@@ -67,7 +67,6 @@ Claude Desktop → mcp-remote → https://your-server.com
|
||||
# 1. Create environment file
|
||||
cat > .env << EOF
|
||||
AUTH_TOKEN=$(openssl rand -base64 32)
|
||||
USE_FIXED_HTTP=true
|
||||
MCP_MODE=http
|
||||
PORT=3000
|
||||
# Optional: Enable n8n management tools
|
||||
@@ -106,7 +105,6 @@ npm run rebuild
|
||||
|
||||
# 2. Configure environment
|
||||
export MCP_MODE=http
|
||||
export USE_FIXED_HTTP=true # Important: Use fixed implementation
|
||||
export AUTH_TOKEN=$(openssl rand -base64 32)
|
||||
export PORT=3000
|
||||
|
||||
@@ -144,7 +142,6 @@ Skip HTTP entirely and use stdio mode directly:
|
||||
| Variable | Description | Example |
|
||||
|----------|-------------|------|
|
||||
| `MCP_MODE` | Must be set to `http` | `http` |
|
||||
| `USE_FIXED_HTTP` | **Important**: Set to `true` for stable implementation | `true` |
|
||||
| `AUTH_TOKEN` or `AUTH_TOKEN_FILE` | Authentication method | See security section |
|
||||
|
||||
### Optional Settings
|
||||
@@ -417,7 +414,6 @@ services:
|
||||
environment:
|
||||
# Core configuration
|
||||
MCP_MODE: http
|
||||
USE_FIXED_HTTP: true
|
||||
NODE_ENV: production
|
||||
|
||||
# Security - Using file-based secret
|
||||
@@ -500,7 +496,6 @@ WorkingDirectory=/opt/n8n-mcp
|
||||
# Use file-based secret
|
||||
Environment="AUTH_TOKEN_FILE=/etc/n8n-mcp/auth_token"
|
||||
Environment="MCP_MODE=http"
|
||||
Environment="USE_FIXED_HTTP=true"
|
||||
Environment="NODE_ENV=production"
|
||||
Environment="TRUST_PROXY=1"
|
||||
Environment="BASE_URL=https://n8n-mcp.example.com"
|
||||
@@ -772,8 +767,8 @@ sudo ufw status # Linux
|
||||
```
|
||||
|
||||
**"Stream is not readable":**
|
||||
- Ensure `USE_FIXED_HTTP=true` is set
|
||||
- Fixed in v2.3.2+
|
||||
- This issue was fixed in v2.3.2+ with the SingleSessionHTTPServer
|
||||
- No additional configuration needed
|
||||
|
||||
**Bridge script not working:**
|
||||
```bash
|
||||
|
||||
@@ -18,7 +18,6 @@ The fastest way to get n8n-MCP running:
|
||||
# Using Docker (recommended)
|
||||
cat > .env << EOF
|
||||
AUTH_TOKEN=$(openssl rand -base64 32)
|
||||
USE_FIXED_HTTP=true
|
||||
EOF
|
||||
docker compose up -d
|
||||
```
|
||||
@@ -49,7 +48,6 @@ docker compose up -d
|
||||
|
||||
environment:
|
||||
MCP_MODE: ${MCP_MODE:-http}
|
||||
USE_FIXED_HTTP: ${USE_FIXED_HTTP:-true}
|
||||
AUTH_TOKEN: ${AUTH_TOKEN:?AUTH_TOKEN is required}
|
||||
NODE_ENV: ${NODE_ENV:-production}
|
||||
LOG_LEVEL: ${LOG_LEVEL:-info}
|
||||
|
||||
@@ -98,7 +98,6 @@ These are automatically set by the Railway template:
|
||||
|----------|--------------|-------------|
|
||||
| `AUTH_TOKEN` | `REPLACE_THIS...` | **⚠️ CHANGE IMMEDIATELY** |
|
||||
| `MCP_MODE` | `http` | Required for cloud deployment |
|
||||
| `USE_FIXED_HTTP` | `true` | Stable HTTP implementation |
|
||||
| `NODE_ENV` | `production` | Production optimizations |
|
||||
| `LOG_LEVEL` | `info` | Balanced logging |
|
||||
| `TRUST_PROXY` | `1` | Railway runs behind proxy |
|
||||
|
||||
@@ -40,7 +40,6 @@ Key configuration options:
|
||||
| Variable | Description | Default |
|
||||
|----------|-------------|---------|
|
||||
| `MCP_MODE` | Server mode: `stdio` or `http` | `stdio` |
|
||||
| `USE_FIXED_HTTP` | Use fixed HTTP implementation (v2.3.2+) | `true` |
|
||||
| `AUTH_TOKEN` | Authentication token for HTTP mode | Required |
|
||||
| `PORT` | HTTP server port | `3000` |
|
||||
| `LOG_LEVEL` | Logging verbosity | `info` |
|
||||
|
||||
601
package-lock.json
generated
601
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "n8n-mcp",
|
||||
"version": "2.31.5",
|
||||
"version": "2.31.9",
|
||||
"description": "Integration between n8n workflow automation and Model Context Protocol (MCP)",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
@@ -22,9 +22,9 @@
|
||||
"test-nodes": "node dist/scripts/test-nodes.js",
|
||||
"start": "node dist/mcp/index.js",
|
||||
"start:http": "MCP_MODE=http node dist/mcp/index.js",
|
||||
"start:http:fixed": "MCP_MODE=http USE_FIXED_HTTP=true node dist/mcp/index.js",
|
||||
"start:http:fixed:deprecated": "echo 'DEPRECATED: USE_FIXED_HTTP is deprecated. Use npm run start:http instead.' && MCP_MODE=http USE_FIXED_HTTP=true node dist/mcp/index.js",
|
||||
"start:n8n": "N8N_MODE=true MCP_MODE=http node dist/mcp/index.js",
|
||||
"http": "npm run build && npm run start:http:fixed",
|
||||
"http": "npm run build && npm run start:http",
|
||||
"dev": "npm run build && npm run rebuild && npm run validate",
|
||||
"dev:http": "MCP_MODE=http nodemon --watch src --ext ts --exec 'npm run build && npm run start:http'",
|
||||
"test:single-session": "./scripts/test-single-session.sh",
|
||||
@@ -141,16 +141,16 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@modelcontextprotocol/sdk": "1.20.1",
|
||||
"@n8n/n8n-nodes-langchain": "^2.1.3",
|
||||
"@n8n/n8n-nodes-langchain": "^2.2.2",
|
||||
"@supabase/supabase-js": "^2.57.4",
|
||||
"dotenv": "^16.5.0",
|
||||
"express": "^5.1.0",
|
||||
"express-rate-limit": "^7.1.5",
|
||||
"form-data": "^4.0.5",
|
||||
"lru-cache": "^11.2.1",
|
||||
"n8n": "^2.1.4",
|
||||
"n8n-core": "^2.1.3",
|
||||
"n8n-workflow": "^2.1.1",
|
||||
"n8n": "^2.2.3",
|
||||
"n8n-core": "^2.2.2",
|
||||
"n8n-workflow": "^2.2.2",
|
||||
"openai": "^4.77.0",
|
||||
"sql.js": "^1.13.0",
|
||||
"tslib": "^2.6.2",
|
||||
|
||||
@@ -71,10 +71,12 @@ const testCases: TestCase[] = [
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Fixed HTTP implementation',
|
||||
// DEPRECATED: This test case tests the deprecated fixed HTTP implementation
|
||||
// See: https://github.com/czlonkowski/n8n-mcp/issues/524
|
||||
name: 'Fixed HTTP implementation (DEPRECATED)',
|
||||
env: {
|
||||
MCP_MODE: 'http',
|
||||
USE_FIXED_HTTP: 'true',
|
||||
USE_FIXED_HTTP: 'true', // DEPRECATED: Will be removed in future version
|
||||
AUTH_TOKEN: 'test-token-for-testing-only',
|
||||
PORT: '3005',
|
||||
BASE_URL: 'https://fixed.example.com'
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Fixed HTTP server for n8n-MCP that properly handles StreamableHTTPServerTransport initialization
|
||||
* This implementation ensures the transport is properly initialized before handling requests
|
||||
* @deprecated This fixed HTTP server is deprecated as of v2.31.8.
|
||||
* Use SingleSessionHTTPServer from http-server-single-session.ts instead.
|
||||
*
|
||||
* This implementation does not support SSE streaming required by clients like OpenAI Codex.
|
||||
* See: https://github.com/czlonkowski/n8n-mcp/issues/524
|
||||
*
|
||||
* Original purpose: Fixed HTTP server for n8n-MCP that properly handles
|
||||
* StreamableHTTPServerTransport initialization by bypassing it entirely.
|
||||
* This implementation ensures the transport is properly initialized before handling requests.
|
||||
*/
|
||||
import express from 'express';
|
||||
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
||||
@@ -125,7 +132,18 @@ async function shutdown() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use SingleSessionHTTPServer from http-server-single-session.ts instead.
|
||||
* This function does not support SSE streaming required by clients like OpenAI Codex.
|
||||
*/
|
||||
export async function startFixedHTTPServer() {
|
||||
// Log deprecation warning
|
||||
logger.warn(
|
||||
'DEPRECATION: startFixedHTTPServer() is deprecated as of v2.31.8. ' +
|
||||
'Use SingleSessionHTTPServer which supports SSE streaming. ' +
|
||||
'See: https://github.com/czlonkowski/n8n-mcp/issues/524'
|
||||
);
|
||||
|
||||
validateEnvironment();
|
||||
|
||||
const app = express();
|
||||
|
||||
@@ -124,9 +124,23 @@ Learn more: https://github.com/czlonkowski/n8n-mcp/blob/main/PRIVACY.md
|
||||
checkpoints.push(STARTUP_CHECKPOINTS.MCP_HANDSHAKE_STARTING);
|
||||
|
||||
if (mode === 'http') {
|
||||
// Check if we should use the fixed implementation
|
||||
// Check if we should use the fixed implementation (DEPRECATED)
|
||||
if (process.env.USE_FIXED_HTTP === 'true') {
|
||||
// Use the fixed HTTP implementation that bypasses StreamableHTTPServerTransport issues
|
||||
// DEPRECATION WARNING: Fixed HTTP implementation is deprecated
|
||||
// It does not support SSE streaming required by clients like OpenAI Codex
|
||||
logger.warn(
|
||||
'DEPRECATION WARNING: USE_FIXED_HTTP=true is deprecated as of v2.31.8. ' +
|
||||
'The fixed HTTP implementation does not support SSE streaming required by clients like OpenAI Codex. ' +
|
||||
'Please unset USE_FIXED_HTTP to use the modern SingleSessionHTTPServer which supports both JSON-RPC and SSE. ' +
|
||||
'This option will be removed in a future version. See: https://github.com/czlonkowski/n8n-mcp/issues/524'
|
||||
);
|
||||
console.warn('\n⚠️ DEPRECATION WARNING ⚠️');
|
||||
console.warn('USE_FIXED_HTTP=true is deprecated as of v2.31.8.');
|
||||
console.warn('The fixed HTTP implementation does not support SSE streaming.');
|
||||
console.warn('Please unset USE_FIXED_HTTP to use SingleSessionHTTPServer.');
|
||||
console.warn('See: https://github.com/czlonkowski/n8n-mcp/issues/524\n');
|
||||
|
||||
// Use the deprecated fixed HTTP implementation
|
||||
const { startFixedHTTPServer } = await import('../http-server');
|
||||
await startFixedHTTPServer();
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { NodeRepository } from '../database/node-repository';
|
||||
import { logger } from '../utils/logger';
|
||||
import { ToolVariantGenerator } from './tool-variant-generator';
|
||||
|
||||
export interface NodeSuggestion {
|
||||
nodeType: string;
|
||||
@@ -126,6 +127,25 @@ export class NodeSimilarityService {
|
||||
return [];
|
||||
}
|
||||
|
||||
// Check if this is a Tool variant and base node exists (Issue #522)
|
||||
// Dynamic AI Tool variants like googleDriveTool are created at runtime by n8n
|
||||
if (ToolVariantGenerator.isToolVariantNodeType(invalidType)) {
|
||||
const baseNodeType = ToolVariantGenerator.getBaseNodeType(invalidType);
|
||||
if (baseNodeType) {
|
||||
const baseNode = this.repository.getNode(baseNodeType);
|
||||
if (baseNode) {
|
||||
return [{
|
||||
nodeType: invalidType,
|
||||
displayName: `${baseNode.displayName} Tool`,
|
||||
confidence: 0.98,
|
||||
reason: `Dynamic AI Tool variant of ${baseNode.displayName}`,
|
||||
category: baseNode.category,
|
||||
description: 'Runtime-generated Tool variant for AI Agent integration'
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const suggestions: NodeSuggestion[] = [];
|
||||
|
||||
// First, check for exact common mistakes
|
||||
|
||||
@@ -398,7 +398,39 @@ export class WorkflowValidator {
|
||||
const normalizedType = NodeTypeNormalizer.normalizeToFullForm(node.type);
|
||||
|
||||
// Get node definition using normalized type (needed for typeVersion validation)
|
||||
const nodeInfo = this.nodeRepository.getNode(normalizedType);
|
||||
let nodeInfo = this.nodeRepository.getNode(normalizedType);
|
||||
|
||||
// Check if this is a dynamic Tool variant (e.g., googleDriveTool, googleSheetsTool)
|
||||
// n8n creates these at runtime when ANY node is used in an AI Agent's tool slot,
|
||||
// but they don't exist in npm packages. We infer validity if the base node exists.
|
||||
// See: https://github.com/czlonkowski/n8n-mcp/issues/522
|
||||
if (!nodeInfo && ToolVariantGenerator.isToolVariantNodeType(normalizedType)) {
|
||||
const baseNodeType = ToolVariantGenerator.getBaseNodeType(normalizedType);
|
||||
if (baseNodeType) {
|
||||
const baseNodeInfo = this.nodeRepository.getNode(baseNodeType);
|
||||
if (baseNodeInfo) {
|
||||
// Valid inferred tool variant - base node exists
|
||||
result.warnings.push({
|
||||
type: 'warning',
|
||||
nodeId: node.id,
|
||||
nodeName: node.name,
|
||||
message: `Node type "${node.type}" is inferred as a dynamic AI Tool variant of "${baseNodeType}". ` +
|
||||
`This Tool variant is created by n8n at runtime when connecting "${baseNodeInfo.displayName}" to an AI Agent.`,
|
||||
code: 'INFERRED_TOOL_VARIANT'
|
||||
});
|
||||
|
||||
// Create synthetic nodeInfo for validation continuity
|
||||
nodeInfo = {
|
||||
...baseNodeInfo,
|
||||
nodeType: normalizedType,
|
||||
displayName: `${baseNodeInfo.displayName} Tool`,
|
||||
isToolVariant: true,
|
||||
toolVariantOf: baseNodeType,
|
||||
isInferred: true
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!nodeInfo) {
|
||||
|
||||
@@ -494,6 +526,13 @@ export class WorkflowValidator {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip PARAMETER validation for inferred tool variants (Issue #522)
|
||||
// They have a different property structure (toolDescription added at runtime)
|
||||
// that doesn't match the base node's schema. TypeVersion validation above still runs.
|
||||
if ((nodeInfo as any).isInferred) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Validate node configuration
|
||||
// Add @version to parameters for displayOptions evaluation (supports _cnd operators)
|
||||
const paramsWithVersion = {
|
||||
|
||||
@@ -599,4 +599,294 @@ describe('WorkflowValidator - Tool Variant Validation', () => {
|
||||
expect(invalidToolErrors.length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateAllNodes - Inferred Tool Variants (Issue #522)', () => {
|
||||
/**
|
||||
* Tests for dynamic AI Tool nodes that are created at runtime by n8n
|
||||
* when ANY node is used in an AI Agent's tool slot.
|
||||
*
|
||||
* These nodes (e.g., googleDriveTool, googleSheetsTool) don't exist in npm packages
|
||||
* but are valid when the base node exists.
|
||||
*/
|
||||
|
||||
beforeEach(() => {
|
||||
// Update mock repository to include Google nodes
|
||||
mockRepository.getNode = vi.fn((nodeType: string) => {
|
||||
// Base node with Tool variant
|
||||
if (nodeType === 'nodes-base.supabase') {
|
||||
return {
|
||||
nodeType: 'nodes-base.supabase',
|
||||
displayName: 'Supabase',
|
||||
isAITool: true,
|
||||
hasToolVariant: true,
|
||||
isToolVariant: false,
|
||||
isTrigger: false,
|
||||
properties: []
|
||||
};
|
||||
}
|
||||
|
||||
// Tool variant in database
|
||||
if (nodeType === 'nodes-base.supabaseTool') {
|
||||
return {
|
||||
nodeType: 'nodes-base.supabaseTool',
|
||||
displayName: 'Supabase Tool',
|
||||
isAITool: true,
|
||||
hasToolVariant: false,
|
||||
isToolVariant: true,
|
||||
toolVariantOf: 'nodes-base.supabase',
|
||||
isTrigger: false,
|
||||
properties: []
|
||||
};
|
||||
}
|
||||
|
||||
// Google Drive base node (exists, but no Tool variant in DB)
|
||||
if (nodeType === 'nodes-base.googleDrive') {
|
||||
return {
|
||||
nodeType: 'nodes-base.googleDrive',
|
||||
displayName: 'Google Drive',
|
||||
isAITool: false, // Not marked as AI tool in npm package
|
||||
hasToolVariant: false, // No Tool variant in database
|
||||
isToolVariant: false,
|
||||
isTrigger: false,
|
||||
properties: [],
|
||||
category: 'files'
|
||||
};
|
||||
}
|
||||
|
||||
// Google Sheets base node (exists, but no Tool variant in DB)
|
||||
if (nodeType === 'nodes-base.googleSheets') {
|
||||
return {
|
||||
nodeType: 'nodes-base.googleSheets',
|
||||
displayName: 'Google Sheets',
|
||||
isAITool: false,
|
||||
hasToolVariant: false,
|
||||
isToolVariant: false,
|
||||
isTrigger: false,
|
||||
properties: [],
|
||||
category: 'productivity'
|
||||
};
|
||||
}
|
||||
|
||||
// AI Agent node
|
||||
if (nodeType === 'nodes-langchain.agent') {
|
||||
return {
|
||||
nodeType: 'nodes-langchain.agent',
|
||||
displayName: 'AI Agent',
|
||||
isAITool: false,
|
||||
hasToolVariant: false,
|
||||
isToolVariant: false,
|
||||
isTrigger: false,
|
||||
properties: []
|
||||
};
|
||||
}
|
||||
|
||||
return null; // Unknown node
|
||||
}) as any;
|
||||
});
|
||||
|
||||
it('should pass validation for googleDriveTool when googleDrive exists', async () => {
|
||||
const workflow = {
|
||||
nodes: [
|
||||
{
|
||||
id: 'drive-tool-1',
|
||||
name: 'Google Drive Tool',
|
||||
type: 'n8n-nodes-base.googleDriveTool',
|
||||
typeVersion: 3,
|
||||
position: [250, 300] as [number, number],
|
||||
parameters: {}
|
||||
}
|
||||
],
|
||||
connections: {}
|
||||
};
|
||||
|
||||
const result = await validator.validateWorkflow(workflow);
|
||||
|
||||
// Should NOT have "Unknown node type" error
|
||||
const unknownErrors = result.errors.filter(e =>
|
||||
e.message && e.message.includes('Unknown node type')
|
||||
);
|
||||
expect(unknownErrors).toHaveLength(0);
|
||||
|
||||
// Should have INFERRED_TOOL_VARIANT warning
|
||||
const inferredWarnings = result.warnings.filter(e =>
|
||||
(e as any).code === 'INFERRED_TOOL_VARIANT'
|
||||
);
|
||||
expect(inferredWarnings).toHaveLength(1);
|
||||
expect(inferredWarnings[0].message).toContain('googleDriveTool');
|
||||
expect(inferredWarnings[0].message).toContain('Google Drive');
|
||||
});
|
||||
|
||||
it('should pass validation for googleSheetsTool when googleSheets exists', async () => {
|
||||
const workflow = {
|
||||
nodes: [
|
||||
{
|
||||
id: 'sheets-tool-1',
|
||||
name: 'Google Sheets Tool',
|
||||
type: 'n8n-nodes-base.googleSheetsTool',
|
||||
typeVersion: 4,
|
||||
position: [250, 300] as [number, number],
|
||||
parameters: {}
|
||||
}
|
||||
],
|
||||
connections: {}
|
||||
};
|
||||
|
||||
const result = await validator.validateWorkflow(workflow);
|
||||
|
||||
// Should NOT have "Unknown node type" error
|
||||
const unknownErrors = result.errors.filter(e =>
|
||||
e.message && e.message.includes('Unknown node type')
|
||||
);
|
||||
expect(unknownErrors).toHaveLength(0);
|
||||
|
||||
// Should have INFERRED_TOOL_VARIANT warning
|
||||
const inferredWarnings = result.warnings.filter(e =>
|
||||
(e as any).code === 'INFERRED_TOOL_VARIANT'
|
||||
);
|
||||
expect(inferredWarnings).toHaveLength(1);
|
||||
expect(inferredWarnings[0].message).toContain('googleSheetsTool');
|
||||
expect(inferredWarnings[0].message).toContain('Google Sheets');
|
||||
});
|
||||
|
||||
it('should report error for unknownNodeTool when base node does not exist', async () => {
|
||||
const workflow = {
|
||||
nodes: [
|
||||
{
|
||||
id: 'unknown-tool-1',
|
||||
name: 'Unknown Tool',
|
||||
type: 'n8n-nodes-base.nonExistentNodeTool',
|
||||
typeVersion: 1,
|
||||
position: [250, 300] as [number, number],
|
||||
parameters: {}
|
||||
}
|
||||
],
|
||||
connections: {}
|
||||
};
|
||||
|
||||
const result = await validator.validateWorkflow(workflow);
|
||||
|
||||
// Should have "Unknown node type" error
|
||||
const unknownErrors = result.errors.filter(e =>
|
||||
e.message && e.message.includes('Unknown node type')
|
||||
);
|
||||
expect(unknownErrors).toHaveLength(1);
|
||||
|
||||
// Should NOT have INFERRED_TOOL_VARIANT warning
|
||||
const inferredWarnings = result.warnings.filter(e =>
|
||||
(e as any).code === 'INFERRED_TOOL_VARIANT'
|
||||
);
|
||||
expect(inferredWarnings).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('should handle multiple inferred tool variants in same workflow', async () => {
|
||||
const workflow = {
|
||||
nodes: [
|
||||
{
|
||||
id: 'drive-tool-1',
|
||||
name: 'Google Drive Tool',
|
||||
type: 'n8n-nodes-base.googleDriveTool',
|
||||
typeVersion: 3,
|
||||
position: [250, 300] as [number, number],
|
||||
parameters: {}
|
||||
},
|
||||
{
|
||||
id: 'sheets-tool-1',
|
||||
name: 'Google Sheets Tool',
|
||||
type: 'n8n-nodes-base.googleSheetsTool',
|
||||
typeVersion: 4,
|
||||
position: [250, 400] as [number, number],
|
||||
parameters: {}
|
||||
},
|
||||
{
|
||||
id: 'agent-1',
|
||||
name: 'AI Agent',
|
||||
type: '@n8n/n8n-nodes-langchain.agent',
|
||||
typeVersion: 1.7,
|
||||
position: [450, 300] as [number, number],
|
||||
parameters: {}
|
||||
}
|
||||
],
|
||||
connections: {
|
||||
'Google Drive Tool': {
|
||||
ai_tool: [[{ node: 'AI Agent', type: 'ai_tool', index: 0 }]]
|
||||
},
|
||||
'Google Sheets Tool': {
|
||||
ai_tool: [[{ node: 'AI Agent', type: 'ai_tool', index: 0 }]]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const result = await validator.validateWorkflow(workflow);
|
||||
|
||||
// Should NOT have "Unknown node type" errors
|
||||
const unknownErrors = result.errors.filter(e =>
|
||||
e.message && e.message.includes('Unknown node type')
|
||||
);
|
||||
expect(unknownErrors).toHaveLength(0);
|
||||
|
||||
// Should have 2 INFERRED_TOOL_VARIANT warnings
|
||||
const inferredWarnings = result.warnings.filter(e =>
|
||||
(e as any).code === 'INFERRED_TOOL_VARIANT'
|
||||
);
|
||||
expect(inferredWarnings).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('should prefer database record over inference for supabaseTool', async () => {
|
||||
const workflow = {
|
||||
nodes: [
|
||||
{
|
||||
id: 'supabase-tool-1',
|
||||
name: 'Supabase Tool',
|
||||
type: 'n8n-nodes-base.supabaseTool',
|
||||
typeVersion: 1,
|
||||
position: [250, 300] as [number, number],
|
||||
parameters: {}
|
||||
}
|
||||
],
|
||||
connections: {}
|
||||
};
|
||||
|
||||
const result = await validator.validateWorkflow(workflow);
|
||||
|
||||
// Should NOT have "Unknown node type" error
|
||||
const unknownErrors = result.errors.filter(e =>
|
||||
e.message && e.message.includes('Unknown node type')
|
||||
);
|
||||
expect(unknownErrors).toHaveLength(0);
|
||||
|
||||
// Should NOT have INFERRED_TOOL_VARIANT warning (it's in database)
|
||||
const inferredWarnings = result.warnings.filter(e =>
|
||||
(e as any).code === 'INFERRED_TOOL_VARIANT'
|
||||
);
|
||||
expect(inferredWarnings).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('should include helpful message in warning', async () => {
|
||||
const workflow = {
|
||||
nodes: [
|
||||
{
|
||||
id: 'drive-tool-1',
|
||||
name: 'Google Drive Tool',
|
||||
type: 'n8n-nodes-base.googleDriveTool',
|
||||
typeVersion: 3,
|
||||
position: [250, 300] as [number, number],
|
||||
parameters: {}
|
||||
}
|
||||
],
|
||||
connections: {}
|
||||
};
|
||||
|
||||
const result = await validator.validateWorkflow(workflow);
|
||||
|
||||
const inferredWarning = result.warnings.find(e =>
|
||||
(e as any).code === 'INFERRED_TOOL_VARIANT'
|
||||
);
|
||||
|
||||
expect(inferredWarning).toBeDefined();
|
||||
expect(inferredWarning!.message).toContain('inferred as a dynamic AI Tool variant');
|
||||
expect(inferredWarning!.message).toContain('nodes-base.googleDrive');
|
||||
expect(inferredWarning!.message).toContain('Google Drive');
|
||||
expect(inferredWarning!.message).toContain('AI Agent');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user