fix: fixed retry on MCP client plugin connection. #1030
+44
−18
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.
🐞 Bug Summary
Briefly describe the issue or unexpected behavior.
The max retry code was accidentally removed from the external plugin MCP client. However, it also had a small bug, which caused it to error out on MCPGateway startup when an external plugin. The issue was that the final session connection was being done in the context of the initial temporary connection. As a result, the async exit stack which manages the connection was being unravelled in a bad order.
🧩 Affected Component
Select the area of the project impacted:
mcpgateway
- APImcpgateway
- UI (admin panel)mcpgateway.wrapper
- stdio wrapper🔁 Steps to Reproduce
🤔 Expected Behavior
The server should start as expected.
📓 Logs / Error Output
🧠 Environment Info
You can retrieve most of this from the
/version
endpoint.0.6.0
Python 3.13, Gunicorn
macOS
none