fix(fastmcp): propagate mimeType in resource template list#1186
Merged
felixweinberger merged 6 commits intomodelcontextprotocol:mainfrom Sep 17, 2025
Merged
Conversation
… test - Fix resource template list did not include the mimeType attribute. - Propagate mimeType from template metadata to the list output in FastMCP. - Add test_resource_template_includes_mime_type to verify that listed resource templates include the correct mimeType and the resource is still accessible via the client.
This PR fixes an issue where the mimeType attribute of resource templates was not included in the results of resource template list in FastMCP. The change ensures that clients receive the correct mimeType metadata. Additionally, a dedicated test is added to verify this behaviour and prevent regressions.
Motivation and Context
Previously, when listing resource templates using FastMCP, the returned objects were missing the mimeType field. This omission could lead to clients being unaware of the correct content type associated with a resource, which in turn could cause issues in handling, displaying, or routing resources based on their type. This change ensures that the mimeType is properly propagated and visible in resource template listings, improving correctness and client interoperability.
How Has This Been Tested?
Breaking Changes
No breaking changes. This is a bug fix; the interface for registering or listing resources/templates is unchanged. Only the metadata in the output is more complete.
Types of changes
Checklist
Additional context
This closes a gap where client code consuming list_resource_templates() or similar methods may have been missing MIME type information for templates, which could impact rendering, routing, or file handling logic.
No changes are required for users who register or access resources—the fix is internal and improves the API response consistency.