Skip to content

fix(apps): forward _meta in tool results to MCP Apps#7476

Merged
aharvard merged 1 commit intomainfrom
fix/forward-meta-to-mcp-apps
Feb 24, 2026
Merged

fix(apps): forward _meta in tool results to MCP Apps#7476
aharvard merged 1 commit intomainfrom
fix/forward-meta-to-mcp-apps

Conversation

@aharvard
Copy link
Copy Markdown
Collaborator

Summary

Fixes #7435

The _meta property from tool results was being silently dropped when forwarding to MCP Apps via the @mcp-ui/client SDK's AppRenderer component. This is a regression introduced in #7013.

Root Cause

When #7013 refactored McpAppRenderer to use the SDK's AppRenderer, the custom McpAppToolResult type was created without _meta, and the conversion logic in the appToolResult memo only mapped content and structuredContent.

The upstream data (from rmcp's CallToolResult) does include _meta on the wire — it was just being discarded at the TypeScript boundary.

Changes

  • types.ts: Add _meta?: { [key: string]: unknown } to McpAppToolResult
  • McpAppRenderer.tsx: Forward _meta in the appToolResult memo

Testing

  • TypeScript compiles clean
  • ESLint passes
  • All 340 UI tests pass
  • Manually verified with an MCP App that reads toolResult._meta

The McpAppToolResult type and appToolResult memo were missing the _meta
property, causing it to be silently dropped when converting tool results
for the @mcp-ui/client SDK's AppRenderer component.

This is a regression from #7013 which refactored McpAppRenderer to use
the SDK's AppRenderer. The custom McpAppToolResult type was created
without _meta, and the conversion logic only mapped content and
structuredContent.

Fixes #7435
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a regression from #7013 where the _meta property from tool results was being dropped when forwarding to MCP Apps. The MCP Apps specification requires hosts to forward the entire tool execution result, including _meta, to the app view. The fix adds the missing _meta field to the McpAppToolResult type and ensures it's properly forwarded in the conversion logic.

Changes:

  • Add _meta?: { [key: string]: unknown } to McpAppToolResult type definition
  • Forward _meta property in the appToolResult memo when converting to CallToolResult

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ui/desktop/src/components/McpApps/types.ts Add optional _meta field to McpAppToolResult type
ui/desktop/src/components/McpApps/McpAppRenderer.tsx Forward _meta from toolResult to appToolResult in the conversion memo

@aharvard aharvard requested a review from DOsinga February 24, 2026 15:47
@@ -40,6 +40,7 @@ export type McpAppToolCancelled = McpUiToolCancelledNotification['params'];
export type McpAppToolResult = {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need this type? isn't this just CallToolResult?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No, we don't, but upon further investigation, we are sending camel case over the wire and should make updates in the backend. Will follow up with another PR for that.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

here's the follow-up PR #7487

@aharvard aharvard force-pushed the fix/forward-meta-to-mcp-apps branch from b4936b2 to 9752efc Compare February 24, 2026 17:19
Copilot AI review requested due to automatic review settings February 24, 2026 17:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@aharvard aharvard added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit c8b70b4 Feb 24, 2026
45 of 46 checks passed
@aharvard aharvard deleted the fix/forward-meta-to-mcp-apps branch February 24, 2026 17:51
u35tpus pushed a commit to u35tpus/goose that referenced this pull request Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Goose 1.25.0 does not pass toolResult._meta to MCP Apps

3 participants