| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…ntextprotocol#1756) Replace restrictive regex pattern with lightweight validator that only checks for type/subtype structure (presence of '/'), aligning with the MCP spec which defines mimeType as an optional string with no format constraints. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thanks for the PR! The approach here was sound, but closing in favor of #2235 which goes one step further and removes validation entirely — this keeps Resource consistent with ResourceTemplate (same module, no validation) and with the TypeScript/Go/C# SDKs. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Closes #1756
What changed
src/mcp/server/mcpserver/resources/base.py
Why this approach
The previous regex was too restrictive for RFC 2045 compliance. Rather than trying to write a more complex regex that covers all edge cases (quoted strings, special characters, wildcards, etc.), this PR follows the MCP spec's intent: mimeType is a plain string, and validation should only catch obvious mistakes (like passing "plaintext" instead of "text/plain"). This is consistent with:
Test plan
🤖 Generated with Claude Code