Skip to content

fix: Preserve metadata in FastMCPProvider component wrappers#3057

Merged
jlowin merged 1 commit intoPrefectHQ:mainfrom
NeelayS:fix/preserve-metadata-in-component-wrappers
Feb 2, 2026
Merged

fix: Preserve metadata in FastMCPProvider component wrappers#3057
jlowin merged 1 commit intoPrefectHQ:mainfrom
NeelayS:fix/preserve-metadata-in-component-wrappers

Conversation

@NeelayS
Copy link
Contributor

@NeelayS NeelayS commented Feb 2, 2026

Description

When mounting FastMCP servers, component metadata (meta, title, icons) was not being forwarded through the provider wrapper classes. This caused MCP Apps to fail rendering in clients like Claude Desktop, since the meta["ui"] configuration was lost during composition.

The fix adds meta, title, and icons forwarding to all four FastMCPProvider* wrapper classes: Tool, Resource, Prompt, and ResourceTemplate.

Contributors Checklist

Review Checklist

  • I have self-reviewed my changes
  • My Pull Request is ready for review

@marvin-context-protocol marvin-context-protocol bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. server Related to FastMCP server implementation or server-side functionality. labels Feb 2, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

Walkthrough

This change modifies src/fastmcp/server/providers/fastmcp_provider.py to propagate three optional fields—meta, title, and icons—through FastMCPProvider wrapper constructors for Tool, Resource, Prompt, and ResourceTemplate classes. The wrap() calls now forward these fields from wrapped objects into provider-wrapped instances as keyword arguments. No public API signatures were altered, and control flow remains unchanged; only additional parameters are passed during internal wrapping operations.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: preserving metadata in FastMCPProvider wrapper classes, which is the core objective of the PR.
Description check ✅ Passed The description is well-structured, addresses the problem, explains the fix, and includes all required checklist items properly marked as complete.
Linked Issues check ✅ Passed The PR directly addresses issue #3056 by forwarding meta, title, and icons fields through all four FastMCPProvider wrapper classes, resolving the metadata loss during server composition.
Out of Scope Changes check ✅ Passed All changes are scoped to the FastMCPProvider wrapper classes and focus exclusively on forwarding metadata fields without introducing unrelated modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@jlowin jlowin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jlowin jlowin merged commit c8e2c62 into PrefectHQ:main Feb 2, 2026
9 checks passed
@NeelayS
Copy link
Contributor Author

NeelayS commented Feb 2, 2026

Thanks for the quick merge, @jlowin! Just curious - do you guys have something like a release schedule? Would you be able to give me an estimate of when a version with this change would be available on PyPI? 🙂

@jlowin
Copy link
Member

jlowin commented Feb 2, 2026

@NeelayS we are currently in the beta period for FastMCP 3, so releases are slower than usual. I expect 3.0 beta2 to land maybe end of this week or early next week. 3 will probably not be released fully until later this month, depending also on the release of the MCP SDK v2

@NeelayS
Copy link
Contributor Author

NeelayS commented Feb 2, 2026

@NeelayS we are currently in the beta period for FastMCP 3, so releases are slower than usual. I expect 3.0 beta2 to land maybe end of this week or early next week. 3 will probably not be released fully until later this month, depending also on the release of the MCP SDK v2

Gotcha, thanks!

gfortaine pushed a commit to gfortaine/fastmcp that referenced this pull request Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. server Related to FastMCP server implementation or server-side functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP Apps metadata lost when mounting servers via FastMCPProvider

2 participants