#6716·Flowise

Custom MCP in Agent node: 'Invalid MCP Server Config: Error: URL is required for SSE transport' when mcpServerConfig lacks a url key

Author: PseudoSkyCreated Aug 7, 2026Updated Aug 7, 2026

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

  1. Error UX: URL is required for SSE transport gives no hint about which config key to add or that CUSTOM_MCP_PROTOCOL=stdio is the alternative. A message like "serverParams.url is required for remote (SSE/streamable HTTP) servers; for stdio servers set CUSTOM_MCP_PROTOCOL=stdio and provide command/args" would save users real time.
  2. UI flow (needs confirmation): the "Custom MCP Server" option in the UI — does the selection flow always include a url in the generated mcpServerConfig? If a user picks that option but the config produced/edited lacks url, the above error fires at Agent runtime. If the UI can produce a config without url, 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"]} (no url, no CUSTOM_MCP_PROTOCOL env).
  • 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