feat(spec): add renderTiming to McpUiToolMeta for deferred View rendering#553
Open
netanelavr wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
feat(spec): add renderTiming to McpUiToolMeta for deferred View rendering#553netanelavr wants to merge 1 commit intomodelcontextprotocol:mainfrom
netanelavr wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
…ring Add a new `renderTiming` field to `McpUiToolMeta` that lets servers declare when a View should appear in the conversation: - "inline" (default): render as soon as the tool returns - "end-of-turn": defer rendering until the agent's turn is complete This addresses a gap in the spec where hosts have no standardized way to know whether a View should be shown immediately or after the agent finishes its turn. Tools like "Apply to Site" need deferred rendering to prevent premature user interaction while the agent is still making additional tool calls. This is orthogonal to the existing visual `displayMode` (inline/fullscreen/pip) which controls layout, not timing. Changes: - spec.types.ts: add McpUiRenderTiming type and renderTiming field - types.ts: re-export new type and schema - specification/draft/apps.mdx: document Render Timing section and design decision - generated/schema.*: auto-regenerated from types Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
renderTimingfield toMcpUiToolMetathat lets servers declare when a View should appear in the conversation, addressing a gap in the spec where hosts have no standardized way to distinguish between Views that should render immediately vs. after the agent finishes its turn.Problem
The current spec defines
displayMode(inline/fullscreen/pip) for visual layout, but has no concept of temporal presentation — i.e., when to show the View. In agentic workflows where the LLM makes multiple sequential tool calls, some Views (e.g., "Apply to Site", confirmation dialogs) should only appear after the agent is done reasoning, to prevent premature user interaction.Today, hosts that need this behavior must invent proprietary metadata fields. This PR standardizes the pattern.
Solution
New type and field on
McpUiToolMeta:"inline"(default) — render the View as soon as the tool returns"end-of-turn"— defer rendering until the agent's turn is complete (no more tool calls)Design decisions
displayMode: Timing and layout are independent concerns — a View can beend-of-turn+fullscreen"inline", existing tools are unaffected"on-user-action") without breaking changesPrior art
_meta.ui.displayModefield with"inline"/"end-of-turn"values). This PR standardizes the concept._meta["openai/toolInvocation/invoking"]/invokedfields tracked in Protocol discrepancies between MCP Apps and Apps SDK #201, though those are status text rather than timing control.Changes
src/spec.types.ts— addMcpUiRenderTimingtype andrenderTimingfield toMcpUiToolMetasrc/types.ts— re-export new type and schemaspecification/draft/apps.mdx— document Render Timing section and design decisionsrc/generated/*— auto-regenerated schemas (Zod + JSON Schema + tests)Test plan
npm test— all 121 tests passnpm run build— builds successfully including all examplesMcpUiRenderTiminground-trips correctlyMade with Cursor