Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Owner
|
Soo did you fix it @copilot |
Co-authored-by: jmagar <38927646+jmagar@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix the failing GitHub workflow
fix: Resolve MCP resource URI template parameter extraction issue
Sep 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a critical issue where the Docker MCP server failed to start due to MCP resource registration errors. The error occurred when FastMCP attempted to register resource templates with multiple URI parameters.
Problem
The GitHub Actions workflow was failing with the following error during container startup:
{ "error": "Required function arguments {'stack_name', 'host_id'} must be a subset of the URI parameters {'host_id'}", "event": "Failed to register MCP resources" }This prevented the Docker container from starting successfully, causing the
test-imagejob to fail consistently.Root Cause
The issue was in the
_resource_to_templatemethod indocker_mcp/server.py. When URI templates containing multiple parameters (likestacks://{host_id}/{stack_name}) were processed through Pydantic'sAnyUrltype, the template parameters became URL-encoded:stacks://{host_id}/{stack_name}str(resource.uri):stacks://{host_id}/%7Bstack_name%7DThis encoding prevented FastMCP's
FunctionResourceTemplate.from_function()from correctly parsing the template parameters, causing it to only recognizehost_idwhile the function signature required bothhost_idandstack_name.Solution
Modified the
_resource_to_templatemethod to URL-decode the URI string before passing it to the template creation:Testing
Impact
This fix resolves the Docker container startup failure and allows the GitHub Actions workflow to proceed normally. All MCP resources (
ports://,docker://,stacks://,containers://) now register correctly with their respective URI parameters.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
astral.shcurl -LsSf REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.