-
Notifications
You must be signed in to change notification settings - Fork 5
Mcp sample for long running #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0561543 to
65eea99
Compare
There was a problem hiding this 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.pywith 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.mdfor 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_operationand 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() |
Copilot
AI
Jul 9, 2025
There was a problem hiding this comment.
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.
| start_time = time.time() | |
| start_time = time.monotonic() |
| } | ||
|
|
||
| # Generate random duration between 0 and max_duration_seconds | ||
| random_duration = random.uniform(0, max_duration_seconds) |
Copilot
AI
Jul 9, 2025
There was a problem hiding this comment.
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.
65eea99 to
9062bdb
Compare
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