Skip to content

Conversation

@edis-uipath
Copy link
Collaborator

@edis-uipath edis-uipath commented Jul 9, 2025

This PR adds a sample MCP server for long-running operations with real-time progress reporting, including configuration and documentation.

Introduces server.py with async tools for fixed, custom, and random-duration blocking tasks
Adds MCP and UiPath configuration files (mcp.json, uipath.json, pyproject.toml)
Supplies comprehensive README.md for setup and usage

@edis-uipath edis-uipath self-assigned this Jul 9, 2025

This comment was marked as outdated.

@edis-uipath edis-uipath force-pushed the feature/mcp_samples_env_longrunning branch 2 times, most recently from 0561543 to 65eea99 Compare July 9, 2025 12:56
@edis-uipath edis-uipath changed the title Mcp samples for env server and long running Mcp sample for long running Jul 9, 2025
@edis-uipath edis-uipath requested a review from Copilot July 9, 2025 12:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a sample MCP server for long-running operations with real-time progress reporting, including configuration and documentation.

  • Introduces server.py with async tools for fixed, custom, and random-duration blocking tasks
  • Adds MCP and UiPath configuration files (mcp.json, uipath.json, pyproject.toml)
  • Supplies comprehensive README.md for setup and usage

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
samples/mcp-longrunning-server/uipath.json Defines UiPath entry point (check filePath)
samples/mcp-longrunning-server/server.py Implements async blocking tasks with progress and logging
samples/mcp-longrunning-server/pyproject.toml Project metadata and dependency on uipath-mcp
samples/mcp-longrunning-server/mcp.json Configures the MCP server transport and command
samples/mcp-longrunning-server/README.md Instructions and examples for using the long-running server
Comments suppressed due to low confidence (1)

samples/mcp-longrunning-server/server.py:12

  • Add unit tests for run_blocking_operation and the tool functions to verify progress reporting, error handling, and result structure.
async def run_blocking_operation(

ctx: Context
) -> Dict[str, Any]:
"""Run a blocking operation with progress notifications."""
start_time = time.time()
Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using time.monotonic() instead of time.time() for measuring elapsed durations to avoid issues with system clock changes.

Suggested change
start_time = time.time()
start_time = time.monotonic()

Copilot uses AI. Check for mistakes.
}

# Generate random duration between 0 and max_duration_seconds
random_duration = random.uniform(0, max_duration_seconds)
Copy link

Copilot AI Jul 9, 2025

Choose a reason for hiding this comment

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

[nitpick] Currently you cast random_duration to int, which truncates the fractional part and may lead to inconsistent logs versus actual runtime. Consider using math.ceil or document the truncation behavior.

Copilot uses AI. Check for mistakes.
@edis-uipath edis-uipath force-pushed the feature/mcp_samples_env_longrunning branch from 65eea99 to 9062bdb Compare July 9, 2025 13:07
@edis-uipath edis-uipath merged commit 3d1a182 into main Jul 30, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants