Skip to content

Commit 9dd7e98

Browse files
committed
fix: use custom stdio client for session
1 parent 02bd33e commit 9dd7e98

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
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.62"
3+
version = "0.0.63"
44
description = "UiPath MCP SDK"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath_mcp/_cli/_runtime/_session.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
import mcp.types as types
77
from mcp import StdioServerParameters
8-
from mcp.client.stdio import stdio_client
98
from opentelemetry import trace
109
from uipath import UiPath
1110

1211
from .._utils._config import McpServer
12+
from ._stdio_client import stdio_client
1313
from ._tracer import McpTracer
1414

1515
logger = logging.getLogger(__name__)
@@ -98,7 +98,7 @@ async def _run_server(self, server_params: StdioServerParameters) -> None:
9898
"""Run the local MCP server process."""
9999
logger.info(f"Starting local MCP Server process for session {self._session_id}")
100100
self._server_stderr_output = None
101-
with tempfile.TemporaryFile(mode='w+b') as stderr_temp:
101+
with tempfile.TemporaryFile(mode="w+b") as stderr_temp:
102102
try:
103103
async with stdio_client(server_params, errlog=stderr_temp) as (
104104
read,
@@ -129,7 +129,9 @@ async def _run_server(self, server_params: StdioServerParameters) -> None:
129129
)
130130
finally:
131131
stderr_temp.seek(0)
132-
self._server_stderr_output = stderr_temp.read().decode('utf-8', errors='replace')
132+
self._server_stderr_output = stderr_temp.read().decode(
133+
"utf-8", errors="replace"
134+
)
133135
# The context managers will handle cleanup of resources
134136

135137
def _run_server_callback(self, task):

src/uipath_mcp/_cli/_runtime/_stdio_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,15 @@ async def stdin_writer():
101101
# Then terminate the process with escalating signals
102102
process.terminate()
103103
try:
104-
with anyio.fail_after(2.0):
104+
with anyio.fail_after(1.0):
105105
await process.wait()
106106
except TimeoutError:
107107
try:
108108
if sys.platform == "win32":
109109
process.send_signal(signal.CTRL_C_EVENT)
110110
else:
111111
process.send_signal(signal.SIGINT)
112-
with anyio.fail_after(2.0):
112+
with anyio.fail_after(1.0):
113113
await process.wait()
114114
except TimeoutError:
115115
# Force kill if it doesn't terminate

0 commit comments

Comments
 (0)