Commit baa4857
committed
fix: remove MIME type validation from MCPServer Resource
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: #17561 parent b33c811 commit baa4857
File tree
2 files changed
+9
-5
lines changed- src/mcp/server/mcpserver/resources
- tests/server/mcpserver/resources
2 files changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 26 | + | |
31 | 27 | | |
32 | 28 | | |
33 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
94 | 102 | | |
95 | 103 | | |
96 | 104 | | |
| |||
0 commit comments