Implement FastMCP 2.0 upgrade and httpx monkey patch #60
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.
Overview
This PR implements the changes required to upgrade to FastMCP 2.0 and resolve compatibility issues with the agent's httpx request handling.
Changes Made
🔧 Agent-side httpx Monkey Patch
🚀 Server Updates
🛠️ Build Script Improvements
Key Features
✅ FastMCP 2.0 Integration: Leverages the new Context object for enhanced HTTP request access
✅ Auth Header Support: Enables access to authentication headers and custom client information
✅ Mount Point Compatibility: Maintains proper routing despite endpoint format differences
✅ Registry File Management: Automated copying of registry files to deployment location
✅ Faiss Index Cleanup: Automatic cleanup on startup for multi-tenancy preparation
Testing
This implementation has been tested with:
Related Issues
Fixes #59
Context
This change addresses the compatibility issue where FastMCP 2.0 returns while the Anthropic SDK returns . The httpx monkey patch ensures the agent can properly handle both formats while taking advantage of FastMCP 2.0's enhanced capabilities.
For additional context, see the related discussions in the MCP ecosystem: