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