Skip to content

feat(mcp-jobs): framework-neutral core for long-running UiPath jobs over MCP#1717

Open
edis-uipath wants to merge 1 commit into
mainfrom
feat/mcp-jobs-neutral-core
Open

feat(mcp-jobs): framework-neutral core for long-running UiPath jobs over MCP#1717
edis-uipath wants to merge 1 commit into
mainfrom
feat/mcp-jobs-neutral-core

Conversation

@edis-uipath

Copy link
Copy Markdown
Collaborator

Framework-neutral core for long-running UiPath jobs over MCP

Adds uipath.platform.mcp_jobs — the MCP-SDK-free core for the uipath.com/job contract (Option 6 of the design). It lets any UiPath framework integration suspend an agent while an Orchestrator job that an MCP server started runs, then resume with the result.

What's here

  • UiPathJobHandle / JobStart value objects (frozen dataclasses).
  • _meta helpers for the single uipath.com/job key — build_start_meta, build_fetch_meta, read_job_handle, read_job_version — operating on plain dicts, so they work against any mcp SDK version with no mcp import.
  • McpJobExecutor Protocol (run(*, start, fetch, tool_name)) + the neutral BlockingJobExecutor default (polls jobs.retrieve_async to a terminal state, then FETCHes).

Framework adapters (e.g. a LangGraph suspend executor — see the uipath-langchain PR) reuse this core and supply only their own executor; interrupt/framework primitives never leak in here.

Why mcp-free

uipath-python has no mcp dependency (the SDK only appears in samples). Keeping the core on plain dicts makes it robust across mcp 1.x/2.x; the wire (CallToolRequest/CallToolResult) is owned by the consumer.

Testing

  • packages/uipath-platform: 14 new tests (tests/mcp_jobs/); ruff + mypy clean.

Downstream

This is the base for the uipath-langchain client PR (feat/mcp-uipath-jobs), which bumps its uipath-platform floor to the version this ships.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 15, 2026 05:18
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new uipath.platform.mcp_jobs package that provides an MCP-SDK-free core for the uipath.com/job _meta contract and a framework-neutral execution abstraction for long-running Orchestrator jobs, along with unit tests and a package version bump.

Changes:

  • Introduced value objects (UiPathJobHandle, JobStart) and _meta helpers for START/FETCH signaling over plain dicts.
  • Added an executor protocol plus a default polling implementation (BlockingJobExecutor) for awaiting job completion then FETCHing results.
  • Added new tests/mcp_jobs/* coverage and bumped uipath-platform version to 0.1.65.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/uipath-platform/uv.lock Bumps locked editable package version to 0.1.65.
packages/uipath-platform/pyproject.toml Bumps package version to 0.1.65.
packages/uipath-platform/src/uipath/platform/mcp_jobs/init.py Public exports for the new MCP jobs core API.
packages/uipath-platform/src/uipath/platform/mcp_jobs/_handle.py Adds frozen dataclass value objects for job handle and START outcome.
packages/uipath-platform/src/uipath/platform/mcp_jobs/_meta.py Adds framework-neutral helpers to build/parse the uipath.com/job _meta contract.
packages/uipath-platform/src/uipath/platform/mcp_jobs/_executor.py Adds executor protocol and default polling-based executor implementation.
packages/uipath-platform/tests/mcp_jobs/test_meta.py Unit tests for _meta builder/parser helpers.
packages/uipath-platform/tests/mcp_jobs/test_executor.py Unit tests for polling executor behavior (non-job, terminal states, timeout).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +108 to +109
version = section.get("version")
return version if isinstance(version, int) else None
Comment on lines +129 to +130
loop = asyncio.get_event_loop()
deadline = None if self._timeout is None else loop.time() + self._timeout
…ver MCP

Adds `uipath.platform.mcp_jobs`, the MCP-SDK-free core for the Option-6
"UiPath jobs over MCP via _meta" contract:

- `UiPathJobHandle` / `JobStart` value objects (frozen dataclasses).
- `_meta` helpers for the single `uipath.com/job` key — `build_start_meta`,
  `build_fetch_meta`, `read_job_handle`, `read_job_version` — operating on plain
  dicts so they work across any mcp SDK version (no `mcp` import).
- `McpJobExecutor` Protocol (`run(*, start, fetch, tool_name)`) and the neutral
  `BlockingJobExecutor` default (polls `jobs.retrieve_async` to a terminal state,
  then FETCHes). Framework adapters (e.g. LangGraph suspend) live downstream.

Framework integrations reuse this core and supply only their own executor.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@edis-uipath edis-uipath force-pushed the feat/mcp-jobs-neutral-core branch from 90a6728 to 39888d8 Compare June 15, 2026 09:14
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants