File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
src/uipath_mcp/_cli/_runtime Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 11[project ]
22name = " uipath-mcp"
3- version = " 0.0.28 "
3+ version = " 0.0.29 "
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 @@ -212,15 +212,19 @@ async def _register(self) -> None:
212212 server_params = StdioServerParameters (
213213 command = self .server .command ,
214214 args = self .server .args ,
215- env = None ,
215+ env = self . server . env ,
216216 )
217217
218218 # Start a temporary stdio client to get tools
219219 async with stdio_client (server_params ) as (read , write ):
220220 async with ClientSession (read , write ) as session :
221- await session .initialize ()
221+ logger .info ("Initializing client session..." )
222+ await asyncio .wait_for (
223+ session .initialize (),
224+ timeout = 30
225+ )
222226 tools_result = await session .list_tools ()
223- print (tools_result )
227+ logger . info (tools_result )
224228 client_info = {
225229 "server" : {
226230 "Name" : self .server .name ,
@@ -248,7 +252,13 @@ async def _register(self) -> None:
248252 json = client_info ,
249253 )
250254 logger .info ("Registered MCP Server type successfully" )
251-
255+ except asyncio .TimeoutError as e :
256+ raise UiPathMcpRuntimeError (
257+ "TIMEOUT_ERROR" ,
258+ "Server initialization failed" ,
259+ str (e ),
260+ UiPathErrorCategory .DEPLOYMENT ,
261+ ) from e
252262 except Exception as e :
253263 raise UiPathMcpRuntimeError (
254264 "NETWORK_ERROR" ,
You can’t perform that action at this time.
0 commit comments