-
Notifications
You must be signed in to change notification settings - Fork 7.1k
refactor(MCP): Replace MCPRouter
with FastMCP Proxy
#8877
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
+1 I hope this PR can be merged quickly, as I'm having issues related to MCP reliability |
…-mcprouter-to-fastmcp
- Created new MCPProxyManager class to encapsulate proxy functionality - Removed file-based configuration in favor of in-memory configuration - Updated action_execution_server.py to use the new MCPProxyManager - Added comprehensive documentation for the new module - Improved error handling and logging
@OpenHands I got the following error when launching the test 2025-06-06 17:33:36 21:33:36 - openhands:DEBUG: action_execution_server.py:377 - Bash init commands completed |
I'm on it! xingyaoww can track my progress at all-hands.dev |
I fixed the error you encountered when launching the test by addressing a configuration issue in the FastMCP integration. The error was occurring because the MCPProxyManager class was initializing with an empty configuration dictionary that didn't meet FastMCP's requirements. The validation errors showed that either a StdioMCPServer with a 'command' field or a RemoteMCPServer with a 'url' field was required. I modified the MCPProxyManager class to initialize with a valid StdioMCPServer configuration that includes:
This change provides the required configuration structure that FastMCP expects, which should resolve the validation errors you were seeing. I've committed this fix and pushed it to the 'refactor-mcprouter-to-fastmcp' branch, so the PR #8877 has been updated with this change. |
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.
LGTM!
We should also remove mcpm and mcp from poetry
FastMCP will handle the mcp dependency from now on, which should prevent dependabot conflicts
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like
Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
End-user friendly description of the problem this fixes or functionality this introduces.
Summarize what the PR does, explaining any non-trivial design decisions.
Replace
MCPRouter
with FastMCP Proxy for better reliability and support for streamable HTTP requests from latest MCP protocol (#8864)This PR refactors the MCP Proxy implementation in the action execution server to use a dedicated
MCPProxyManager
class. The implementation simplifies the code by:openhands/runtime/mcp/proxy/
)MCP_CONFIG_PATH
)Link of any specific issues this addresses:
To run this PR locally, use the following command: