Skip to content

Commit e3644a9

Browse files
committed
Fix: Use enum for server type
1 parent 30c5279 commit e3644a9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/uipath_mcp/_cli/_runtime/_context.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from enum import Enum
12
from typing import Optional
23

34
from uipath._cli._runtime._contracts import UiPathRuntimeContext
@@ -7,4 +8,12 @@
78

89
class UiPathMcpRuntimeContext(UiPathRuntimeContext):
910
"""Context information passed throughout the runtime execution."""
11+
1012
config: Optional[McpConfig] = None
13+
14+
15+
class UiPathServerType(Enum):
16+
UiPath = 0 # Processes, Agents, Activities
17+
External = 1 # npx, uvx
18+
Local = 2 # PackageType.MCPServer
19+
Hosted = 3 # tunnel to externally hosted server

src/uipath_mcp/_cli/_runtime/_runtime.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from uipath.tracing import wait_for_tracers
2020

2121
from .._utils._config import McpServer
22-
from ._context import UiPathMcpRuntimeContext
22+
from ._context import UiPathMcpRuntimeContext, UiPathServerType
2323
from ._exception import UiPathMcpRuntimeError
2424
from ._session import SessionServer
2525
from ._stdio_client import stdio_client
@@ -313,14 +313,13 @@ async def _register(self) -> None:
313313
"Name": self._server.name,
314314
"Slug": self._server.name,
315315
"Version": "1.0.0",
316-
"Type": 1 if self.sandboxed else 3,
316+
"Type": UiPathServerType.External.value if self.sandboxed else UiPathServerType.Hosted.value,
317317
},
318318
"tools": [],
319319
}
320320

321321
for tool in tools_result.tools:
322322
tool_info = {
323-
"Type": 1,
324323
"Name": tool.name,
325324
"ProcessType": "Tool",
326325
"Description": tool.description,

0 commit comments

Comments
 (0)