You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider removing or relaxing MIME type validation in FastMCP resources #1756
The MIME type validation regex in FastMCP's Resource class is more restrictive than RFC 2045 and diverges from the TypeScript SDK (which has no validation). We should consider aligning with the TypeScript SDK approach.
Background
PR #1755 fixed the immediate issue of MIME type parameters being rejected (e.g., text/html;profile=mcp-app), but the current regex still doesn't fully support RFC 2045:
The fix removes the restrictive regex pattern from Resource.mime_type and replaces it with a lightweight field_validator that only checks for the presence of / (basic type/subtype structure). This aligns with the MCP spec (mimeType is a plain string) and the TypeScript SDK (no validation). Includes comprehensive test coverage for quoted parameter values, wildcards, vendor types, etc.
Activity
fix: relax MIME type validation to accept all RFC 2045 types (modelco…
BabyChrist666 commentedon Feb 17, 2026
Opened a PR to fix this: #2067
The fix removes the restrictive regex pattern from
Resource.mime_typeand replaces it with a lightweightfield_validatorthat only checks for the presence of/(basic type/subtype structure). This aligns with the MCP spec (mimeType is a plain string) and the TypeScript SDK (no validation). Includes comprehensive test coverage for quoted parameter values, wildcards, vendor types, etc.fix: remove MIME type validation from MCPServer Resource