File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
src/uipath_mcp/_cli/_runtime Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 11[project ]
22name = " uipath-mcp"
3- version = " 0.0.4 "
3+ version = " 0.0.5 "
44description = " UiPath MCP SDK"
55readme = { file = " README.md" , content-type = " text/markdown" }
66requires-python = " >=3.10"
Original file line number Diff line number Diff line change @@ -176,6 +176,27 @@ async def handle_signalr_error(self, error: Any) -> None:
176176 async def handle_signalr_open (self ) -> None :
177177 """Handle SignalR connection open event."""
178178 logger .info ("SignalR connection established" )
179+ uipath = UiPath ()
180+ response = uipath .api_client .request (
181+ "GET" ,
182+ f"mcp_/mcp/{ self .server .name } /message?jobKey={ self .context .job_id } "
183+ )
184+ if response .status_code == 200 :
185+ data = response .json ()
186+ session_id = data ["sessionId" ]
187+ message = data ["message" ]
188+ logger .info (f"Received message from UiPath MCP: { message } " )
189+ if session_id not in self .session_servers :
190+ # Create and start a new session server
191+ session_server = SessionServer (self .server , session_id )
192+ self .session_servers [session_id ] = session_server
193+ await session_server .start (self .signalr_client )
194+
195+ # Get the session server for this session
196+ session_server = self .session_servers [session_id ]
197+
198+ # Forward the message to the session's MCP server
199+ await session_server .send_message (message )
179200
180201 async def handle_signalr_close (self ) -> None :
181202 """Handle SignalR connection close event."""
You can’t perform that action at this time.
0 commit comments