Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
12 changes: 10 additions & 2 deletions src/uipath_mcp/_cli/_runtime/_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
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 (
UiPathBaseRuntime,
UiPathErrorCategory,
UiPathRuntimeResult,
)
from uipath.tracing import wait_for_tracers
from uipath.tracing import LlmOpsHttpExporter

from .._utils._config import McpServer
from ._context import UiPathMcpRuntimeContext, UiPathServerType
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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."""
Expand Down
11 changes: 6 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.