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
18 changes: 9 additions & 9 deletions src/uipath_mcp/_cli/_runtime/_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ class UiPathServerType(Enum):

Attributes:
UiPath (0): Standard UiPath server for Processes, Agents, and Activities
External (1): External server types like npx, uvx
Local (2): Local MCP server (PackageType.MCPServer)
Hosted (3): Tunnel to externally hosted server
Command (1): Command server types like npx, uvx
Coded (2): Coded MCP server (PackageType.MCPServer)
SelfHosted (3): Tunnel to externally hosted server
"""

UiPath = 0 # type: int # Processes, Agents, Activities
External = 1 # type: int # npx, uvx
Local = 2 # type: int # PackageType.MCPServer
Hosted = 3 # type: int # tunnel to externally hosted server
Command = 1 # type: int # npx, uvx
Coded = 2 # type: int # PackageType.MCPServer
SelfHosted = 3 # type: int # tunnel to externally hosted server

@classmethod
def from_string(cls, name: str) -> "UiPathServerType":
Expand All @@ -43,8 +43,8 @@ def get_description(cls, server_type: "UiPathServerType") -> str:
"""Get description for a server type."""
descriptions = {
cls.UiPath: "Standard UiPath server for Processes, Agents, and Activities",
cls.External: "External server types like npx, uvx",
cls.Local: "Local MCP server (PackageType.MCPServer)",
cls.Hosted: "Tunnel to externally hosted server",
cls.Command: "Command server types like npx, uvx",
cls.Coded: "Coded MCP server (PackageType.MCPServer)",
cls.SelfHosted: "Tunnel to externally hosted server",
}
return descriptions.get(server_type, "Unknown server type")
16 changes: 8 additions & 8 deletions src/uipath_mcp/_cli/_runtime/_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ async def _register(self) -> None:
server_stderr_output = ""
env_vars = self._server.env

# if server is Local, include environment variables
if self.server_type is UiPathServerType.Local:
# if server is Coded, include environment variables
if self.server_type is UiPathServerType.Coded:
Copy link

Copilot AI Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing enum members using is can be brittle; consider using == for readability and consistency with common enum comparison patterns.

Suggested change
if self.server_type is UiPathServerType.Coded:
if self.server_type == UiPathServerType.Coded:

Copilot uses AI. Check for mistakes.
for name, value in os.environ.items():
# config env variables should have precedence over system ones
if name not in env_vars:
Expand Down Expand Up @@ -553,12 +553,12 @@ def server_type(self) -> UiPathServerType:
UiPathServerType: The appropriate server type enum value based on the runtime configuration.
"""
if self.packaged:
# If it's a packaged runtime (has a process_key), it's a Local server
# If it's a packaged runtime (has a process_key), it's a Coded server
# Packaged runtimes are also sandboxed
return UiPathServerType.Local
return UiPathServerType.Coded
elif self.sandboxed:
# If it's sandboxed but not packaged, it's an External server
return UiPathServerType.External
# If it's sandboxed but not packaged, it's a Command server
return UiPathServerType.Command
else:
# If it's neither packaged nor sandboxed, it's a Hosted server
return UiPathServerType.Hosted
# If it's neither packaged nor sandboxed, it's a SelfHosted server
return UiPathServerType.SelfHosted