| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The regex pattern on Resource.mime_type was the only MIME type validation anywhere in the MCP ecosystem. It rejected valid RFC 2045 MIME types such as quoted parameter values (text/plain; charset="utf-8") and was inconsistent with ResourceTemplate in the same module, the protocol-level types in _types.py, and every other SDK. The MCP spec defines mimeType as an unconstrained optional string. Github-Issue: #1756
| Back | FazBrowse Home | New Git URL |
Removes the MIME type validation regex from MCPServer.Resource.mime_type.
Closes #1756. Supersedes #1819 and #2067.
Motivation and Context
The pattern= constraint on Resource.mime_type was the only MIME type validation anywhere in the MCP ecosystem, and it rejected valid RFC 2045 MIME types — most notably quoted parameter values like text/plain; charset="utf-8".
#1755 partially fixed this by extending the regex to allow unquoted parameters, but the fundamental problem is that no other SDK validates this field at all, and the spec doesn't ask them to:
The inconsistency with ResourceTemplate in the same module is the clearest signal — if templated resources don't need validation, concrete ones don't either.
How Has This Been Tested?
Breaking Changes
None. Strictly more permissive.
Types of changes
Checklist
Additional context
Two prior PRs attempted this:
This PR just deletes the pattern: +1/-5 source diff.
AI Disclaimer