From 814ba39153fd0649f7832d3d852522decf3da885 Mon Sep 17 00:00:00 2001 From: Eduard Stanculet Date: Sun, 14 Jun 2026 10:27:40 +0300 Subject: [PATCH 1/3] chore(mcp): bump mcp to 1.27.2 for 2025-11-25 protocol support Upgrades the `mcp` SDK from 1.26.0 to the latest stable 1.27.2, whose LATEST_PROTOCOL_VERSION is "2025-11-25". The MCP client negotiates the SDK's latest protocol version on initialize, so this is what lets UiPath MCP servers offer tasks to the agent (prerequisite for suspend-on-UiPath-task). The forked streamable-HTTP transport (which adds UiPath's session-id save/provide layer, needed so a suspended agent resumes onto the same MCP session) is kept as-is: the official client/streamable_http.py is byte-identical between 1.26.0 and 1.27.2, so there is nothing to re-sync, and the official client still offers no way to provide an initial session id through its public entrypoint. Adds a guard test that LATEST_PROTOCOL_VERSION is 2025-11-25, the task result types (CreateTaskResult / GetTaskResult / TaskMetadata) are importable, and Result exposes _meta. Full test suite green (2081 passed). Co-Authored-By: Claude Opus 4.8 (1M context) --- pyproject.toml | 2 +- .../tools/test_mcp/test_protocol_version.py | 31 +++++++++++++++++++ uv.lock | 10 +++--- 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 tests/agent/tools/test_mcp/test_protocol_version.py diff --git a/pyproject.toml b/pyproject.toml index d9f81ee6d..66715f141 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ dependencies = [ "openinference-instrumentation-langchain>=0.1.56", "jsonschema-pydantic-converter>=0.4.0", "jsonpath-ng>=1.7.0", - "mcp==1.26.0", + "mcp==1.27.2", "langchain-mcp-adapters==0.2.1", "pillow>=12.1.1", "a2a-sdk>=0.2.0,<1.0.0", diff --git a/tests/agent/tools/test_mcp/test_protocol_version.py b/tests/agent/tools/test_mcp/test_protocol_version.py new file mode 100644 index 000000000..d72d689f8 --- /dev/null +++ b/tests/agent/tools/test_mcp/test_protocol_version.py @@ -0,0 +1,31 @@ +"""Guards for the mcp SDK upgrade (PR-A). + +The MCP client negotiates ``LATEST_PROTOCOL_VERSION`` on initialize, so pinning the SDK to a +version that ships ``2025-11-25`` is what lets UiPath MCP servers offer tasks. These tests fail +loudly if the dependency is ever downgraded below a tasks-capable release. +""" + +from mcp.types import ( + LATEST_PROTOCOL_VERSION, + CreateTaskResult, + GetTaskResult, + Result, + TaskMetadata, +) + + +def test_sdk_negotiates_2025_11_25() -> None: + # The client requests LATEST_PROTOCOL_VERSION; tasks require 2025-11-25. + assert LATEST_PROTOCOL_VERSION == "2025-11-25" + + +def test_sdk_exposes_task_types() -> None: + # Task result types must be importable — the suspend-on-UiPath-task feature reads them. + assert CreateTaskResult is not None + assert GetTaskResult is not None + assert TaskMetadata is not None + + +def test_result_exposes_meta() -> None: + # The UiPath-job marker rides the result's _meta; the client reads it to detect a UiPath job. + assert "meta" in Result.model_fields diff --git a/uv.lock b/uv.lock index 044bbd274..ea18680a3 100644 --- a/uv.lock +++ b/uv.lock @@ -9,7 +9,7 @@ resolution-markers = [ ] [options] -exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values. +exclude-newer = "2026-06-12T07:24:09.025916Z" exclude-newer-span = "P2D" [options.exclude-newer-package] @@ -2200,7 +2200,7 @@ wheels = [ [[package]] name = "mcp" -version = "1.26.0" +version = "1.27.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, @@ -2218,9 +2218,9 @@ dependencies = [ { name = "typing-inspection" }, { name = "uvicorn", marker = "sys_platform != 'emscripten'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/fc/6d/62e76bbb8144d6ed86e202b5edd8a4cb631e7c8130f3f4893c3f90262b10/mcp-1.26.0.tar.gz", hash = "sha256:db6e2ef491eecc1a0d93711a76f28dec2e05999f93afd48795da1c1137142c66", size = 608005, upload-time = "2026-01-24T19:40:32.468Z" } +sdist = { url = "https://files.pythonhosted.org/packages/27/3c/347cf965d313f5d41764e7d46bea6ffe7d9ef13b983cc429b0340962a082/mcp-1.27.2.tar.gz", hash = "sha256:8e02db104096d1c25b28e64bde29a5c32b31bc241710213e12fd4d84985bdfef", size = 621116, upload-time = "2026-05-29T17:16:04.039Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/fd/d9/eaa1f80170d2b7c5ba23f3b59f766f3a0bb41155fbc32a69adfa1adaaef9/mcp-1.26.0-py3-none-any.whl", hash = "sha256:904a21c33c25aa98ddbeb47273033c435e595bbacfdb177f4bd87f6dceebe1ca", size = 233615, upload-time = "2026-01-24T19:40:30.652Z" }, + { url = "https://files.pythonhosted.org/packages/c9/11/252c6f971dc4f16af1d98a1c469d8ba523aab00d1bb76b4d3bc1ff32eacc/mcp-1.27.2-py3-none-any.whl", hash = "sha256:d6ff5160c6ca65d93013626efb3fc249de683c30b2d8570755ceddd490344de5", size = 220498, upload-time = "2026-05-29T17:16:02.442Z" }, ] [[package]] @@ -4458,7 +4458,7 @@ requires-dist = [ { name = "langchain-mcp-adapters", specifier = "==0.2.1" }, { name = "langgraph", specifier = ">=1.1.8,<2.0.0" }, { name = "langgraph-checkpoint-sqlite", specifier = ">=3.0.3,<4.0.0" }, - { name = "mcp", specifier = "==1.26.0" }, + { name = "mcp", specifier = "==1.27.2" }, { name = "openinference-instrumentation-langchain", specifier = ">=0.1.56" }, { name = "pillow", specifier = ">=12.1.1" }, { name = "pydantic-settings", specifier = ">=2.6.0" }, From d160b2a84715370a9bfbf954d44d2d676e4de283 Mon Sep 17 00:00:00 2001 From: Eduard Stanculet Date: Sun, 14 Jun 2026 16:31:48 +0300 Subject: [PATCH 2/3] chore(mcp): drop the protocol-version guard test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes tests/agent/tools/test_mcp/test_protocol_version.py. It pinned task-type imports (CreateTaskResult / TaskMetadata) and the 2025-11-25 constant — assumptions the long-running-job design has moved away from: the chosen _meta-based contract doesn't use the SDK task types (which 2.x removes anyway). The version bump stands on the rest of the mcp suite. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../tools/test_mcp/test_protocol_version.py | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 tests/agent/tools/test_mcp/test_protocol_version.py diff --git a/tests/agent/tools/test_mcp/test_protocol_version.py b/tests/agent/tools/test_mcp/test_protocol_version.py deleted file mode 100644 index d72d689f8..000000000 --- a/tests/agent/tools/test_mcp/test_protocol_version.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Guards for the mcp SDK upgrade (PR-A). - -The MCP client negotiates ``LATEST_PROTOCOL_VERSION`` on initialize, so pinning the SDK to a -version that ships ``2025-11-25`` is what lets UiPath MCP servers offer tasks. These tests fail -loudly if the dependency is ever downgraded below a tasks-capable release. -""" - -from mcp.types import ( - LATEST_PROTOCOL_VERSION, - CreateTaskResult, - GetTaskResult, - Result, - TaskMetadata, -) - - -def test_sdk_negotiates_2025_11_25() -> None: - # The client requests LATEST_PROTOCOL_VERSION; tasks require 2025-11-25. - assert LATEST_PROTOCOL_VERSION == "2025-11-25" - - -def test_sdk_exposes_task_types() -> None: - # Task result types must be importable — the suspend-on-UiPath-task feature reads them. - assert CreateTaskResult is not None - assert GetTaskResult is not None - assert TaskMetadata is not None - - -def test_result_exposes_meta() -> None: - # The UiPath-job marker rides the result's _meta; the client reads it to detect a UiPath job. - assert "meta" in Result.model_fields From 9212b63230e42aa8c2d536dde36a9ced4e90fa5e Mon Sep 17 00:00:00 2001 From: Eduard Stanculet Date: Tue, 16 Jun 2026 13:06:35 +0300 Subject: [PATCH 3/3] chore: bump uipath-langchain to 0.11.19 and regenerate uv.lock Rebased onto main (now 0.11.18) and bumped to 0.11.19 for the mcp 1.27.2 upgrade. Co-Authored-By: Claude Opus 4.8 (1M context) --- pyproject.toml | 2 +- uv.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 66715f141..04de87a82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-langchain" -version = "0.11.18" +version = "0.11.19" description = "Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/uv.lock b/uv.lock index ea18680a3..ba9d354a4 100644 --- a/uv.lock +++ b/uv.lock @@ -9,7 +9,7 @@ resolution-markers = [ ] [options] -exclude-newer = "2026-06-12T07:24:09.025916Z" +exclude-newer = "2026-06-14T10:05:28.34006Z" exclude-newer-span = "P2D" [options.exclude-newer-package] @@ -4388,7 +4388,7 @@ wheels = [ [[package]] name = "uipath-langchain" -version = "0.11.18" +version = "0.11.19" source = { editable = "." } dependencies = [ { name = "a2a-sdk" },