Repository navigation
🐛 fix: Restore MCP App Rendering and Actions - #16382
Conversation
|
CI repair at head |
|
Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures. |
|
Lighthouse retry at exact head |
|
Lighthouse CI passed at exact head |
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acceab54c1
ℹ️ 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".
|
@dustinhealy see codex findings |
|
Review handoff for exact head |
|
Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures. |
canary as merged (a98d40f) renders Apps detached from their tool call, fails the bridge first initialization and is blocked by an inherited X-Frame-Options header; the fix is LibreChat-AI/LibreChat#16382 on fix/mcp-apps-canary-rebase-regressions. A ref with a slash is not a valid docker tag, so the ref tag is sanitised. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
4f33e69 to
54152c2
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54152c2ec5
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
🔵 Needs a closer look
The security-sensitive iframe transport and sandbox changes still require current-head browser-suite verification.
0 open findings
What changed in this PR
Stabilizes MCP App startup, sandbox loading, and persisted-server validation across the client and API.
Changes:
- Adds Strict Mode-safe, source/origin-validated iframe transport.
- Moves inner App documents to
srcdocand corrects frame headers. - Uses role-scoped, single-server validation with concurrent ACL checks and expanded tests.
| File | Description |
|---|---|
packages/api/src/mcp/registry/MCPServersRegistry.ts |
Adds role-scoped single-server resolution. |
packages/api/src/mcp/registry/db/ServerConfigsDB.ts |
Reuses principals across concurrent ACL checks. |
packages/api/src/mcp/registry/__tests__/ServerConfigsDB.test.ts |
Tests role-aware database access. |
packages/api/src/mcp/registry/__tests__/MCPServersRegistry.test.ts |
Tests role-scoped caching and lookup. |
packages/api/src/mcp/apps/controller.ts |
Removes conflicting inherited frame headers. |
packages/api/src/mcp/apps/controller.spec.ts |
Covers sandbox header behavior. |
client/src/utils/__tests__/mcpSandbox.spec.ts |
Updates sandbox lifecycle tests for srcdoc. |
client/src/hooks/MCP/useAppBridge.ts |
Adds live iframe transport and replay-safe initialization. |
client/src/hooks/MCP/__tests__/useAppBridge.spec.tsx |
Covers Strict Mode and message-source validation. |
client/public/mcp-sandbox.html |
Loads opaque App documents using srcdoc. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 61b4f2ae62
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |


Summary
Fix MCP App startup, placement, approvals, and sizing.
How it works
App frames belong to the message and sit between content sections. Expanding or collapsing tool, phase, and parallel disclosures keeps each iframe in place. Each section retains its content indices and agent/step ownership. Resume authors are collected across the complete message. The message also owns the Sources panel and its search context.
Each App has a FIFO approval queue bounded by
mcpAppSandbox.operationLimits.maxActive. Every request requires a host click. Cancellation, aborts, and teardown settle pending requests. Cancelling a queued request preserves the approval currently displayed. The host controls permissions and argument previews.The sandbox uses an opaque
srcdocView with source and origin checks at the outer transport. Every inner document load requires a fresh bootstrap challenge before relaying messages. Host context reports the actual width and a flexible height bound to prevent a resize feedback loop.Server validation and follow-up calls use role-aware authorization. Direct server lookup preserves configuration precedence and recovery.
Type of change
Testing
Tested environments/configuration:
be94aabea6.b5fd896124, reproduced handoff and mixed sequential/parallel layouts with saved fixture transcripts and the real Basic App in Chrome. Verified resumed author attribution and a single Sources panel alongside the App and both parallel answers.Automated tests:
packages/apitypechecks; affected static checks, import sorting, and diff whitespace checks.npm run lighthousewith 250ms simulated latency per database query: median LCP 3604ms, CLS 0.018, TBT 90ms.a74d2d1da9. CI: 46 passing checks and 3 skipped jobs. Static checks fail on the upstream import order introduced by 🔀 refactor: Move Resumable Frame Dispatch and Attach Into the Chat Core #17129; the fix is in draft 🎨 style: Restore Resumable SSE Import Order #17191.Screenshots / recordings
Recorded in local LibreChat with reference MCP servers and deterministic model tool execution. Fixed-build recordings use
be94aabea6. Both Debug builds use the same disposable backend and reference server. Captions appear below the application viewport; Testbed includes labeled closeups of its Events panel.1. Debug: before and after independent approvals
Same Debug App action: text content with structured output enabled.
Before (
f71abd2d00client and sandbox): logging receives approval, but the concurrent action returns empty content withisError: true.review-debug-before.mp4
After (
be94aabea6client and sandbox): logging and thedebug-toolrequest each receive approval, then the App displaysDebug text content.review-debug-after.mp4
2. Placement and state across tool disclosure
The Basic App appears after its producing
get-timetool and before the remaining assistant response. The typedApp state: KEEP-16382value remains while opening and closing that tool disclosure.review-placement.mp4
3. Historical App reopening after browser reload
After a browser reload, the saved Basic App shows an Open app button. Clicking it reopens the App with the same saved tool timestamp.
review-reopen.mp4
4. App-requested sizing
The Debug App requests 400×300 and then 800×600. The frame changes size; Host Info reports width 800 after the second request.
review-sizing.mp4
5. Budget controls
Choose $250,000 and Growth, change Marketing from 25% to 30% and Engineering from 35% to 30%, then show the fully allocated 30/30/15/15/10 budget.
review-budget.mp4
6. Three.js animation
The Three.js reference App uses strict CSP and renders a rotating cube inside its producing tool response.
review-threejs.mp4
7. Testbed tool, resource, and ping
The Testbed requests echo, reads its note resource, and pings the server. Each result is shown in a labeled Events-panel closeup, with the surrounding App visible between actions.
review-testbed.mp4
Risk / compatibility
Apps split messages into activity sections, so a message containing an App can have activity groups on either side of it. Opening and closing Apps remains explicit. Closing or reloading recreates the App from its saved tool output and resets unsaved state.
Apps control their request deadlines. A request can expire while waiting for approval. Server binding, tenant, role, tool visibility, CSP, and read-only restrictions remain enforced.
Checklist