| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The MIME type validation regex was too restrictive and rejected valid RFC 2045 MIME types with parameters like `text/html;profile=mcp-app`. This is needed for MCP-UI widgets that use parameterized MIME types. The regex now supports: - Basic types: text/plain, application/json - With parameters: text/html;profile=mcp-app, application/json; charset=utf-8 - Multiple parameters: text/plain; charset=utf-8; format=fixed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Github-Issue: modelcontextprotocol#1754
There was a problem hiding this comment.
Thanks for fixing this! The regex change correctly handles the common parameter cases needed for MCP Apps SDK compatibility.
One note: the regex is still more restrictive than RFC 2045 (doesn't support quoted string values like charset="utf-8"), but this covers the practical use cases. Opened #1756 to track aligning with the TypeScript SDK approach.
Sorry, something went wrong.
The resource functions are only used for metadata validation, not actually called in these tests.
|
This PR is included in version v1.23.3 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixes #1754
Details
The MIME type validation regex in FastMCP's Resource class was too restrictive:
Now supports:
Test plan
🤖 Generated with Claude Code