Skip to content

feat: add onFallbackRequest handler to McpAppRenderer#7208

Merged
alexhancock merged 2 commits intomainfrom
aharvard/mcp-app-fallback-request
Feb 13, 2026
Merged

feat: add onFallbackRequest handler to McpAppRenderer#7208
alexhancock merged 2 commits intomainfrom
aharvard/mcp-app-fallback-request

Conversation

@aharvard
Copy link
Collaborator

Summary

Add a fallback request handler to McpAppRenderer that catches unhandled MCP requests from the app iframe.

This is a stub implementation that logs the request method and returns success, with a todo to implement sampling/createMessage per #7039.

Changes

  • Import RequestHandlerExtra from @mcp-ui/client
  • Import JSONRPCRequest from @modelcontextprotocol/sdk/types.js
  • Add handleFallbackRequest async callback using useCallback
  • Wire onFallbackRequest prop to AppRenderer

Type fixes

The original snippet had several type issues that are fixed here:

  • Used JSONRPCRequest (correct SDK type) instead of non-existent McpUiFallbackRequest
  • Removed invalid request.url access (JSONRPCRequest has method, not url)
  • Made handler async to match expected Promise<Record<string, unknown>> return type
  • Fixed useCallback dependency array (was [extra] which would be a ReferenceError)

Copilot AI review requested due to automatic review settings February 13, 2026 12:47
Upgrade @mcp-ui/client from ^6.0.0 to ^6.1.0 to get the new
onFallbackRequest prop on AppRenderer.

Add a fallback request handler that catches unhandled MCP requests from
the app iframe. This is a stub that logs the request method and returns
success, with a todo to implement sampling/createMessage per
#7039.

Changes:
- Upgrade @mcp-ui/client to ^6.1.0
- Import RequestHandlerExtra from @mcp-ui/client
- Import JSONRPCRequest from @modelcontextprotocol/sdk/types.js
- Add handleFallbackRequest async callback
- Wire onFallbackRequest prop to AppRenderer
Copy link
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

Adds an onFallbackRequest handler to the desktop UI’s McpAppRenderer so unhandled MCP JSON-RPC requests coming from the embedded app iframe are caught instead of bubbling as unhandled behavior.

Changes:

  • Extends imports to include RequestHandlerExtra and the SDK’s JSONRPCRequest type.
  • Introduces an async handleFallbackRequest callback (currently stubbed).
  • Wires handleFallbackRequest into AppRenderer via the onFallbackRequest prop.

@aharvard aharvard force-pushed the aharvard/mcp-app-fallback-request branch from 2148b19 to dc41773 Compare February 13, 2026 12:51
Update the handleFallbackRequest function to properly handle the 'sampling/createMessage' method. If the method is unrecognized, return an error status with a descriptive message. This improves error handling for unhandled JSON-RPC methods.

Changes:
- Implement specific handling for 'sampling/createMessage'
- Return error status for unhandled methods
Copy link
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 3 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • ui/desktop/package-lock.json: Language not supported

@alexhancock alexhancock added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit 0206035 Feb 13, 2026
40 of 43 checks passed
@alexhancock alexhancock deleted the aharvard/mcp-app-fallback-request branch February 13, 2026 15:42
katzdave added a commit that referenced this pull request Feb 13, 2026
…ntext

* 'main' of github.com:block/goose:
  feat: add onFallbackRequest handler to McpAppRenderer (#7208)
  feat: add streaming support for Claude Code CLI provider (#6833)
  fix: The detected filetype is PLAIN_TEXT, but the provided filetype was HTML (#6885)
  Add prompts (#7212)
  Add testing instructions for speech to text (#7185)
  Diagnostic files copying (#7209)
  fix: allow concurrent tool execution within the same MCP extension (#7202)
  fix: handle missing arguments in MCP tool calls to prevent GUI crash (#7143)
  Filter Apps page to only show standalone Goose Apps (#6811)
  opt: use static for Regex (#7205)
  nit: show dir in title, and less... jank (#7138)
  feat(gemini-cli): use stream-json output and re-use session (#7118)
  chore(deps): bump qs from 6.14.1 to 6.14.2 in /documentation (#7191)
  Switch jsonwebtoken to use aws-lc-rs (already used by rustls) (#7189)
  chore(deps): bump qs from 6.14.1 to 6.14.2 in /evals/open-model-gym/mcp-harness (#7184)
  Add SLSA build provenance attestations to release workflows (#7097)
  fix save and run recipe not working (#7186)
  Upgraded npm packages for latest security updates (#7183)
  docs: reasoning effort levels for Codex provider (#6798)
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.

2 participants