diff --git a/pyproject.toml b/pyproject.toml index 8a3d437..92d4a34 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-mcp" -version = "0.0.84" +version = "0.0.85" description = "UiPath MCP SDK" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.10" diff --git a/src/uipath_mcp/_cli/_runtime/_runtime.py b/src/uipath_mcp/_cli/_runtime/_runtime.py index 685b127..ddd67f8 100644 --- a/src/uipath_mcp/_cli/_runtime/_runtime.py +++ b/src/uipath_mcp/_cli/_runtime/_runtime.py @@ -10,6 +10,8 @@ from mcp import ClientSession, StdioServerParameters, stdio_client from mcp.types import JSONRPCResponse from opentelemetry import trace +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import BatchSpanProcessor from pysignalr.client import CompletionMessage, SignalRClient from uipath import UiPath from uipath._cli._runtime._contracts import ( @@ -17,7 +19,7 @@ UiPathErrorCategory, UiPathRuntimeResult, ) -from uipath.tracing import wait_for_tracers +from uipath.tracing import LlmOpsHttpExporter from .._utils._config import McpServer from ._context import UiPathMcpRuntimeContext, UiPathServerType @@ -62,6 +64,12 @@ async def execute(self) -> Optional[UiPathRuntimeResult]: try: if self._server is None: return None + + self.trace_provider = TracerProvider() + trace.set_tracer_provider(self.trace_provider) + self.trace_provider.add_span_processor( + BatchSpanProcessor(LlmOpsHttpExporter()) + ) # type: ignore # Set up SignalR client signalr_url = f"{os.environ.get('UIPATH_URL')}/mcp_/wsstunnel?slug={self._server.name}&runtimeId={self._runtime_id}" @@ -125,7 +133,7 @@ async def execute(self) -> Optional[UiPathRuntimeResult]: UiPathErrorCategory.USER, ) from e finally: - wait_for_tracers() + self.trace_provider.shutdown() async def validate(self) -> None: """Validate runtime inputs and load MCP server configuration.""" diff --git a/uv.lock b/uv.lock index a524895..cdbdc94 100644 --- a/uv.lock +++ b/uv.lock @@ -1,4 +1,5 @@ version = 1 +revision = 1 requires-python = ">=3.10" [[package]] @@ -1967,7 +1968,7 @@ wheels = [ [[package]] name = "uipath" -version = "2.0.55" +version = "2.0.60" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "azure-monitor-opentelemetry" }, @@ -1981,14 +1982,14 @@ dependencies = [ { name = "tenacity" }, { name = "tomli" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/33/d5/2dad25adf64e91a472845b3238d61541b021b2a9f8d0429dbbdaf4fbc5c0/uipath-2.0.55.tar.gz", hash = "sha256:8bc91f318f9613e56259a869373ba720eec33d6977841112ed4081740bda36fa", size = 1824186 } +sdist = { url = "https://files.pythonhosted.org/packages/6f/ea/b817429c94cae5a169e7135f8fb0e9e1574d1e9840b10fea23e427279c24/uipath-2.0.60.tar.gz", hash = "sha256:d18066ab93107b1f1b5d6d41f2745d0973bf39c39d8d4b2914467f28e64d0904", size = 1819400 } wheels = [ - { url = "https://files.pythonhosted.org/packages/c6/f3/bbee2e0b3f1e47f117efc8c3f4fecb7c23ce0b363f27808f4661a2afd8c8/uipath-2.0.55-py3-none-any.whl", hash = "sha256:094dfab5c877272d01cb620ef9a795ed52671aa1ed9af53dd190d1a27fc0f7c7", size = 113762 }, + { url = "https://files.pythonhosted.org/packages/fd/53/e0577f2e8f0bc01392fe2d63f08d8392dd380a0407a2d702e4a3dcef8ce4/uipath-2.0.60-py3-none-any.whl", hash = "sha256:ce4f24f0241c98ed4711ddc32da9778b1e38159028b950ca5793a7dcff60a280", size = 117115 }, ] [[package]] name = "uipath-mcp" -version = "0.0.79" +version = "0.0.84" source = { editable = "." } dependencies = [ { name = "mcp" }, @@ -2011,7 +2012,7 @@ dev = [ requires-dist = [ { name = "mcp", specifier = "==1.9.0" }, { name = "pysignalr", specifier = "==1.3.0" }, - { name = "uipath", specifier = ">=2.0.55" }, + { name = "uipath", specifier = ">=2.0.56" }, ] [package.metadata.requires-dev]