Skip to content

Advertise the MCP Apps extension only when the server serves an app - #5062

Merged
zzstoatzz merged 3 commits into
PrefectHQ:mainfrom
lancy69:fix/mcp-apps-capability-gating
Nov 10, 2026
Merged

zzstoatzz merged 3 commits into
PrefectHQ:mainfrom
lancy69:fix/mcp-apps-capability-gating

Conversation

@lancy69

@lancy69 lancy69 commented Sep 11, 2026 •

Copy link
Copy Markdown

Every FastMCP server declared io.modelcontextprotocol/ui in capabilities.extensions, whether or not it had an app to render. This change omits that declaration for plain servers, while retaining it for components carrying _meta.ui, ui:// resources and resource templates, and resources using the MCP Apps MIME type.

Providers answer a synchronous may_serve_apps query without I/O. Local registries can answer precisely; aggregate and mounted providers include their children. Providers with transforms, proxies, and other providers that cannot be inspected synchronously retain the declaration conservatively, because hiding a real app is worse than advertising a possible one. This includes apps introduced by ToolTransformConfig(meta={"ui": ...}). Explicitly registered extensions retain their settings. The existing Apps extension splice remains in place pending its migration to the extension API.

from fastmcp import FastMCP
from fastmcp.apps import AppConfig

plain = FastMCP("plain")

@plain.tool
def ping() -> str:
    return "pong"

# No MCP Apps capability: this server has no app components or transforms.

dashboard = FastMCP("dashboard")

@dashboard.tool(app=AppConfig(resource_uri="ui://dashboard"))
def chart() -> dict[str, int]:
    return {"value": 42}

# The dashboard server advertises io.modelcontextprotocol/ui.

Fixes #4919

@github-actions

This comment has been minimized.

@marvin-context-protocol marvin-context-protocol Bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. mcp apps Related to MCP Apps - user-facing applications with frontend bundles served by MCP servers. labels Sep 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e474dcc808

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lancy69

lancy69 commented Oct 25, 2026

Copy link
Copy Markdown
Author

@zzstoatzz Merged current main and fixed the transform-related capability finding across local, aggregate, wrapped, and mounted providers; the addressed thread is resolved. Local verification passed: 9,907 tests passed (14 skipped, 16 expected failures), and all configured static hooks passed.

Could you approve the fork workflow runs and review this update? The new Tests, Run static analysis, and Downstream smoke runs are waiting for approval. GitHub denied my formal reviewer request, so I'm asking here instead.

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-25T14:45:44.412933Z
We couldn’t complete this review. Comment @codex review to try again.
7ddae42 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lancy69

lancy69 commented Oct 25, 2026

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lancy69

lancy69 commented Oct 26, 2026

Copy link
Copy Markdown
Author

@zzstoatzz The Codex review on 7ddae423 failed twice with “An unknown error occurred,” including after a manual retry. I'll stop retriggering it to avoid more noise. Could a maintainer review the update directly and approve the pending fork CI runs (Tests, Run static analysis, and Downstream smoke)?

The branch is conflict-free, the original transform-related finding is fixed and resolved, and local verification passed: 9,907 tests passed (14 skipped, 16 expected failures), plus all configured static hooks. Upstream CI has not run on this revision yet.

@andreivince

Copy link
Copy Markdown
Contributor

A plain server does stop advertising Apps, so the main fix works. I did find one gap though. I connected to a server with no apps, then called a tool that registered one. The same client could list the new tool and read its ui:// resource, but the Apps capability stayed missing until I reconnected. Main advertises it the whole time.

The description says hiding a real app is worse than advertising a possible one, and this hides one. Registering the extension explicitly does keep it advertised, so maybe a line in the docs is enough.

Tested on 7ddae423 and with 9e553dd merged in, plus local HTTP on the merged version. I didn't try it in a real host, so I can't say how much hosts care.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zzstoatzz
zzstoatzz merged commit b89222b into PrefectHQ:main Nov 10, 2026
35 of 36 checks passed
zzstoatzz added a commit that referenced this pull request Nov 10, 2026
* Revert "fix: preserve referenced schema definitions (#5588)"

This reverts commit 5f1d152.

* Revert "fix(server): rebuild tool argument errors instead of echoing pydantic's (#6107)"

This reverts commit 8fba5f7.

* Revert "Advertise the MCP Apps extension only when the server serves an app (#5062)"

This reverts commit b89222b.

* Revert "fix(tasks): retain results after tool removal (#5507)"

This reverts commit 711575a.

* Revert "fix(client): Prevent stale ClientGroup refreshes from replacing newer routes (#5543)"

This reverts commit 365d5d2.

* Revert "fix(prompts): honor field aliases when rendering prompts (#5836)"

This reverts commit a450fd8.

* Revert "Stop FastMCP callable caches from retaining dropped tools (#6147)"

This reverts commit 713f247.

* Revert "feat(auth): Add KeystoneTokenVerifier (#6264)"

This reverts commit c33f3de.

* Revert "fix(json-schema): keep x-unsupported-pattern when a format is set (#5731)"

This reverts commit dc9849d.

* Revert "Roll back the tool stamp when a tool registration is rejected (#5798)"

This reverts commit d6566c5.

* Revert "fix(server): validate cursors when pagination is disabled (#6045)"

This reverts commit 4917bee.

* Revert "Keep constraints on scalar schema references (#6041)"

This reverts commit e5176c9.
@lancy69
lancy69 deleted the fix/mcp-apps-capability-gating branch November 11, 2026 05:43
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. bypass-issue-check mcp apps Related to MCP Apps - user-facing applications with frontend bundles served by MCP servers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server advertises the MCP Apps extension when no app is registered

3 participants