From e0a9de7fe3ef1cca52d602d3de030803cb94a29d Mon Sep 17 00:00:00 2001 From: Elias Meire Date: Fri, 26 Sep 2025 14:47:37 +0200 Subject: [PATCH] fix(MCP Client Tool Node): Change default transport to HTTP Streamable (#20053) Co-authored-by: Michael Kret --- .../mcp/McpClientTool/McpClientTool.node.ts | 33 ++++++++----------- .../nodes/mcp/McpClientTool/descriptions.ts | 26 +++++++++++++++ 2 files changed, 40 insertions(+), 19 deletions(-) create mode 100644 packages/@n8n/nodes-langchain/nodes/mcp/McpClientTool/descriptions.ts diff --git a/packages/@n8n/nodes-langchain/nodes/mcp/McpClientTool/McpClientTool.node.ts b/packages/@n8n/nodes-langchain/nodes/mcp/McpClientTool/McpClientTool.node.ts index 3167c400fbe..8cc5546c6f8 100644 --- a/packages/@n8n/nodes-langchain/nodes/mcp/McpClientTool/McpClientTool.node.ts +++ b/packages/@n8n/nodes-langchain/nodes/mcp/McpClientTool/McpClientTool.node.ts @@ -9,6 +9,7 @@ import { type SupplyData, } from 'n8n-workflow'; +import { transportSelect } from './descriptions'; import { getTools } from './loadOptions'; import type { McpServerTransport, McpAuthenticationOption, McpToolIncludeMode } from './types'; import { @@ -30,7 +31,7 @@ export class McpClientTool implements INodeType { dark: 'file:../mcp.dark.svg', }, group: ['output'], - version: [1, 1.1], + version: [1, 1.1, 1.2], description: 'Connect tools from an MCP Server', defaults: { name: 'MCP Client', @@ -102,28 +103,22 @@ export class McpClientTool implements INodeType { }, }, }, - { - displayName: 'Server Transport', - name: 'serverTransport', - type: 'options', - options: [ - { - name: 'Server Sent Events (Deprecated)', - value: 'sse', - }, - { - name: 'HTTP Streamable', - value: 'httpStreamable', - }, - ], - default: 'sse', - description: 'The transport used by your endpoint', + transportSelect({ + defaultOption: 'sse', displayOptions: { show: { - '@version': [{ _cnd: { gte: 1.1 } }], + '@version': [1.1], }, }, - }, + }), + transportSelect({ + defaultOption: 'httpStreamable', + displayOptions: { + show: { + '@version': [{ _cnd: { gte: 1.2 } }], + }, + }, + }), { displayName: 'Authentication', name: 'authentication', diff --git a/packages/@n8n/nodes-langchain/nodes/mcp/McpClientTool/descriptions.ts b/packages/@n8n/nodes-langchain/nodes/mcp/McpClientTool/descriptions.ts new file mode 100644 index 00000000000..089d4c40138 --- /dev/null +++ b/packages/@n8n/nodes-langchain/nodes/mcp/McpClientTool/descriptions.ts @@ -0,0 +1,26 @@ +import type { IDisplayOptions, INodeProperties } from 'n8n-workflow'; + +export const transportSelect = ({ + defaultOption, + displayOptions, +}: { + defaultOption: 'sse' | 'httpStreamable'; + displayOptions: IDisplayOptions; +}): INodeProperties => ({ + displayName: 'Server Transport', + name: 'serverTransport', + type: 'options', + options: [ + { + name: 'HTTP Streamable', + value: 'httpStreamable', + }, + { + name: 'Server Sent Events (Deprecated)', + value: 'sse', + }, + ], + default: defaultOption, + description: 'The transport used by your endpoint', + displayOptions, +});