feat: 提交 一下

This commit is contained in:
2026-01-20 20:59:21 +08:00
parent 3ea772c3be
commit 59a7f13781
25 changed files with 1530 additions and 2403 deletions

View File

@@ -1,979 +0,0 @@
2025-12-20 18:03:07 - root - INFO - [logger_config.py:117] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\logs
2025-12-20 18:03:07 - mcp.server.lowlevel.server - DEBUG - [server.py:154] - Initializing server 'workflow_mcp_server'
2025-12-20 18:03:07 - mcp.server.lowlevel.server - DEBUG - [server.py:380] - Registering handler for ListToolsRequest
2025-12-20 18:03:07 - mcp.server.lowlevel.server - DEBUG - [server.py:441] - Registering handler for CallToolRequest
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:272] - ==================================================
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:273] - Workflow MCP Server 启动
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:274] - ==================================================
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:279] - 命令行参数: {'mode': 'api', 'json_path': None, 'workflow_id': None}
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:282] - 使用模式: api
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:103] - ApiLoader 初始化工作流ID: 2002300699510763521
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:111] - 开始从 API 加载工作流配置工作流ID: 2002300699510763521
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:56] - [客户端初始化] base_url=http://192.168.2.236:8088
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:57] - [客户端初始化] token=wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:58] - [客户端初始化] execute_timeout=300.0s
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:89] - [API请求] GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:90] - [API请求] Headers: {'X-API-Key': ' wf_buh230o9iaea4n6aefsddcexa7p27ydl'}
2025-12-20 18:03:07 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.started host='192.168.2.236' port=8088 local_address=None timeout=30.0 socket_options=None
2025-12-20 18:03:07 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x00000155217CC380>
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'GET']>
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'GET']>
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'GET']>
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Sat, 20 Dec 2025 10:03:06 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-20 18:03:07 - httpx - INFO - [_client.py:1025] - HTTP Request: GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521 "HTTP/1.1 200 "
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'GET']>
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:97] - [API响应] HTTP 200
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:98] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'date': 'Sat, 20 Dec 2025 10:03:06 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:103] - [API响应] 获取工作流配置成功: workflow_id=2002300699510763521
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:104] - [API响应] Body: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:116] - API 响应原始数据: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:124] - API 响应 data 字段: [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:135] - 从 API 加载工作流配置成功工作流ID: 2002300699510763521, 配置数量: 1
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:165] - 已加载 1 个工具配置
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:290] - 开始运行 MCP Server (stdio 模式)
2025-12-20 18:03:07 - asyncio - DEBUG - [proactor_events.py:634] - Using proactor: IocpProactor
2025-12-20 18:03:07 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: root=InitializedNotification(method='notifications/initialized', params=None, jsonrpc='2.0')
2025-12-20 18:03:08 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x000001552178D700>
2025-12-20 18:03:08 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest
2025-12-20 18:03:08 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type ListToolsRequest
2025-12-20 18:03:08 - lzwcai_workflow_to_mcp.main - INFO - [main.py:171] - 收到 ListTools 请求,当前配置数量: 1
2025-12-20 18:03:08 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:179] - 处理工具配置: name=weimingminggongdefangshizuoliu001_91bc43ee, description=3123123123...
2025-12-20 18:03:08 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:183] - 工具 weimingminggongdefangshizuoliu001_91bc43ee 的 inputSchema: {"type": "object", "properties": {"query": {"description": "问题", "type": "string", "format": "paragraph", "maxLength": 3000}}, "required": ["query"]}
2025-12-20 18:03:08 - lzwcai_workflow_to_mcp.main - INFO - [main.py:193] - ListTools 响应: 返回 1 个工具
2025-12-20 18:03:08 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-20 18:03:12 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x00000155218D4A70>
2025-12-20 18:03:12 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest
2025-12-20 18:03:12 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type CallToolRequest
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - INFO - [main.py:203] - 收到 CallTool 请求: name=weimingminggongdefangshizuoliu001_91bc43ee, arguments={"query": "你好啊"}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:216] - 找到工具配置: {
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - INFO - [main.py:220] - 使用工作流ID: 2002300699510763521
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - INFO - [main.py:228] - 执行工作流请求数据: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:150] - [执行工作流] URL: http://192.168.2.236:8088/open/workflow/execute
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:151] - [执行工作流] Token: wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:152] - [执行工作流] Headers: {"X-API-Key": "Bearer wf_buh230o9iaea4n6aefsddcexa7p27ydl", "Content-Type": "application/json", "Accept": "*/*"}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:153] - [执行工作流] 请求参数: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:154] - [执行工作流] 超时时间: 300.0s
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'POST']>
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'POST']>
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'POST']>
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 401, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Trace-Id', b'40f82dcb-2055-46b4-a9ae-1bbee5591306'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json;charset=UTF-8'), (b'Content-Length', b'61'), (b'Date', b'Sat, 20 Dec 2025 10:03:10 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-20 18:03:12 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.2.236:8088/open/workflow/execute "HTTP/1.1 401 "
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'POST']>
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:164] - [API响应] HTTP 401
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:165] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-trace-id': '40f82dcb-2055-46b4-a9ae-1bbee5591306', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;charset=UTF-8', 'content-length': '61', 'date': 'Sat, 20 Dec 2025 10:03:10 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - ERROR - [api_client.py:182] - [API错误] 执行工作流API请求失败 (HTTP 401): http://192.168.2.236:8088/open/workflow/execute
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - ERROR - [api_client.py:183] - [API错误] 响应内容: {"msg":"API Key无效","code":401,"errorCode":"UNAUTHORIZED"}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - ERROR - [main.py:236] - 工作流执行失败: 执行工作流API请求失败 (HTTP 401): http://192.168.2.236:8088/open/workflow/execute
Traceback (most recent call last):
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\utils\api_client.py", line 167, in execute_workflow
response.raise_for_status()
File "D:\anaconda3\Lib\site-packages\httpx\_models.py", line 829, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 ' for url 'http://192.168.2.236:8088/open/workflow/execute'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\main.py", line 232, in handle_call_tool
result = execute_workflow(request_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\utils\api_client.py", line 268, in execute_workflow
return default_client.execute_workflow(request_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\utils\api_client.py", line 184, in execute_workflow
raise Exception(error_msg)
Exception: 执行工作流API请求失败 (HTTP 401): http://192.168.2.236:8088/open/workflow/execute
2025-12-20 18:03:12 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-20 18:04:18 - root - INFO - [logger_config.py:117] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\logs
2025-12-20 18:04:18 - mcp.server.lowlevel.server - DEBUG - [server.py:154] - Initializing server 'workflow_mcp_server'
2025-12-20 18:04:18 - mcp.server.lowlevel.server - DEBUG - [server.py:380] - Registering handler for ListToolsRequest
2025-12-20 18:04:18 - mcp.server.lowlevel.server - DEBUG - [server.py:441] - Registering handler for CallToolRequest
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:272] - ==================================================
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:273] - Workflow MCP Server 启动
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:274] - ==================================================
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:279] - 命令行参数: {'mode': 'api', 'json_path': None, 'workflow_id': None}
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:282] - 使用模式: api
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:103] - ApiLoader 初始化工作流ID: 2002300699510763521
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:111] - 开始从 API 加载工作流配置工作流ID: 2002300699510763521
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:56] - [客户端初始化] base_url=http://192.168.2.236:8088
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:57] - [客户端初始化] token=wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:58] - [客户端初始化] execute_timeout=300.0s
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:89] - [API请求] GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:90] - [API请求] Headers: {'X-API-Key': 'wf_buh230o9iaea4n6aefsddcexa7p27ydl'}
2025-12-20 18:04:18 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.started host='192.168.2.236' port=8088 local_address=None timeout=30.0 socket_options=None
2025-12-20 18:04:18 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x0000025DD0ED1F70>
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'GET']>
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'GET']>
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'GET']>
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Sat, 20 Dec 2025 10:04:16 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-20 18:04:18 - httpx - INFO - [_client.py:1025] - HTTP Request: GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521 "HTTP/1.1 200 "
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'GET']>
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:97] - [API响应] HTTP 200
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:98] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'date': 'Sat, 20 Dec 2025 10:04:16 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:103] - [API响应] 获取工作流配置成功: workflow_id=2002300699510763521
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:104] - [API响应] Body: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:116] - API 响应原始数据: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:124] - API 响应 data 字段: [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:135] - 从 API 加载工作流配置成功工作流ID: 2002300699510763521, 配置数量: 1
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:165] - 已加载 1 个工具配置
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:290] - 开始运行 MCP Server (stdio 模式)
2025-12-20 18:04:18 - asyncio - DEBUG - [proactor_events.py:634] - Using proactor: IocpProactor
2025-12-20 18:04:18 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: root=InitializedNotification(method='notifications/initialized', params=None, jsonrpc='2.0')
2025-12-20 18:04:19 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x0000025DCF92FF50>
2025-12-20 18:04:19 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest
2025-12-20 18:04:19 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type ListToolsRequest
2025-12-20 18:04:19 - lzwcai_workflow_to_mcp.main - INFO - [main.py:171] - 收到 ListTools 请求,当前配置数量: 1
2025-12-20 18:04:19 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:179] - 处理工具配置: name=weimingminggongdefangshizuoliu001_91bc43ee, description=3123123123...
2025-12-20 18:04:19 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:183] - 工具 weimingminggongdefangshizuoliu001_91bc43ee 的 inputSchema: {"type": "object", "properties": {"query": {"description": "问题", "type": "string", "format": "paragraph", "maxLength": 3000}}, "required": ["query"]}
2025-12-20 18:04:19 - lzwcai_workflow_to_mcp.main - INFO - [main.py:193] - ListTools 响应: 返回 1 个工具
2025-12-20 18:04:19 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-20 18:04:22 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x0000025DD0D21340>
2025-12-20 18:04:22 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest
2025-12-20 18:04:22 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type CallToolRequest
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.main - INFO - [main.py:203] - 收到 CallTool 请求: name=weimingminggongdefangshizuoliu001_91bc43ee, arguments={"query": "你好啊"}
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:216] - 找到工具配置: {
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.main - INFO - [main.py:220] - 使用工作流ID: 2002300699510763521
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.main - INFO - [main.py:228] - 执行工作流请求数据: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:150] - [执行工作流] URL: http://192.168.2.236:8088/open/workflow/execute
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:151] - [执行工作流] Token: wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:152] - [执行工作流] Headers: {"X-API-Key": "wf_buh230o9iaea4n6aefsddcexa7p27ydl", "Content-Type": "application/json", "Accept": "*/*"}
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:153] - [执行工作流] 请求参数: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:154] - [执行工作流] 超时时间: 300.0s
2025-12-20 18:04:22 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'POST']>
2025-12-20 18:04:22 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-20 18:04:22 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'POST']>
2025-12-20 18:04:22 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-20 18:04:22 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'POST']>
2025-12-20 18:04:24 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Trace-Id', b'62311551-e7ab-4d5d-adef-f59b1969a4cf'), (b'X-RateLimit-Limit', b'100'), (b'X-RateLimit-Remaining', b'99'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json;charset=UTF-8'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Sat, 20 Dec 2025 10:04:22 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-20 18:04:24 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.2.236:8088/open/workflow/execute "HTTP/1.1 200 "
2025-12-20 18:04:24 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'POST']>
2025-12-20 18:04:24 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-20 18:04:24 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-20 18:04:24 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:164] - [API响应] HTTP 200
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:165] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-trace-id': '62311551-e7ab-4d5d-adef-f59b1969a4cf', 'x-ratelimit-limit': '100', 'x-ratelimit-remaining': '99', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;charset=UTF-8', 'transfer-encoding': 'chunked', 'date': 'Sat, 20 Dec 2025 10:04:22 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:170] - [API响应] 执行工作流成功
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:171] - [API响应] Body: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "e6dcd942-1592-45bb-8af7-d7d25df338ed",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 2.206175,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好呀!✨ 很高兴见到你!今天过得怎么样呀?希望你度过了愉快的一天。我今天刚整理完知识库,准备了很多有趣的话题和实用的信息,希望能和你一起探讨、学习。不知道你今天想聊些什么呢?无论是有趣的故事、需要解决的问题,还是纯粹想聊聊日常,我都很乐意陪伴你聊天哦!😊"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好呀!✨ 很高兴见到你!今天过得怎么样呀?希望你度过了愉快的一天。我今天刚整理完知识库,准备了很多有趣的话题和实用的信息,希望能和你一起探讨、学习。不知道你今天想聊些什么呢?无论是有趣的故事、需要解决的问题,还是纯粹想聊聊日常,我都很乐意陪伴你聊天哦!😊"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/e6dcd942-1592-45bb-8af7-d7d25df338ed.json"
}
}
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.main - INFO - [main.py:233] - 工作流执行成功: 2002300699510763521
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:234] - 工作流执行结果: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "e6dcd942-1592-45bb-8af7-d7d25df338ed",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 2.206175,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好呀!✨ 很高兴见到你!今天过得怎么样呀?希望你度过了愉快的一天。我今天刚整理完知识库,准备了很多有趣的话题和实用的信息,希望能和你一起探讨、学习。不知道你今天想聊些什么呢?无论是有趣的故事、需要解决的问题,还是纯粹想聊聊日常,我都很乐意陪伴你聊天哦!😊"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好呀!✨ 很高兴见到你!今天过得怎么样呀?希望你度过了愉快的一天。我今天刚整理完知识库,准备了很多有趣的话题和实用的信息,希望能和你一起探讨、学习。不知道你今天想聊些什么呢?无论是有趣的故事、需要解决的问题,还是纯粹想聊聊日常,我都很乐意陪伴你聊天哦!😊"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/e6dcd942-1592-45bb-8af7-d7d25df338ed.json"
}
}
2025-12-20 18:04:24 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-23 18:19:55 - root - INFO - [logger_config.py:117] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\logs
2025-12-23 18:19:55 - mcp.server.lowlevel.server - DEBUG - [server.py:154] - Initializing server 'workflow_mcp_server'
2025-12-23 18:19:55 - mcp.server.lowlevel.server - DEBUG - [server.py:380] - Registering handler for ListToolsRequest
2025-12-23 18:19:55 - mcp.server.lowlevel.server - DEBUG - [server.py:441] - Registering handler for CallToolRequest
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:272] - ==================================================
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:273] - Workflow MCP Server 启动
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:274] - ==================================================
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:279] - 命令行参数: {'mode': 'api', 'json_path': None, 'workflow_id': None}
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:282] - 使用模式: api
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:103] - ApiLoader 初始化工作流ID: 2002300699510763521
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:111] - 开始从 API 加载工作流配置工作流ID: 2002300699510763521
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:56] - [客户端初始化] base_url=http://192.168.2.236:8088
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:57] - [客户端初始化] token=wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:58] - [客户端初始化] execute_timeout=300.0s
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:89] - [API请求] GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:90] - [API请求] Headers: {'X-API-Key': 'wf_buh230o9iaea4n6aefsddcexa7p27ydl'}
2025-12-23 18:19:55 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.started host='192.168.2.236' port=8088 local_address=None timeout=30.0 socket_options=None
2025-12-23 18:19:55 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x000001E350E119A0>
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'GET']>
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'GET']>
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'GET']>
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Tue, 23 Dec 2025 10:19:54 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-23 18:19:55 - httpx - INFO - [_client.py:1025] - HTTP Request: GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521 "HTTP/1.1 200 "
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'GET']>
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:97] - [API响应] HTTP 200
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:98] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'date': 'Tue, 23 Dec 2025 10:19:54 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:103] - [API响应] 获取工作流配置成功: workflow_id=2002300699510763521
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:104] - [API响应] Body: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:116] - API 响应原始数据: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:124] - API 响应 data 字段: [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:135] - 从 API 加载工作流配置成功工作流ID: 2002300699510763521, 配置数量: 1
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:165] - 已加载 1 个工具配置
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:290] - 开始运行 MCP Server (stdio 模式)
2025-12-23 18:19:55 - asyncio - DEBUG - [proactor_events.py:634] - Using proactor: IocpProactor
2025-12-23 18:19:55 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: root=InitializedNotification(method='notifications/initialized', params=None, jsonrpc='2.0')
2025-12-23 18:19:56 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x000001E350E2DC40>
2025-12-23 18:19:56 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest
2025-12-23 18:19:56 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type ListToolsRequest
2025-12-23 18:19:56 - lzwcai_workflow_to_mcp.main - INFO - [main.py:171] - 收到 ListTools 请求,当前配置数量: 1
2025-12-23 18:19:56 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:179] - 处理工具配置: name=weimingminggongdefangshizuoliu001_91bc43ee, description=3123123123...
2025-12-23 18:19:56 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:183] - 工具 weimingminggongdefangshizuoliu001_91bc43ee 的 inputSchema: {"type": "object", "properties": {"query": {"description": "问题", "type": "string", "format": "paragraph", "maxLength": 3000}}, "required": ["query"]}
2025-12-23 18:19:56 - lzwcai_workflow_to_mcp.main - INFO - [main.py:193] - ListTools 响应: 返回 1 个工具
2025-12-23 18:19:56 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-23 18:20:00 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x000001E350DDA3C0>
2025-12-23 18:20:00 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest
2025-12-23 18:20:00 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type CallToolRequest
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.main - INFO - [main.py:203] - 收到 CallTool 请求: name=weimingminggongdefangshizuoliu001_91bc43ee, arguments={"query": "你好啊"}
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:216] - 找到工具配置: {
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.main - INFO - [main.py:220] - 使用工作流ID: 2002300699510763521
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.main - INFO - [main.py:228] - 执行工作流请求数据: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:150] - [执行工作流] URL: http://192.168.2.236:8088/open/workflow/execute
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:151] - [执行工作流] Token: wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:152] - [执行工作流] Headers: {"X-API-Key": "wf_buh230o9iaea4n6aefsddcexa7p27ydl", "Content-Type": "application/json", "Accept": "*/*"}
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:153] - [执行工作流] 请求参数: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:154] - [执行工作流] 超时时间: 300.0s
2025-12-23 18:20:00 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'POST']>
2025-12-23 18:20:00 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-23 18:20:00 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'POST']>
2025-12-23 18:20:00 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-23 18:20:00 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'POST']>
2025-12-23 18:20:01 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Trace-Id', b'2c574f18-2d6b-4580-bd8a-eda8c94c26eb'), (b'X-RateLimit-Limit', b'100'), (b'X-RateLimit-Remaining', b'99'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json;charset=UTF-8'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Tue, 23 Dec 2025 10:20:00 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-23 18:20:01 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.2.236:8088/open/workflow/execute "HTTP/1.1 200 "
2025-12-23 18:20:01 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'POST']>
2025-12-23 18:20:01 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-23 18:20:01 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-23 18:20:01 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:164] - [API响应] HTTP 200
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:165] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-trace-id': '2c574f18-2d6b-4580-bd8a-eda8c94c26eb', 'x-ratelimit-limit': '100', 'x-ratelimit-remaining': '99', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;charset=UTF-8', 'transfer-encoding': 'chunked', 'date': 'Tue, 23 Dec 2025 10:20:00 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:170] - [API响应] 执行工作流成功
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:171] - [API响应] Body: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "d8ff9fc7-530c-4b77-a8a8-07d51aa79870",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 0.926932,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好!看起来你可能感兴趣于某方面,但还没具体说明?如果需要帮助,尽管告诉我,我很乐意帮忙解答或讨论各种话题!😊"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好!看起来你可能感兴趣于某方面,但还没具体说明?如果需要帮助,尽管告诉我,我很乐意帮忙解答或讨论各种话题!😊"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/d8ff9fc7-530c-4b77-a8a8-07d51aa79870.json"
}
}
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.main - INFO - [main.py:233] - 工作流执行成功: 2002300699510763521
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:234] - 工作流执行结果: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "d8ff9fc7-530c-4b77-a8a8-07d51aa79870",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 0.926932,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好!看起来你可能感兴趣于某方面,但还没具体说明?如果需要帮助,尽管告诉我,我很乐意帮忙解答或讨论各种话题!😊"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好!看起来你可能感兴趣于某方面,但还没具体说明?如果需要帮助,尽管告诉我,我很乐意帮忙解答或讨论各种话题!😊"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/d8ff9fc7-530c-4b77-a8a8-07d51aa79870.json"
}
}
2025-12-23 18:20:01 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-23 18:24:44 - root - INFO - [logger_config.py:117] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\logs
2025-12-23 18:24:44 - mcp.server.lowlevel.server - DEBUG - [server.py:154] - Initializing server 'workflow_mcp_server'
2025-12-23 18:24:44 - mcp.server.lowlevel.server - DEBUG - [server.py:380] - Registering handler for ListToolsRequest
2025-12-23 18:24:44 - mcp.server.lowlevel.server - DEBUG - [server.py:441] - Registering handler for CallToolRequest
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:275] - ==================================================
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:276] - Workflow MCP Server 启动
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:277] - ==================================================
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:282] - 命令行参数: {'mode': 'api', 'json_path': None, 'workflow_id': None}
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:285] - 使用模式: api
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:103] - ApiLoader 初始化工作流ID: 2002300699510763521
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:111] - 开始从 API 加载工作流配置工作流ID: 2002300699510763521
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:56] - [客户端初始化] base_url=http://192.168.2.236:8088
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:57] - [客户端初始化] token=wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:58] - [客户端初始化] execute_timeout=300.0s
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:89] - [API请求] GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:90] - [API请求] Headers: {'X-API-Key': 'wf_buh230o9iaea4n6aefsddcexa7p27ydl'}
2025-12-23 18:24:44 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.started host='192.168.2.236' port=8088 local_address=None timeout=30.0 socket_options=None
2025-12-23 18:24:44 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x000001B44A89F380>
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'GET']>
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'GET']>
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'GET']>
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Tue, 23 Dec 2025 10:24:43 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-23 18:24:44 - httpx - INFO - [_client.py:1025] - HTTP Request: GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521 "HTTP/1.1 200 "
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'GET']>
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:97] - [API响应] HTTP 200
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:98] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'date': 'Tue, 23 Dec 2025 10:24:43 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:103] - [API响应] 获取工作流配置成功: workflow_id=2002300699510763521
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:104] - [API响应] Body: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:116] - API 响应原始数据: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:124] - API 响应 data 字段: [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:135] - 从 API 加载工作流配置成功工作流ID: 2002300699510763521, 配置数量: 1
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:165] - 已加载 1 个工具配置
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:293] - 开始运行 MCP Server (stdio 模式)
2025-12-23 18:24:44 - asyncio - DEBUG - [proactor_events.py:634] - Using proactor: IocpProactor
2025-12-23 18:24:44 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: root=InitializedNotification(method='notifications/initialized', params=None, jsonrpc='2.0')
2025-12-23 18:24:45 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x000001B44A911070>
2025-12-23 18:24:45 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest
2025-12-23 18:24:45 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type ListToolsRequest
2025-12-23 18:24:45 - lzwcai_workflow_to_mcp.main - INFO - [main.py:171] - 收到 ListTools 请求,当前配置数量: 1
2025-12-23 18:24:45 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:179] - 处理工具配置: name=weimingminggongdefangshizuoliu001_91bc43ee, description=3123123123...
2025-12-23 18:24:45 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:183] - 工具 weimingminggongdefangshizuoliu001_91bc43ee 的 inputSchema: {"type": "object", "properties": {"query": {"description": "问题", "type": "string", "format": "paragraph", "maxLength": 3000}}, "required": ["query"]}
2025-12-23 18:24:45 - lzwcai_workflow_to_mcp.main - INFO - [main.py:193] - ListTools 响应: 返回 1 个工具
2025-12-23 18:24:45 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-23 18:24:48 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x000001B44A8D15E0>
2025-12-23 18:24:48 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest
2025-12-23 18:24:48 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type CallToolRequest
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.main - INFO - [main.py:203] - 收到 CallTool 请求: name=weimingminggongdefangshizuoliu001_91bc43ee, arguments={"query": "你好啊"}
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:216] - 找到工具配置: {
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.main - INFO - [main.py:220] - 使用工作流ID: 2002300699510763521
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.main - INFO - [main.py:228] - 执行工作流请求数据: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:150] - [执行工作流] URL: http://192.168.2.236:8088/open/workflow/execute
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:151] - [执行工作流] Token: wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:152] - [执行工作流] Headers: {"X-API-Key": "wf_buh230o9iaea4n6aefsddcexa7p27ydl", "Content-Type": "application/json", "Accept": "*/*"}
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:153] - [执行工作流] 请求参数: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:154] - [执行工作流] 超时时间: 300.0s
2025-12-23 18:24:48 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'POST']>
2025-12-23 18:24:48 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-23 18:24:48 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'POST']>
2025-12-23 18:24:48 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-23 18:24:48 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'POST']>
2025-12-23 18:24:49 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Trace-Id', b'282e2c5e-e68e-48f5-bfdb-1e04ffc18682'), (b'X-RateLimit-Limit', b'100'), (b'X-RateLimit-Remaining', b'99'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json;charset=UTF-8'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Tue, 23 Dec 2025 10:24:48 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-23 18:24:49 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.2.236:8088/open/workflow/execute "HTTP/1.1 200 "
2025-12-23 18:24:49 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'POST']>
2025-12-23 18:24:49 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-23 18:24:49 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-23 18:24:49 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:164] - [API响应] HTTP 200
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:165] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-trace-id': '282e2c5e-e68e-48f5-bfdb-1e04ffc18682', 'x-ratelimit-limit': '100', 'x-ratelimit-remaining': '99', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;charset=UTF-8', 'transfer-encoding': 'chunked', 'date': 'Tue, 23 Dec 2025 10:24:48 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:170] - [API响应] 执行工作流成功
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:171] - [API响应] Body: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "1f154317-ca19-4073-b7b5-a2b2beb38a3f",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 1.146157,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好!很高兴见到你。我注意到你用了特别的表情符号,是想表达亲切吗?🤗 如果你有任何问题或需要帮助,随时告诉我哦。今天想聊些什么呢?"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好!很高兴见到你。我注意到你用了特别的表情符号,是想表达亲切吗?🤗 如果你有任何问题或需要帮助,随时告诉我哦。今天想聊些什么呢?"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/1f154317-ca19-4073-b7b5-a2b2beb38a3f.json"
}
}
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.main - INFO - [main.py:233] - 工作流执行成功: 2002300699510763521
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:234] - 工作流执行结果: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "1f154317-ca19-4073-b7b5-a2b2beb38a3f",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 1.146157,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好!很高兴见到你。我注意到你用了特别的表情符号,是想表达亲切吗?🤗 如果你有任何问题或需要帮助,随时告诉我哦。今天想聊些什么呢?"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好!很高兴见到你。我注意到你用了特别的表情符号,是想表达亲切吗?🤗 如果你有任何问题或需要帮助,随时告诉我哦。今天想聊些什么呢?"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/1f154317-ca19-4073-b7b5-a2b2beb38a3f.json"
}
}
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:294] - 提取 final_output 最后节点成功: key=f54a21ba-e3a3-461e-9a6b-e952087f4a5b
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:295] - 提取结果: {"q": "你好!很高兴见到你。我注意到你用了特别的表情符号,是想表达亲切吗?🤗 如果你有任何问题或需要帮助,随时告诉我哦。今天想聊些什么呢?"}
2025-12-23 18:24:49 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent

View File

@@ -1,506 +0,0 @@
2025-12-23 18:19:55 - root - INFO - [logger_config.py:117] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\logs
2025-12-23 18:19:55 - mcp.server.lowlevel.server - DEBUG - [server.py:154] - Initializing server 'workflow_mcp_server'
2025-12-23 18:19:55 - mcp.server.lowlevel.server - DEBUG - [server.py:380] - Registering handler for ListToolsRequest
2025-12-23 18:19:55 - mcp.server.lowlevel.server - DEBUG - [server.py:441] - Registering handler for CallToolRequest
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:272] - ==================================================
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:273] - Workflow MCP Server 启动
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:274] - ==================================================
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:279] - 命令行参数: {'mode': 'api', 'json_path': None, 'workflow_id': None}
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:282] - 使用模式: api
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:103] - ApiLoader 初始化工作流ID: 2002300699510763521
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:111] - 开始从 API 加载工作流配置工作流ID: 2002300699510763521
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:56] - [客户端初始化] base_url=http://192.168.2.236:8088
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:57] - [客户端初始化] token=wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:58] - [客户端初始化] execute_timeout=300.0s
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:89] - [API请求] GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:90] - [API请求] Headers: {'X-API-Key': 'wf_buh230o9iaea4n6aefsddcexa7p27ydl'}
2025-12-23 18:19:55 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.started host='192.168.2.236' port=8088 local_address=None timeout=30.0 socket_options=None
2025-12-23 18:19:55 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x000001E350E119A0>
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'GET']>
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'GET']>
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'GET']>
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Tue, 23 Dec 2025 10:19:54 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-23 18:19:55 - httpx - INFO - [_client.py:1025] - HTTP Request: GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521 "HTTP/1.1 200 "
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'GET']>
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-23 18:19:55 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:97] - [API响应] HTTP 200
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:98] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'date': 'Tue, 23 Dec 2025 10:19:54 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:103] - [API响应] 获取工作流配置成功: workflow_id=2002300699510763521
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:104] - [API响应] Body: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:116] - API 响应原始数据: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:124] - API 响应 data 字段: [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:135] - 从 API 加载工作流配置成功工作流ID: 2002300699510763521, 配置数量: 1
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:165] - 已加载 1 个工具配置
2025-12-23 18:19:55 - lzwcai_workflow_to_mcp.main - INFO - [main.py:290] - 开始运行 MCP Server (stdio 模式)
2025-12-23 18:19:55 - asyncio - DEBUG - [proactor_events.py:634] - Using proactor: IocpProactor
2025-12-23 18:19:55 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: root=InitializedNotification(method='notifications/initialized', params=None, jsonrpc='2.0')
2025-12-23 18:19:56 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x000001E350E2DC40>
2025-12-23 18:19:56 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest
2025-12-23 18:19:56 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type ListToolsRequest
2025-12-23 18:19:56 - lzwcai_workflow_to_mcp.main - INFO - [main.py:171] - 收到 ListTools 请求,当前配置数量: 1
2025-12-23 18:19:56 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:179] - 处理工具配置: name=weimingminggongdefangshizuoliu001_91bc43ee, description=3123123123...
2025-12-23 18:19:56 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:183] - 工具 weimingminggongdefangshizuoliu001_91bc43ee 的 inputSchema: {"type": "object", "properties": {"query": {"description": "问题", "type": "string", "format": "paragraph", "maxLength": 3000}}, "required": ["query"]}
2025-12-23 18:19:56 - lzwcai_workflow_to_mcp.main - INFO - [main.py:193] - ListTools 响应: 返回 1 个工具
2025-12-23 18:19:56 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-23 18:20:00 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x000001E350DDA3C0>
2025-12-23 18:20:00 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest
2025-12-23 18:20:00 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type CallToolRequest
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.main - INFO - [main.py:203] - 收到 CallTool 请求: name=weimingminggongdefangshizuoliu001_91bc43ee, arguments={"query": "你好啊"}
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:216] - 找到工具配置: {
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.main - INFO - [main.py:220] - 使用工作流ID: 2002300699510763521
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.main - INFO - [main.py:228] - 执行工作流请求数据: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:150] - [执行工作流] URL: http://192.168.2.236:8088/open/workflow/execute
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:151] - [执行工作流] Token: wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:152] - [执行工作流] Headers: {"X-API-Key": "wf_buh230o9iaea4n6aefsddcexa7p27ydl", "Content-Type": "application/json", "Accept": "*/*"}
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:153] - [执行工作流] 请求参数: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-23 18:20:00 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:154] - [执行工作流] 超时时间: 300.0s
2025-12-23 18:20:00 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'POST']>
2025-12-23 18:20:00 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-23 18:20:00 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'POST']>
2025-12-23 18:20:00 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-23 18:20:00 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'POST']>
2025-12-23 18:20:01 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Trace-Id', b'2c574f18-2d6b-4580-bd8a-eda8c94c26eb'), (b'X-RateLimit-Limit', b'100'), (b'X-RateLimit-Remaining', b'99'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json;charset=UTF-8'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Tue, 23 Dec 2025 10:20:00 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-23 18:20:01 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.2.236:8088/open/workflow/execute "HTTP/1.1 200 "
2025-12-23 18:20:01 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'POST']>
2025-12-23 18:20:01 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-23 18:20:01 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-23 18:20:01 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:164] - [API响应] HTTP 200
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:165] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-trace-id': '2c574f18-2d6b-4580-bd8a-eda8c94c26eb', 'x-ratelimit-limit': '100', 'x-ratelimit-remaining': '99', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;charset=UTF-8', 'transfer-encoding': 'chunked', 'date': 'Tue, 23 Dec 2025 10:20:00 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:170] - [API响应] 执行工作流成功
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:171] - [API响应] Body: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "d8ff9fc7-530c-4b77-a8a8-07d51aa79870",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 0.926932,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好!看起来你可能感兴趣于某方面,但还没具体说明?如果需要帮助,尽管告诉我,我很乐意帮忙解答或讨论各种话题!😊"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好!看起来你可能感兴趣于某方面,但还没具体说明?如果需要帮助,尽管告诉我,我很乐意帮忙解答或讨论各种话题!😊"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/d8ff9fc7-530c-4b77-a8a8-07d51aa79870.json"
}
}
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.main - INFO - [main.py:233] - 工作流执行成功: 2002300699510763521
2025-12-23 18:20:01 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:234] - 工作流执行结果: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "d8ff9fc7-530c-4b77-a8a8-07d51aa79870",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 0.926932,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好!看起来你可能感兴趣于某方面,但还没具体说明?如果需要帮助,尽管告诉我,我很乐意帮忙解答或讨论各种话题!😊"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好!看起来你可能感兴趣于某方面,但还没具体说明?如果需要帮助,尽管告诉我,我很乐意帮忙解答或讨论各种话题!😊"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/d8ff9fc7-530c-4b77-a8a8-07d51aa79870.json"
}
}
2025-12-23 18:20:01 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-23 18:24:44 - root - INFO - [logger_config.py:117] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\logs
2025-12-23 18:24:44 - mcp.server.lowlevel.server - DEBUG - [server.py:154] - Initializing server 'workflow_mcp_server'
2025-12-23 18:24:44 - mcp.server.lowlevel.server - DEBUG - [server.py:380] - Registering handler for ListToolsRequest
2025-12-23 18:24:44 - mcp.server.lowlevel.server - DEBUG - [server.py:441] - Registering handler for CallToolRequest
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:275] - ==================================================
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:276] - Workflow MCP Server 启动
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:277] - ==================================================
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:282] - 命令行参数: {'mode': 'api', 'json_path': None, 'workflow_id': None}
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:285] - 使用模式: api
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:103] - ApiLoader 初始化工作流ID: 2002300699510763521
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:111] - 开始从 API 加载工作流配置工作流ID: 2002300699510763521
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:56] - [客户端初始化] base_url=http://192.168.2.236:8088
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:57] - [客户端初始化] token=wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:58] - [客户端初始化] execute_timeout=300.0s
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:89] - [API请求] GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:90] - [API请求] Headers: {'X-API-Key': 'wf_buh230o9iaea4n6aefsddcexa7p27ydl'}
2025-12-23 18:24:44 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.started host='192.168.2.236' port=8088 local_address=None timeout=30.0 socket_options=None
2025-12-23 18:24:44 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x000001B44A89F380>
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'GET']>
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'GET']>
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'GET']>
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Tue, 23 Dec 2025 10:24:43 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-23 18:24:44 - httpx - INFO - [_client.py:1025] - HTTP Request: GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521 "HTTP/1.1 200 "
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'GET']>
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-23 18:24:44 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:97] - [API响应] HTTP 200
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:98] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'date': 'Tue, 23 Dec 2025 10:24:43 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:103] - [API响应] 获取工作流配置成功: workflow_id=2002300699510763521
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:104] - [API响应] Body: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:116] - API 响应原始数据: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:124] - API 响应 data 字段: [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:135] - 从 API 加载工作流配置成功工作流ID: 2002300699510763521, 配置数量: 1
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:165] - 已加载 1 个工具配置
2025-12-23 18:24:44 - lzwcai_workflow_to_mcp.main - INFO - [main.py:293] - 开始运行 MCP Server (stdio 模式)
2025-12-23 18:24:44 - asyncio - DEBUG - [proactor_events.py:634] - Using proactor: IocpProactor
2025-12-23 18:24:44 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: root=InitializedNotification(method='notifications/initialized', params=None, jsonrpc='2.0')
2025-12-23 18:24:45 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x000001B44A911070>
2025-12-23 18:24:45 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest
2025-12-23 18:24:45 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type ListToolsRequest
2025-12-23 18:24:45 - lzwcai_workflow_to_mcp.main - INFO - [main.py:171] - 收到 ListTools 请求,当前配置数量: 1
2025-12-23 18:24:45 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:179] - 处理工具配置: name=weimingminggongdefangshizuoliu001_91bc43ee, description=3123123123...
2025-12-23 18:24:45 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:183] - 工具 weimingminggongdefangshizuoliu001_91bc43ee 的 inputSchema: {"type": "object", "properties": {"query": {"description": "问题", "type": "string", "format": "paragraph", "maxLength": 3000}}, "required": ["query"]}
2025-12-23 18:24:45 - lzwcai_workflow_to_mcp.main - INFO - [main.py:193] - ListTools 响应: 返回 1 个工具
2025-12-23 18:24:45 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-23 18:24:48 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x000001B44A8D15E0>
2025-12-23 18:24:48 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest
2025-12-23 18:24:48 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type CallToolRequest
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.main - INFO - [main.py:203] - 收到 CallTool 请求: name=weimingminggongdefangshizuoliu001_91bc43ee, arguments={"query": "你好啊"}
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:216] - 找到工具配置: {
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 18:31:56",
"serviceId": "2002300699804364801",
"uniqueName": "3123123123-workflow服务_weimingminggongdefangshizuoliu001_91bc43ee",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": "{\"type\":\"object\",\"properties\":{\"query\":{\"description\":\"问题\",\"type\":\"string\",\"format\":\"paragraph\",\"maxLength\":3000}},\"required\":[\"query\"]}",
"outputJsonSchema": null,
"lastExecutionTime": null
}
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.main - INFO - [main.py:220] - 使用工作流ID: 2002300699510763521
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.main - INFO - [main.py:228] - 执行工作流请求数据: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:150] - [执行工作流] URL: http://192.168.2.236:8088/open/workflow/execute
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:151] - [执行工作流] Token: wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:152] - [执行工作流] Headers: {"X-API-Key": "wf_buh230o9iaea4n6aefsddcexa7p27ydl", "Content-Type": "application/json", "Accept": "*/*"}
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:153] - [执行工作流] 请求参数: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-23 18:24:48 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:154] - [执行工作流] 超时时间: 300.0s
2025-12-23 18:24:48 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'POST']>
2025-12-23 18:24:48 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-23 18:24:48 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'POST']>
2025-12-23 18:24:48 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-23 18:24:48 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'POST']>
2025-12-23 18:24:49 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Trace-Id', b'282e2c5e-e68e-48f5-bfdb-1e04ffc18682'), (b'X-RateLimit-Limit', b'100'), (b'X-RateLimit-Remaining', b'99'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json;charset=UTF-8'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Tue, 23 Dec 2025 10:24:48 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-23 18:24:49 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.2.236:8088/open/workflow/execute "HTTP/1.1 200 "
2025-12-23 18:24:49 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'POST']>
2025-12-23 18:24:49 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-23 18:24:49 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-23 18:24:49 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:164] - [API响应] HTTP 200
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:165] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-trace-id': '282e2c5e-e68e-48f5-bfdb-1e04ffc18682', 'x-ratelimit-limit': '100', 'x-ratelimit-remaining': '99', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;charset=UTF-8', 'transfer-encoding': 'chunked', 'date': 'Tue, 23 Dec 2025 10:24:48 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:170] - [API响应] 执行工作流成功
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:171] - [API响应] Body: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "1f154317-ca19-4073-b7b5-a2b2beb38a3f",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 1.146157,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好!很高兴见到你。我注意到你用了特别的表情符号,是想表达亲切吗?🤗 如果你有任何问题或需要帮助,随时告诉我哦。今天想聊些什么呢?"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好!很高兴见到你。我注意到你用了特别的表情符号,是想表达亲切吗?🤗 如果你有任何问题或需要帮助,随时告诉我哦。今天想聊些什么呢?"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/1f154317-ca19-4073-b7b5-a2b2beb38a3f.json"
}
}
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.main - INFO - [main.py:233] - 工作流执行成功: 2002300699510763521
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:234] - 工作流执行结果: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "1f154317-ca19-4073-b7b5-a2b2beb38a3f",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 1.146157,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好!很高兴见到你。我注意到你用了特别的表情符号,是想表达亲切吗?🤗 如果你有任何问题或需要帮助,随时告诉我哦。今天想聊些什么呢?"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好!很高兴见到你。我注意到你用了特别的表情符号,是想表达亲切吗?🤗 如果你有任何问题或需要帮助,随时告诉我哦。今天想聊些什么呢?"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/1f154317-ca19-4073-b7b5-a2b2beb38a3f.json"
}
}
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:294] - 提取 final_output 最后节点成功: key=f54a21ba-e3a3-461e-9a6b-e952087f4a5b
2025-12-23 18:24:49 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:295] - 提取结果: {"q": "你好!很高兴见到你。我注意到你用了特别的表情符号,是想表达亲切吗?🤗 如果你有任何问题或需要帮助,随时告诉我哦。今天想聊些什么呢?"}
2025-12-23 18:24:49 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent

View File

@@ -1,473 +0,0 @@
2025-12-20 18:03:07 - root - INFO - [logger_config.py:117] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\logs
2025-12-20 18:03:07 - mcp.server.lowlevel.server - DEBUG - [server.py:154] - Initializing server 'workflow_mcp_server'
2025-12-20 18:03:07 - mcp.server.lowlevel.server - DEBUG - [server.py:380] - Registering handler for ListToolsRequest
2025-12-20 18:03:07 - mcp.server.lowlevel.server - DEBUG - [server.py:441] - Registering handler for CallToolRequest
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:272] - ==================================================
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:273] - Workflow MCP Server 启动
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:274] - ==================================================
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:279] - 命令行参数: {'mode': 'api', 'json_path': None, 'workflow_id': None}
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:282] - 使用模式: api
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:103] - ApiLoader 初始化工作流ID: 2002300699510763521
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:111] - 开始从 API 加载工作流配置工作流ID: 2002300699510763521
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:56] - [客户端初始化] base_url=http://192.168.2.236:8088
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:57] - [客户端初始化] token=wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:58] - [客户端初始化] execute_timeout=300.0s
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:89] - [API请求] GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:90] - [API请求] Headers: {'X-API-Key': 'Bearer wf_buh230o9iaea4n6aefsddcexa7p27ydl'}
2025-12-20 18:03:07 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.started host='192.168.2.236' port=8088 local_address=None timeout=30.0 socket_options=None
2025-12-20 18:03:07 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x00000155217CC380>
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'GET']>
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'GET']>
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'GET']>
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Sat, 20 Dec 2025 10:03:06 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-20 18:03:07 - httpx - INFO - [_client.py:1025] - HTTP Request: GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521 "HTTP/1.1 200 "
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'GET']>
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-20 18:03:07 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:97] - [API响应] HTTP 200
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:98] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'date': 'Sat, 20 Dec 2025 10:03:06 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:103] - [API响应] 获取工作流配置成功: workflow_id=2002300699510763521
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:104] - [API响应] Body: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:116] - API 响应原始数据: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:124] - API 响应 data 字段: [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:135] - 从 API 加载工作流配置成功工作流ID: 2002300699510763521, 配置数量: 1
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:165] - 已加载 1 个工具配置
2025-12-20 18:03:07 - lzwcai_workflow_to_mcp.main - INFO - [main.py:290] - 开始运行 MCP Server (stdio 模式)
2025-12-20 18:03:07 - asyncio - DEBUG - [proactor_events.py:634] - Using proactor: IocpProactor
2025-12-20 18:03:07 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: root=InitializedNotification(method='notifications/initialized', params=None, jsonrpc='2.0')
2025-12-20 18:03:08 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x000001552178D700>
2025-12-20 18:03:08 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest
2025-12-20 18:03:08 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type ListToolsRequest
2025-12-20 18:03:08 - lzwcai_workflow_to_mcp.main - INFO - [main.py:171] - 收到 ListTools 请求,当前配置数量: 1
2025-12-20 18:03:08 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:179] - 处理工具配置: name=weimingminggongdefangshizuoliu001_91bc43ee, description=3123123123...
2025-12-20 18:03:08 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:183] - 工具 weimingminggongdefangshizuoliu001_91bc43ee 的 inputSchema: {"type": "object", "properties": {"query": {"description": "问题", "type": "string", "format": "paragraph", "maxLength": 3000}}, "required": ["query"]}
2025-12-20 18:03:08 - lzwcai_workflow_to_mcp.main - INFO - [main.py:193] - ListTools 响应: 返回 1 个工具
2025-12-20 18:03:08 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-20 18:03:12 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x00000155218D4A70>
2025-12-20 18:03:12 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest
2025-12-20 18:03:12 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type CallToolRequest
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - INFO - [main.py:203] - 收到 CallTool 请求: name=weimingminggongdefangshizuoliu001_91bc43ee, arguments={"query": "你好啊"}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:216] - 找到工具配置: {
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - INFO - [main.py:220] - 使用工作流ID: 2002300699510763521
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - INFO - [main.py:228] - 执行工作流请求数据: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:150] - [执行工作流] URL: http://192.168.2.236:8088/open/workflow/execute
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:151] - [执行工作流] Token: wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:152] - [执行工作流] Headers: {"X-API-Key": "Bearer wf_buh230o9iaea4n6aefsddcexa7p27ydl", "Content-Type": "application/json", "Accept": "*/*"}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:153] - [执行工作流] 请求参数: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:154] - [执行工作流] 超时时间: 300.0s
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'POST']>
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'POST']>
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'POST']>
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 401, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Trace-Id', b'40f82dcb-2055-46b4-a9ae-1bbee5591306'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json;charset=UTF-8'), (b'Content-Length', b'61'), (b'Date', b'Sat, 20 Dec 2025 10:03:10 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-20 18:03:12 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.2.236:8088/open/workflow/execute "HTTP/1.1 401 "
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'POST']>
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-20 18:03:12 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:164] - [API响应] HTTP 401
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:165] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-trace-id': '40f82dcb-2055-46b4-a9ae-1bbee5591306', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;charset=UTF-8', 'content-length': '61', 'date': 'Sat, 20 Dec 2025 10:03:10 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - ERROR - [api_client.py:182] - [API错误] 执行工作流API请求失败 (HTTP 401): http://192.168.2.236:8088/open/workflow/execute
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - ERROR - [api_client.py:183] - [API错误] 响应内容: {"msg":"API Key无效","code":401,"errorCode":"UNAUTHORIZED"}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - ERROR - [main.py:236] - 工作流执行失败: 执行工作流API请求失败 (HTTP 401): http://192.168.2.236:8088/open/workflow/execute
Traceback (most recent call last):
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\utils\api_client.py", line 167, in execute_workflow
response.raise_for_status()
File "D:\anaconda3\Lib\site-packages\httpx\_models.py", line 829, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 ' for url 'http://192.168.2.236:8088/open/workflow/execute'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\main.py", line 232, in handle_call_tool
result = execute_workflow(request_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\utils\api_client.py", line 268, in execute_workflow
return default_client.execute_workflow(request_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\utils\api_client.py", line 184, in execute_workflow
raise Exception(error_msg)
Exception: 执行工作流API请求失败 (HTTP 401): http://192.168.2.236:8088/open/workflow/execute
2025-12-20 18:03:12 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-20 18:04:18 - root - INFO - [logger_config.py:117] - 日志系统初始化完成 - 日志目录: E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\logs
2025-12-20 18:04:18 - mcp.server.lowlevel.server - DEBUG - [server.py:154] - Initializing server 'workflow_mcp_server'
2025-12-20 18:04:18 - mcp.server.lowlevel.server - DEBUG - [server.py:380] - Registering handler for ListToolsRequest
2025-12-20 18:04:18 - mcp.server.lowlevel.server - DEBUG - [server.py:441] - Registering handler for CallToolRequest
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:272] - ==================================================
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:273] - Workflow MCP Server 启动
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:274] - ==================================================
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:279] - 命令行参数: {'mode': 'api', 'json_path': None, 'workflow_id': None}
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:282] - 使用模式: api
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:103] - ApiLoader 初始化工作流ID: 2002300699510763521
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:111] - 开始从 API 加载工作流配置工作流ID: 2002300699510763521
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:56] - [客户端初始化] base_url=http://192.168.2.236:8088
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:57] - [客户端初始化] token=wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:58] - [客户端初始化] execute_timeout=300.0s
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:89] - [API请求] GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:90] - [API请求] Headers: {'X-API-Key': 'wf_buh230o9iaea4n6aefsddcexa7p27ydl'}
2025-12-20 18:04:18 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.started host='192.168.2.236' port=8088 local_address=None timeout=30.0 socket_options=None
2025-12-20 18:04:18 - httpcore.connection - DEBUG - [_trace.py:45] - connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x0000025DD0ED1F70>
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'GET']>
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'GET']>
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'GET']>
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Sat, 20 Dec 2025 10:04:16 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-20 18:04:18 - httpx - INFO - [_client.py:1025] - HTTP Request: GET http://192.168.2.236:8088/system/workflowManage/getByWorkflowId/2002300699510763521 "HTTP/1.1 200 "
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'GET']>
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-20 18:04:18 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:97] - [API响应] HTTP 200
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:98] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json', 'transfer-encoding': 'chunked', 'date': 'Sat, 20 Dec 2025 10:04:16 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:103] - [API响应] 获取工作流配置成功: workflow_id=2002300699510763521
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:104] - [API响应] Body: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:116] - API 响应原始数据: {
"msg": "查询成功",
"code": 200,
"data": [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
}
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:124] - API 响应 data 字段: [
{
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
]
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:135] - 从 API 加载工作流配置成功工作流ID: 2002300699510763521, 配置数量: 1
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:165] - 已加载 1 个工具配置
2025-12-20 18:04:18 - lzwcai_workflow_to_mcp.main - INFO - [main.py:290] - 开始运行 MCP Server (stdio 模式)
2025-12-20 18:04:18 - asyncio - DEBUG - [proactor_events.py:634] - Using proactor: IocpProactor
2025-12-20 18:04:18 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: root=InitializedNotification(method='notifications/initialized', params=None, jsonrpc='2.0')
2025-12-20 18:04:19 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x0000025DCF92FF50>
2025-12-20 18:04:19 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type ListToolsRequest
2025-12-20 18:04:19 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type ListToolsRequest
2025-12-20 18:04:19 - lzwcai_workflow_to_mcp.main - INFO - [main.py:171] - 收到 ListTools 请求,当前配置数量: 1
2025-12-20 18:04:19 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:179] - 处理工具配置: name=weimingminggongdefangshizuoliu001_91bc43ee, description=3123123123...
2025-12-20 18:04:19 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:183] - 工具 weimingminggongdefangshizuoliu001_91bc43ee 的 inputSchema: {"type": "object", "properties": {"query": {"description": "问题", "type": "string", "format": "paragraph", "maxLength": 3000}}, "required": ["query"]}
2025-12-20 18:04:19 - lzwcai_workflow_to_mcp.main - INFO - [main.py:193] - ListTools 响应: 返回 1 个工具
2025-12-20 18:04:19 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent
2025-12-20 18:04:22 - mcp.server.lowlevel.server - DEBUG - [server.py:582] - Received message: <mcp.shared.session.RequestResponder object at 0x0000025DD0D21340>
2025-12-20 18:04:22 - mcp.server.lowlevel.server - INFO - [server.py:619] - Processing request of type CallToolRequest
2025-12-20 18:04:22 - mcp.server.lowlevel.server - DEBUG - [server.py:621] - Dispatching request of type CallToolRequest
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.main - INFO - [main.py:203] - 收到 CallTool 请求: name=weimingminggongdefangshizuoliu001_91bc43ee, arguments={"query": "你好啊"}
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:216] - 找到工具配置: {
"id": "2002300699812753409",
"createBy": "yy8z9",
"createTime": "2025-12-20 16:51:02",
"updateBy": "yy8z9",
"updateTime": "2025-12-20 17:59:26",
"serviceId": "2002300699804364801",
"uniqueName": "未命名工的方式作流001",
"name": "weimingminggongdefangshizuoliu001_91bc43ee",
"description": "3123123123",
"visualizable": 0,
"toolPrompt": null,
"toolType": "api",
"datasourceId": null,
"sqlTemplate": null,
"sqlParams": "[{\"type\":\"paragraph\",\"name\":\"query\",\"displayName\":\"问题\",\"maxLength\":3000,\"defaultValue\":\"\",\"required\":true}]",
"resultType": null,
"sourceType": null,
"trainingTaskId": null,
"tableMetadataIds": null,
"executionCount": 0,
"visualizationConfigs": null,
"inputJsonSchema": null,
"outputJsonSchema": null,
"lastExecutionTime": null
}
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.main - INFO - [main.py:220] - 使用工作流ID: 2002300699510763521
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.main - INFO - [main.py:228] - 执行工作流请求数据: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:150] - [执行工作流] URL: http://192.168.2.236:8088/open/workflow/execute
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:151] - [执行工作流] Token: wf_buh230o9iaea4n6aefsddcexa7p27ydl
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:152] - [执行工作流] Headers: {"X-API-Key": "wf_buh230o9iaea4n6aefsddcexa7p27ydl", "Content-Type": "application/json", "Accept": "*/*"}
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:153] - [执行工作流] 请求参数: {
"workflowId": "2002300699510763521",
"inputs": {
"query": "你好啊"
}
}
2025-12-20 18:04:22 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:154] - [执行工作流] 超时时间: 300.0s
2025-12-20 18:04:22 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.started request=<Request [b'POST']>
2025-12-20 18:04:22 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_headers.complete
2025-12-20 18:04:22 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.started request=<Request [b'POST']>
2025-12-20 18:04:22 - httpcore.http11 - DEBUG - [_trace.py:45] - send_request_body.complete
2025-12-20 18:04:22 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.started request=<Request [b'POST']>
2025-12-20 18:04:24 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'', [(b'Vary', b'Origin'), (b'Vary', b'Access-Control-Request-Method'), (b'Vary', b'Access-Control-Request-Headers'), (b'X-Trace-Id', b'62311551-e7ab-4d5d-adef-f59b1969a4cf'), (b'X-RateLimit-Limit', b'100'), (b'X-RateLimit-Remaining', b'99'), (b'X-Content-Type-Options', b'nosniff'), (b'X-XSS-Protection', b'1; mode=block'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'Content-Type', b'application/json;charset=UTF-8'), (b'Transfer-Encoding', b'chunked'), (b'Date', b'Sat, 20 Dec 2025 10:04:22 GMT'), (b'Keep-Alive', b'timeout=60'), (b'Connection', b'keep-alive')])
2025-12-20 18:04:24 - httpx - INFO - [_client.py:1025] - HTTP Request: POST http://192.168.2.236:8088/open/workflow/execute "HTTP/1.1 200 "
2025-12-20 18:04:24 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.started request=<Request [b'POST']>
2025-12-20 18:04:24 - httpcore.http11 - DEBUG - [_trace.py:45] - receive_response_body.complete
2025-12-20 18:04:24 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.started
2025-12-20 18:04:24 - httpcore.http11 - DEBUG - [_trace.py:45] - response_closed.complete
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:164] - [API响应] HTTP 200
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:165] - [API响应] Headers: {'vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers', 'x-trace-id': '62311551-e7ab-4d5d-adef-f59b1969a4cf', 'x-ratelimit-limit': '100', 'x-ratelimit-remaining': '99', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'SAMEORIGIN', 'content-type': 'application/json;charset=UTF-8', 'transfer-encoding': 'chunked', 'date': 'Sat, 20 Dec 2025 10:04:22 GMT', 'keep-alive': 'timeout=60', 'connection': 'keep-alive'}
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.utils.api_client - INFO - [api_client.py:170] - [API响应] 执行工作流成功
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.utils.api_client - DEBUG - [api_client.py:171] - [API响应] Body: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "e6dcd942-1592-45bb-8af7-d7d25df338ed",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 2.206175,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好呀!✨ 很高兴见到你!今天过得怎么样呀?希望你度过了愉快的一天。我今天刚整理完知识库,准备了很多有趣的话题和实用的信息,希望能和你一起探讨、学习。不知道你今天想聊些什么呢?无论是有趣的故事、需要解决的问题,还是纯粹想聊聊日常,我都很乐意陪伴你聊天哦!😊"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好呀!✨ 很高兴见到你!今天过得怎么样呀?希望你度过了愉快的一天。我今天刚整理完知识库,准备了很多有趣的话题和实用的信息,希望能和你一起探讨、学习。不知道你今天想聊些什么呢?无论是有趣的故事、需要解决的问题,还是纯粹想聊聊日常,我都很乐意陪伴你聊天哦!😊"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/e6dcd942-1592-45bb-8af7-d7d25df338ed.json"
}
}
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.main - INFO - [main.py:233] - 工作流执行成功: 2002300699510763521
2025-12-20 18:04:24 - lzwcai_workflow_to_mcp.main - DEBUG - [main.py:234] - 工作流执行结果: {
"msg": "操作成功",
"code": 200,
"data": {
"success": true,
"execution_id": "e6dcd942-1592-45bb-8af7-d7d25df338ed",
"workflow_id": "3dc9d954-c270-4bbf-aa3d-5945c6acb2f5",
"status": "success",
"duration": 2.206175,
"nodes_executed": 3,
"errors_count": 0,
"final_output": {
"da9400b0-4754-4842-8a5e-dc20e2868cc6": {
"query": "你好啊"
},
"a480a344-7fa9-439b-8db6-79b136a79736": {
"text": "你好呀!✨ 很高兴见到你!今天过得怎么样呀?希望你度过了愉快的一天。我今天刚整理完知识库,准备了很多有趣的话题和实用的信息,希望能和你一起探讨、学习。不知道你今天想聊些什么呢?无论是有趣的故事、需要解决的问题,还是纯粹想聊聊日常,我都很乐意陪伴你聊天哦!😊"
},
"f54a21ba-e3a3-461e-9a6b-e952087f4a5b": {
"q": "你好呀!✨ 很高兴见到你!今天过得怎么样呀?希望你度过了愉快的一天。我今天刚整理完知识库,准备了很多有趣的话题和实用的信息,希望能和你一起探讨、学习。不知道你今天想聊些什么呢?无论是有趣的故事、需要解决的问题,还是纯粹想聊聊日常,我都很乐意陪伴你聊天哦!😊"
}
},
"error": null,
"log_id": "logs/3dc9d954-c270-4bbf-aa3d-5945c6acb2f5/e6dcd942-1592-45bb-8af7-d7d25df338ed.json"
}
}
2025-12-20 18:04:24 - mcp.server.lowlevel.server - DEBUG - [server.py:662] - Response sent

View File

@@ -1,23 +0,0 @@
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - ERROR - [api_client.py:182] - [API错误] 执行工作流API请求失败 (HTTP 401): http://192.168.2.236:8088/open/workflow/execute
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.utils.api_client - ERROR - [api_client.py:183] - [API错误] 响应内容: {"msg":"API Key无效","code":401,"errorCode":"UNAUTHORIZED"}
2025-12-20 18:03:12 - lzwcai_workflow_to_mcp.main - ERROR - [main.py:236] - 工作流执行失败: 执行工作流API请求失败 (HTTP 401): http://192.168.2.236:8088/open/workflow/execute
Traceback (most recent call last):
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\utils\api_client.py", line 167, in execute_workflow
response.raise_for_status()
File "D:\anaconda3\Lib\site-packages\httpx\_models.py", line 829, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '401 ' for url 'http://192.168.2.236:8088/open/workflow/execute'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\main.py", line 232, in handle_call_tool
result = execute_workflow(request_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\utils\api_client.py", line 268, in execute_workflow
return default_client.execute_workflow(request_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\yh-ai\project\lzwcai-szyg\lzwcai-mcp-server-package\lzwcai_workflow_to_mcp\lzwcai_workflow_to_mcp\utils\api_client.py", line 184, in execute_workflow
raise Exception(error_msg)
Exception: 执行工作流API请求失败 (HTTP 401): http://192.168.2.236:8088/open/workflow/execute

View File

@@ -10,7 +10,10 @@ from .api_client import (
process_workflow_response,
get_default_client,
DEFAULT_TIMEOUT,
WORKFLOW_EXECUTE_TIMEOUT
WORKFLOW_EXECUTE_TIMEOUT,
DEFAULT_POLLING_INTERVAL,
DEFAULT_MAX_POLL_COUNT,
DEFAULT_MAX_ERROR_COUNT,
)
from .env_config import get_workflow_id, get_backend_base_url, get_env_config, set_env_variable
@@ -26,6 +29,9 @@ __all__ = [
'get_default_client',
'DEFAULT_TIMEOUT',
'WORKFLOW_EXECUTE_TIMEOUT',
'DEFAULT_POLLING_INTERVAL',
'DEFAULT_MAX_POLL_COUNT',
'DEFAULT_MAX_ERROR_COUNT',
'get_workflow_id',
'get_backend_base_url',
'get_env_config',

View File

@@ -5,7 +5,9 @@
import httpx
import json
from typing import Dict, Any, Optional, List
import os
import time
from typing import Dict, Any, Optional, List, Tuple
try:
from .env_config import get_backend_base_url, get_workflow_execute_key
@@ -18,7 +20,64 @@ logger = get_logger(__name__)
# 默认超时配置(秒)
DEFAULT_TIMEOUT = 30.0 # 普通请求超时
WORKFLOW_EXECUTE_TIMEOUT = 300.0 # 工作流执行超时(5分钟
WORKFLOW_EXECUTE_TIMEOUT = 600.0 # 工作流执行超时(10分钟参考 workflow-execution-api.md
# 异步轮询默认配置(参考 workflow-execution-api.md
DEFAULT_POLLING_INTERVAL = 1.0
DEFAULT_MAX_POLL_COUNT = 120
DEFAULT_MAX_ERROR_COUNT = 3
def _get_polling_config() -> Tuple[float, int, int]:
"""
获取轮询配置(允许用环境变量覆盖)
Env:
- workflowPollingIntervalSeconds: float, 默认 1
- workflowMaxPollCount: int, 默认 120
- workflowMaxErrorCount: int, 默认 3
"""
try:
interval = float(os.environ.get("workflowPollingIntervalSeconds", str(DEFAULT_POLLING_INTERVAL)))
except ValueError:
interval = DEFAULT_POLLING_INTERVAL
try:
max_polls = int(os.environ.get("workflowMaxPollCount", str(DEFAULT_MAX_POLL_COUNT)))
except ValueError:
max_polls = DEFAULT_MAX_POLL_COUNT
try:
max_errors = int(os.environ.get("workflowMaxErrorCount", str(DEFAULT_MAX_ERROR_COUNT)))
except ValueError:
max_errors = DEFAULT_MAX_ERROR_COUNT
# 避免被错误配置成 0 或负数
interval = interval if interval > 0 else DEFAULT_POLLING_INTERVAL
max_polls = max_polls if max_polls > 0 else DEFAULT_MAX_POLL_COUNT
max_errors = max_errors if max_errors > 0 else DEFAULT_MAX_ERROR_COUNT
return interval, max_polls, max_errors
def _extract_async_ids(execute_response: Dict[str, Any]) -> Optional[Tuple[str, str, str]]:
"""
从执行接口响应中提取 (status, execution_id, workflow_id)
兼容 snake_case / camelCase。
"""
if not isinstance(execute_response, dict):
return None
data = execute_response.get("data")
if not isinstance(data, dict):
return None
status = data.get("status")
execution_id = data.get("execution_id") or data.get("executionId")
workflow_id = data.get("workflow_id") or data.get("workflowId")
if status and execution_id and workflow_id:
return str(status), str(execution_id), str(workflow_id)
return None
class WorkflowAPIClient:
@@ -170,7 +229,20 @@ class WorkflowAPIClient:
logger.info(f"[API响应] 执行工作流成功")
logger.debug(f"[API响应] Body: {json.dumps(data, ensure_ascii=False, indent=2)}")
return data
# 兼容:如果服务端返回 async 的 execution_id/workflow_id则按文档轮询状态接口直到结束
async_info = _extract_async_ids(data)
if async_info is None:
return data
status, execution_id, workflow_id = async_info
if status not in ("pending", "running"):
# 有些服务端可能直接返回 success/failed 但仍带 execution_id
return data
logger.info(
f"[执行工作流] 检测到异步执行: status={status}, execution_id={execution_id}, workflow_id={workflow_id}"
)
return self.poll_workflow_result(execution_id=execution_id, workflow_id=workflow_id)
except httpx.TimeoutException:
error_msg = f"执行工作流API请求超时: {url}"
@@ -193,6 +265,88 @@ class WorkflowAPIClient:
logger.error(f"[API错误] {error_msg}", exc_info=True)
raise Exception(error_msg)
def get_workflow_execute_status(self, execution_id: str, workflow_id: str) -> Dict[str, Any]:
"""
查询异步执行状态
GET /open/workflow/execute/status/{executionId}?workflowId={workflowId}
"""
url = f"{self.base_url}/open/workflow/status/{execution_id}"
try:
logger.info(f"[API请求] GET {url}")
response = self.client.get(
url,
headers=self._get_headers(),
params={"workflowId": workflow_id},
)
logger.info(f"[API响应] HTTP {response.status_code}")
response.raise_for_status()
data = response.json()
logger.debug(f"[API响应] Body: {json.dumps(data, ensure_ascii=False, indent=2)}")
return data
except httpx.TimeoutException:
error_msg = f"查询工作流执行状态超时: {url}"
logger.error(f"[API错误] {error_msg}")
raise Exception(error_msg)
except httpx.HTTPStatusError as e:
error_msg = f"查询工作流执行状态失败 (HTTP {e.response.status_code}): {url}"
logger.error(f"[API错误] {error_msg}")
logger.error(f"[API错误] 响应内容: {e.response.text}")
raise Exception(error_msg)
except httpx.RequestError as e:
error_msg = f"查询工作流执行状态请求异常: {url}, 错误: {str(e)}"
logger.error(f"[API错误] {error_msg}")
raise Exception(error_msg)
except Exception as e:
error_msg = f"处理查询执行状态响应时出错: {str(e)}"
logger.error(f"[API错误] {error_msg}", exc_info=True)
raise Exception(error_msg)
def poll_workflow_result(self, execution_id: str, workflow_id: str) -> Dict[str, Any]:
"""轮询直到工作流执行完成success/failed或超时"""
interval, max_polls, max_errors = _get_polling_config()
error_count = 0
logger.info(
f"[轮询] 开始轮询执行状态: execution_id={execution_id}, workflow_id={workflow_id}, "
f"interval={interval}s, max_polls={max_polls}, max_errors={max_errors}"
)
for i in range(max_polls):
try:
resp = self.get_workflow_execute_status(execution_id=execution_id, workflow_id=workflow_id)
if resp.get("code") != 200:
error_count += 1
logger.warning(f"[轮询] 状态接口返回非200(code={resp.get('code')}), error_count={error_count}")
if error_count >= max_errors:
raise Exception(f"轮询连续错误次数过多: code={resp.get('code')}, msg={resp.get('msg')}")
time.sleep(interval)
continue
error_count = 0
data = resp.get("data") or {}
status = data.get("status")
logger.info(f"[轮询] 第{i+1}/{max_polls}次: status={status}")
if status in ("pending", "running"):
time.sleep(interval)
continue
if status in ("success", "failed"):
return resp
# 兜底:未知状态
raise Exception(f"未知执行状态: {status}")
except Exception as e:
error_count += 1
logger.warning(f"[轮询] 轮询异常: {e}, error_count={error_count}")
if error_count >= max_errors:
raise
time.sleep(interval)
raise Exception("轮询超时:超过最大轮询次数仍未完成")
def close(self):
"""关闭HTTP客户端"""
if self._client is not None:

View File

@@ -0,0 +1,321 @@
# 工作流执行接口文档
## 概述
工作流执行分为**同步执行**和**异步执行**两种模式,通过 `async` 参数控制。
---
## 1. 调试执行接口
### 接口信息
- **URL**: `POST /open/workflow/execute`
- **超时**: 600000ms (10分钟)
### 请求参数
```json
{
"workflow": {
"nodes": [...],
"edges": [...]
},
"inputs": {
"param1": "value1",
"param2": "value2"
},
"saveLog": false,
"async": true
}
```
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| workflow | Object | 是 | 工作流配置(节点和边) |
| inputs | Object | 否 | 开始节点的输入参数 |
| saveLog | Boolean | 否 | 是否保存执行日志 |
| async | Boolean | 否 | 是否异步执行(默认 false |
---
## 2. 响应处理
### 2.1 同步执行响应 (async=false)
直接返回完整执行结果:
```json
{
"code": 200,
"data": {
"success": true,
"status": "success",
"duration": 2.5,
"nodes_executed": 5,
"errors_count": 0,
"final_output": {...},
"execution_history": [
{
"node_id": "node_1",
"node_type": "start",
"status": "success",
"inputs": {...},
"outputs": {...},
"error": null,
"duration": 0.1,
"timestamp": "2024-01-20T10:00:00"
}
]
}
}
```
### 2.2 异步执行响应 (async=true)
返回执行 ID需要轮询查询状态
```json
{
"code": 200,
"data": {
"status": "pending",
"execution_id": "exec_123456",
"workflow_id": "wf_789"
}
}
```
---
## 3. 异步执行状态查询
### 接口信息
- **URL**: `GET /open/workflow/status/{executionId}?workflowId={workflowId}`
### 请求参数
| 参数 | 位置 | 类型 | 必填 | 说明 |
|------|------|------|------|------|
| executionId | Path | String | 是 | 执行ID |
| workflowId | Query | String | 是 | 工作流ID |
### 响应数据
```json
{
"code": 200,
"data": {
"status": "success",
"success": true,
"execution_id": "exec_123456",
"workflow_id": "wf_789",
"duration": 2.5,
"nodes_executed": 5,
"errors_count": 0,
"final_output": {...},
"execution_history": [...]
}
}
```
### 状态值说明
| 状态 | 说明 | 处理方式 |
|------|------|----------|
| pending | 等待执行 | 继续轮询 |
| running | 执行中 | 继续轮询 |
| success | 执行成功 | 停止轮询,显示结果 |
| failed | 执行失败 | 停止轮询,显示错误 |
---
## 4. 轮询策略
### 前端实现参数
```javascript
const POLLING_INTERVAL = 1000; // 轮询间隔1秒
const MAX_POLL_COUNT = 120; // 最大轮询次数2分钟
const MAX_ERROR_COUNT = 3; // 最大连续错误次数
```
### 轮询逻辑
1. 提交异步执行请求,获取 `execution_id``workflow_id`
2. 每隔 1 秒调用状态查询接口
3. 根据返回的 `status` 判断:
- `pending/running`: 继续轮询
- `success/failed`: 停止轮询,处理结果
4. 超过 120 次轮询或连续 3 次错误,停止轮询
---
## 5. Python 实现示例
### 5.1 同步执行
```python
import requests
def execute_workflow_sync(workflow_config, inputs=None):
"""同步执行工作流"""
url = "http://your-api/api/system/workflowManage/debug"
payload = {
"workflow": workflow_config,
"inputs": inputs or {},
"saveLog": False,
"async": False
}
response = requests.post(url, json=payload, timeout=600)
result = response.json()
if result["code"] == 200:
return result["data"]
else:
raise Exception(f"执行失败: {result.get('msg')}")
```
### 5.2 异步执行 + 轮询
```python
import requests
import time
def execute_workflow_async(workflow_config, inputs=None):
"""异步执行工作流并轮询结果"""
# 1. 提交异步执行
url = "http://your-api/api/system/workflowManage/debug"
payload = {
"workflow": workflow_config,
"inputs": inputs or {},
"saveLog": False,
"async": True
}
response = requests.post(url, json=payload, timeout=600)
result = response.json()
if result["code"] != 200:
raise Exception(f"提交失败: {result.get('msg')}")
execution_id = result["data"]["execution_id"]
workflow_id = result["data"]["workflow_id"]
# 2. 轮询执行状态
status_url = f"http://your-api/api/system/workflowManage/status/{execution_id}"
params = {"workflowId": workflow_id}
max_polls = 120
poll_interval = 1
error_count = 0
for i in range(max_polls):
try:
response = requests.get(status_url, params=params)
result = response.json()
if result["code"] == 200:
error_count = 0 # 重置错误计数
data = result["data"]
status = data["status"]
if status == "success":
return data
elif status == "failed":
raise Exception(f"执行失败: {data.get('error')}")
elif status in ["pending", "running"]:
time.sleep(poll_interval)
continue
else:
raise Exception(f"未知状态: {status}")
else:
error_count += 1
if error_count >= 3:
raise Exception("连续错误次数过多")
time.sleep(poll_interval)
except requests.RequestException as e:
error_count += 1
if error_count >= 3:
raise Exception(f"网络异常: {str(e)}")
time.sleep(poll_interval)
raise Exception("执行超时")
```
### 5.3 完整使用示例
```python
# 工作流配置
workflow_config = {
"nodes": [
{
"id": "start_1",
"type": "start",
"data": {
"config": {
"inputs": [
{"name": "text", "type": "string", "required": True}
]
}
}
},
# ... 其他节点
],
"edges": [
{"source": "start_1", "target": "node_2"}
]
}
# 输入参数
inputs = {
"text": "Hello World"
}
# 同步执行
try:
result = execute_workflow_sync(workflow_config, inputs)
print("执行成功:", result)
except Exception as e:
print("执行失败:", e)
# 异步执行
try:
result = execute_workflow_async(workflow_config, inputs)
print("执行成功:", result)
except Exception as e:
print("执行失败:", e)
```
---
## 6. 响应数据结构
### execution_history 节点执行记录
```python
{
"node_id": "node_1", # 节点ID
"node_type": "llm", # 节点类型
"status": "success", # 执行状态
"inputs": {...}, # 输入参数
"outputs": {...}, # 输出结果
"error": None, # 错误信息
"duration": 1.2, # 执行耗时(秒)
"timestamp": "2024-01-20..." # 时间戳
}
```
### 节点类型枚举
- `start`: 开始节点
- `end`: 结束节点
- `llm`: 大模型节点
- `code`: 代码节点
- `condition`: 条件分支
- `loop`: 循环节点
- `http`: HTTP请求
- `knowledge`: 知识库
- `agent`: 智能体
- `tool`: 工具节点
- `variable`: 变量节点
- `template`: 模板节点
- `subflow`: 子流程
---
## 7. 注意事项
1. **超时设置**: 调试接口超时时间为 10 分钟,适合长时间运行的工作流
2. **异步推荐**: 对于复杂工作流,建议使用异步模式避免超时
3. **轮询频率**: 建议 1 秒轮询一次,避免过于频繁
4. **错误处理**: 需要处理网络异常、超时、连续错误等情况
5. **日志保存**: `saveLog` 参数控制是否保存执行日志到数据库

View File

@@ -7,8 +7,8 @@ import os
if __name__ == "__main__":
# 设置环境变量
os.environ["workflowId"] = "2002300699510763521"
os.environ["workflowExecuteKey"] = "wf_buh230o9iaea4n6aefsddcexa7p27ydl"
os.environ["workflowId"] = "2005892514011795457"
os.environ["workflowExecuteKey"] = "wf_ce270212b2ee45ab9c81714a7c243c56"
os.environ["backendBaseUrl"] = "http://192.168.2.236:8088"
# Import and run the actual MCP server

View File

@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "lzwcai-workflow-to-mcp"
version = "0.1.1"
version = "0.1.2"
description = "MCP server for executing business SQL queries with dynamic tool generation"
readme = "README.md"
requires-python = ">=3.13"