fix(MCP Client Tool Node): Change default transport to HTTP Streamable (#20053)

Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
Elias Meire 2025-09-26 14:47:37 +02:00 committed by GitHub
parent b55c95c863
commit e0a9de7fe3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 19 deletions

View File

@ -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',

View File

@ -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,
});