Feature: Upgrade MCP version and support SSE mode. (#4329)

Upgrade MCP version and support SSE mode.

Co-authored-by: guwenjia <guwenjia@bilibili.com>
This commit is contained in:
Zero Gu
2025-04-27 12:13:06 +08:00
committed by GitHub
parent f8ca105822
commit ac0450523a
4 changed files with 36738 additions and 36675 deletions
@@ -104,7 +104,14 @@ class Custom_MCP implements INode {
serverParams = JSON.parse(serverParamsString)
}
const toolkit = new MCPToolkit(serverParams, 'stdio')
// Compatible with stdio and SSE
let toolkit: MCPToolkit
if (serverParams?.command === undefined) {
toolkit = new MCPToolkit(serverParams, 'sse')
} else {
toolkit = new MCPToolkit(serverParams, 'stdio')
}
await toolkit.initialize()
const tools = toolkit.tools ?? []