From cfe3da5c7b7ffd86cd66fa82e5af26e7cb98ef2b Mon Sep 17 00:00:00 2001 From: lapy Date: Sun, 11 Oct 2026 12:45:49 +0100 Subject: [PATCH] fix(rebase): send MCP initialize once and align python deps with upstream The merge-rebase kept both the old downstream MCP initialize dispatch and upstream's relocated one, so every capable device received two initialize messages per connection. Keep only the post-hello send (upstream #3347). requirements: drop chardet (removed upstream, unused here), restore mcp-proxy 0.12.0, and remove the stale cozepy pin comment (cozepy is not a downstream dependency). --- main/xiaozhi-server/core/handle/helloHandle.py | 3 +-- main/xiaozhi-server/requirements.txt | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/main/xiaozhi-server/core/handle/helloHandle.py b/main/xiaozhi-server/core/handle/helloHandle.py index ed960378b..3c3a3362f 100644 --- a/main/xiaozhi-server/core/handle/helloHandle.py +++ b/main/xiaozhi-server/core/handle/helloHandle.py @@ -54,12 +54,11 @@ async def handleHelloMessage(conn: "ConnectionHandler", msg_json): if features.get("mcp"): conn.logger.bind(tag=TAG).debug("Client supports MCP") conn.mcp_client = MCPClient() - # Send the MCP initialization message. - asyncio.create_task(send_mcp_initialize_message(conn)) await conn.websocket.send(json.dumps(conn.welcome_msg)) # The device waits for the server hello before processing MCP messages. + # Send the MCP initialization message exactly once, after the hello reply. if features and features.get("mcp"): asyncio.create_task(send_mcp_initialize_message(conn)) diff --git a/main/xiaozhi-server/requirements.txt b/main/xiaozhi-server/requirements.txt index 733a129b2..a6353090d 100644 --- a/main/xiaozhi-server/requirements.txt +++ b/main/xiaozhi-server/requirements.txt @@ -3,7 +3,7 @@ torch==2.4.1 torchaudio==2.4.1 numpy>=2.0.2 -#--------- cozepy 0.20.0 requires websockets<15.0.0; the pin below is not recommended to upgrade yet +#--------- websockets pin websockets==16.0 #--------- Dependencies below are eligible for upgrades pyyml==0.0.2 @@ -28,10 +28,9 @@ bs4==0.0.2 cryptography==46.0.6 mcp==1.22.0 PySocks==1.7.1 -chardet==5.2.0 aioconsole==0.8.2 markitdown==0.1.3 -mcp-proxy==0.10.0 +mcp-proxy==0.12.0 PyJWT==2.12.1 psutil==7.2.2 portalocker==3.2.0