From ba63c39ff971a2a4f327ae513975c6a6de73425f Mon Sep 17 00:00:00 2001 From: Popescu Tudor-Cristian Date: Thu, 25 Jun 2026 11:26:02 +0300 Subject: [PATCH] fix(platform): add Swagger (type 7) to McpServerType The backend exposes a Swagger MCP server type (a user-provided Swagger/OpenAPI spec served as an MCP server) with enum value 7, but McpServerType stopped at Platform = 6. mcp.retrieve_async validates the response into McpServer, so any agent that resolves a Swagger MCP server fails with: 1 validation error for McpServer type: Input should be 0, 1, 2, 3, 4, 5 or 6 [input_value=7] Add Swagger = 7, matching the Orchestrator/AgentHub enum. The MCP client connects via mcp_url and does not branch on type, so accepting the value is sufficient for the server to load. Bumps uipath-platform 0.1.76 -> 0.1.77. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01ELDu3m5eaURJrMVarc8VfY --- packages/uipath-platform/pyproject.toml | 2 +- .../src/uipath/platform/orchestrator/mcp.py | 1 + .../tests/services/test_mcp_service.py | 18 ++++++++++++++++++ packages/uipath-platform/uv.lock | 2 +- packages/uipath/uv.lock | 2 +- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/uipath-platform/pyproject.toml b/packages/uipath-platform/pyproject.toml index cfe85a61e..e4da0a0ce 100644 --- a/packages/uipath-platform/pyproject.toml +++ b/packages/uipath-platform/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-platform" -version = "0.1.76" +version = "0.1.77" description = "HTTP client library for programmatic access to UiPath Platform" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/packages/uipath-platform/src/uipath/platform/orchestrator/mcp.py b/packages/uipath-platform/src/uipath/platform/orchestrator/mcp.py index dd96353a0..ca2050da3 100644 --- a/packages/uipath-platform/src/uipath/platform/orchestrator/mcp.py +++ b/packages/uipath-platform/src/uipath/platform/orchestrator/mcp.py @@ -18,6 +18,7 @@ class McpServerType(IntEnum): Remote = 4 # HTTP connection to remote MCP server ProcessAssistant = 5 # Dynamic user process assistant Platform = 6 # Platform MCP server (e.g: Orchestrator, TestManager) + Swagger = 7 # User-provided Swagger/OpenAPI spec exposed as MCP server class McpServerStatus(IntEnum): diff --git a/packages/uipath-platform/tests/services/test_mcp_service.py b/packages/uipath-platform/tests/services/test_mcp_service.py index fdc5d8ee1..d40082610 100644 --- a/packages/uipath-platform/tests/services/test_mcp_service.py +++ b/packages/uipath-platform/tests/services/test_mcp_service.py @@ -551,3 +551,21 @@ async def test_retrieve_async_passes_all_kwargs( call_kwargs.kwargs["headers"][HEADER_FOLDER_KEY] == "test-folder-key" ) + + +class TestMcpServerType: + """Tests for the McpServerType enum and McpServer validation.""" + + def test_swagger_type_value(self) -> None: + from uipath.platform.orchestrator.mcp import McpServerType + + assert McpServerType.Swagger == 7 + + def test_validate_swagger_server(self) -> None: + """A Swagger (type=7) server must validate — regression for backend + server types newer than the SDK's enum.""" + server = McpServer.model_validate( + {"slug": "contoso-directory", "name": "Employee Directory", "type": 7} + ) + assert server.type == 7 + assert server.slug == "contoso-directory" diff --git a/packages/uipath-platform/uv.lock b/packages/uipath-platform/uv.lock index 2c3e5d025..19a00447a 100644 --- a/packages/uipath-platform/uv.lock +++ b/packages/uipath-platform/uv.lock @@ -1095,7 +1095,7 @@ dev = [ [[package]] name = "uipath-platform" -version = "0.1.76" +version = "0.1.77" source = { editable = "." } dependencies = [ { name = "httpx" }, diff --git a/packages/uipath/uv.lock b/packages/uipath/uv.lock index 989e4b5ea..0d745bb8f 100644 --- a/packages/uipath/uv.lock +++ b/packages/uipath/uv.lock @@ -2691,7 +2691,7 @@ dev = [ [[package]] name = "uipath-platform" -version = "0.1.76" +version = "0.1.77" source = { editable = "../uipath-platform" } dependencies = [ { name = "httpx" },