Skip to content

Commit a105a24

Browse files
authored
Merge pull request #95 from UiPath/fix/update_deps
fix: remove custom stdio client
2 parents c778516 + 837fa4c commit a105a24

File tree

3 files changed

+32
-122
lines changed

3 files changed

+32
-122
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.80"
3+
version = "0.0.81"
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: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
import os
44
import sys
55
import tempfile
6+
import traceback
67
import uuid
78
from typing import Any, Dict, Optional
89

910
import mcp.types as types
10-
from mcp import ClientSession, StdioServerParameters
11+
from mcp import ClientSession, StdioServerParameters, stdio_client
1112
from opentelemetry import trace
1213
from pysignalr.client import CompletionMessage, SignalRClient
1314
from uipath import UiPath
@@ -22,7 +23,6 @@
2223
from ._context import UiPathMcpRuntimeContext, UiPathServerType
2324
from ._exception import UiPathMcpRuntimeError
2425
from ._session import SessionServer
25-
from ._stdio_client import stdio_client
2626

2727
logger = logging.getLogger(__name__)
2828
tracer = trace.get_tracer(__name__)
@@ -292,7 +292,35 @@ async def _register(self) -> None:
292292
# We don't continue with registration here - we'll do it after the context managers
293293

294294
except BaseException as e:
295-
logger.error(f"Error during server initialization: {e}")
295+
# In Python 3.10, ExceptionGroup is in the 'exceptiongroup' module
296+
# and asyncio.TaskGroup wraps exceptions in ExceptionGroup
297+
if hasattr(e, "__context__") and e.__context__ is not None:
298+
logger.error("Sub-exception details:")
299+
logger.error(
300+
"".join(
301+
traceback.format_exception(
302+
type(e.__context__),
303+
e.__context__,
304+
e.__context__.__traceback__,
305+
)
306+
)
307+
)
308+
elif hasattr(e, "exceptions"): # For ExceptionGroup
309+
for i, sub_exc in enumerate(e.exceptions):
310+
logger.error(f"Sub-exception {i + 1}:")
311+
logger.error(
312+
"".join(
313+
traceback.format_exception(
314+
type(sub_exc), sub_exc, sub_exc.__traceback__
315+
)
316+
)
317+
)
318+
else:
319+
# Log the full traceback of the exception itself
320+
logger.error("Full traceback:")
321+
logger.error(
322+
"".join(traceback.format_exception(type(e), e, e.__traceback__))
323+
)
296324

297325
# Now that we're outside the context managers, check if initialization succeeded
298326
if not initialization_successful:

src/uipath_mcp/_cli/_runtime/_stdio_client.py

Lines changed: 0 additions & 118 deletions
This file was deleted.

0 commit comments

Comments
 (0)