Skip to content

Commit e950278

Browse files
authored
Merge pull request #32 from UiPath/fix/samples
fix: send env variables, timeout initialize
2 parents 0a897f6 + 8bd813c commit e950278

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-mcp"
3-
version = "0.0.28"
3+
version = "0.0.29"
44
description = "UiPath MCP SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath_mcp/_cli/_runtime/_runtime.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff 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",

0 commit comments

Comments
 (0)