This commit is contained in:
Typer_Body
2026-05-08 00:56:27 +08:00
parent eb9f38b102
commit 75fdfe6806
51 changed files with 1585 additions and 1643 deletions

View File

@@ -20,21 +20,21 @@ class MCPToolNode(WorkflowNode):
"""MCP tool node - invoke MCP (Model Context Protocol) tools"""
# Node type for registration
type_name = "mcp_tool"
type_name = 'mcp_tool'
# Category and icon - these are not i18n
category = "integration"
icon = "Wrench"
category = 'integration'
icon = 'Wrench'
# Name and description - i18n handled on frontend side
# Frontend will use node type key to look up translation
name = "mcp_tool"
description = "mcp_tool"
name_zh = "MCP 工具"
name_en = "MCP Tool"
description_zh = "调用 MCP 工具"
description_en = "Invoke an MCP (Model Context Protocol) tool"
name = 'mcp_tool'
description = 'mcp_tool'
name_zh = 'MCP 工具'
name_en = 'MCP Tool'
description_zh = '调用 MCP 工具'
description_en = 'Invoke an MCP (Model Context Protocol) tool'
# Inputs/outputs/config - loaded from YAML at runtime
inputs: ClassVar[list[NodePort]] = []
outputs: ClassVar[list[NodePort]] = []
@@ -42,29 +42,29 @@ class MCPToolNode(WorkflowNode):
async def execute(self, inputs: dict[str, Any], context: ExecutionContext) -> dict[str, Any]:
"""Execute the MCP tool node
Args:
inputs: Input data from connected nodes
context: Execution context with workflow state
Returns:
Dictionary of output values
"""
server_name = self.get_config("server_name", "")
tool_name = self.get_config("tool_name", "")
arguments_template = self.get_config("arguments_template", "")
timeout = self.get_config("timeout", 30)
server_name = self.get_config('server_name', '')
tool_name = self.get_config('tool_name', '')
arguments_template = self.get_config('arguments_template', '')
timeout = self.get_config('timeout', 30)
arguments = inputs.get("arguments", arguments_template)
arguments = inputs.get('arguments', arguments_template)
return {
"result": None,
"success": False,
"error": f"MCP tool '{server_name}/{tool_name}' not implemented yet",
"_debug": {
"server_name": server_name,
"tool_name": tool_name,
"arguments": arguments,
"timeout": timeout,
'result': None,
'success': False,
'error': f"MCP tool '{server_name}/{tool_name}' not implemented yet",
'_debug': {
'server_name': server_name,
'tool_name': tool_name,
'arguments': arguments,
'timeout': timeout,
},
}