Custom MCP in Agent node: 'Invalid MCP Server Config: Error: URL is required for SSE transport' when mcpServerConfig lacks a url key
Summary
When using a Custom MCP tool inside an Agent/AgentFlow, initializing the tool can fail with:
Error in Agent node: Invalid MCP Server Config: Error: URL is required for SSE transport
What the code path does
In flowise-components/dist/nodes/tools/MCP/CustomMCP/CustomMCP.js, getTools() parses the mcpServerConfig JSON and always constructs the toolkit with the 'sse' transport type unless CUSTOM_MCP_PROTOCOL === 'stdio' and the config has a command:
if (process.env.CUSTOM_MCP_PROTOCOL === 'stdio' && serverParams.command)
toolkit = new core_1.MCPToolkit(serverParams, 'stdio');
else
toolkit = new core_1.MCPToolkit(serverParams, 'sse');
In core.js MCPToolkit.createClient(), the non-stdio branch throws when the config has no url:
if (this.serverParams.url === undefined) {
throw new Error('URL is required for SSE transport');
}
The Custom MCP node's own UI placeholder defaults to the stdio shape ({"command": "npx", "args": [...]}), while the runtime default transport is SSE — so a config that omits url (or was authored from the stdio example) produces this confusing error instead of a clear "add a url key for remote servers, or set CUSTOM_MCP_PROTOCOL=stdio for stdio servers".
Questions / possible issues
- Error UX:
URL is required for SSE transportgives no hint about which config key to add or thatCUSTOM_MCP_PROTOCOL=stdiois the alternative. A message like "serverParams.url is required for remote (SSE/streamable HTTP) servers; for stdio servers set CUSTOM_MCP_PROTOCOL=stdio and providecommand/args" would save users real time. - UI flow (needs confirmation): the "Custom MCP Server" option in the UI — does the selection flow always include a
urlin the generatedmcpServerConfig? If a user picks that option but the config produced/edited lacksurl, the above error fires at Agent runtime. If the UI can produce a config withouturl, that's a UI bug; if it's purely a pasted-config shape issue, the improved error message covers it.
Repro
- Add a Custom MCP node with
{"command": "npx", "args": ["-y", "some-server"]}(nourl, noCUSTOM_MCP_PROTOCOLenv). - Attach to an Agent node / AgentFlow and run.
- Observed on flowise 3.1.4, Node v24.
Environment
- flowise 3.1.4, Node v24.11.1, flowise-components bundled
Source: FlowiseAI/Flowise