Skip to content

fix(wanwu): keep legacy MCP nodes on SSE when transport is empty - #8

Open
ThisIsReed wants to merge 1 commit into
UnicomAI:devfrom
ThisIsReed:fix/mcp-legacy-empty-transport
Open

ThisIsReed wants to merge 1 commit into
UnicomAI:devfrom
ThisIsReed:fix/mcp-legacy-empty-transport

Conversation

@ThisIsReed

Copy link
Copy Markdown

What type of PR is this?

fix: A bug fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Add documentation if the current PR requires user awareness at the usage level.

No usage-level documentation is required. Existing workflows keep working without re-saving each MCP node.

(Optional) Translate the PR title into Chinese.

修复旧工作流 MCP 节点缺少 transport 时无法运行的问题

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
Adding streamable HTTP (a1f5a791, feat(mcp): mcp support streamable http) made Config.Build require transport to be sse or streamable. Older canvas nodes only stored serverUrl and a tool name, and the runtime always used SSE. After the upgrade, an omitted field or an empty string reaches the default branch and node creation fails with transport not support before any tool call.

The stored canvas is what draft test runs, published versions, resume, and single-node debug all compile. Re-selecting one node in the editor does not rewrite other old nodes in the same workflow. This change restores the previous SSE behavior when transport is missing or empty. Explicit sse still uses the SSE URL, explicit streamable still uses the streamable URL, and an unknown protocol still returns transport not support. A selected protocol with no URL, or a node with no tool name, still returns a specific error.

A workflow containing one legacy node and one explicit SSE node now builds as one graph, and both nodes complete an SSE handshake and tool call against a local echo MCP server.

zh(optional):
支持 streamable HTTP 之后,节点构建要求 transport 为 sse 或 streamable。旧画布只保存 serverUrl 和工具名,运行时原本固定走 SSE。升级后字段缺失或为空会在构建阶段报 transport not support。草稿试运行、已发布版本、恢复执行和单节点调试都从已保存画布重新构建,因此只重新选择其中一个节点不能修复同一工作流里的其他旧节点。本变更在 transport 缺失或为空时恢复 SSE;显式 sse、streamable 和未知协议的行为保持不变。

(Optional) Which issue(s) this PR fixes:

None. No equivalent open issue or pull request was found.

Test plan

  • go test ./domain/workflow/internal/nodes/wanwu-mcp/ covers omitted transport, empty transport, explicit SSE, explicit streamable, unknown protocol, missing URL, and missing tool name. SSE and streamable cases call a local echo MCP server and check the tool result.
  • go test -run TestMixedLegacyAndExplicitSSEMCPWorkflow ./domain/workflow/internal/canvas/adaptor/ builds one canvas with a legacy node and an explicit SSE node, runs the workflow, and checks both node results.
  • The same build cases fail with transport not support on unmodified dev.

Historical workflow MCP nodes stored only serverUrl and implicitly used SSE.
Streamable HTTP support rejects an omitted or empty transport while building
the node, so existing drafts and published versions fail before any tool call.
Treat an empty transport as SSE, and keep explicit SSE, streamable, and
unknown protocols unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant