Inline MCP Apps fail to render in bundled builds: CSP lacks frame-src for the local goose serve proxy
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 91/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
Direzione di ricerca
Inizia da src-tauri/tauri.conf.json e ispeziona app.security.csp, quindi confrontalo con l’URL dell’iframe costruita da buildProxyUrl in src/features/chat/ui/useMcpAppSandbox.ts. Verifica una build impacchettata con un server MCP App dopo aver consentito il proxy locale come frame source; è completato quando l’app inline viene renderizzata nel bundle come avviene usando solo dev.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Before filing
- I searched open and closed issues for duplicates.
- I reproduced this on the latest release.
- This is one bug, not several bundled together.
Closest existing issue
#98 (in-app page viewing) is the nearest by topic, but it's a feature request unrelated to this rendering bug — no existing report of this found.
What's broken
Summary
MCP App widgets ("apps" returned by MCP servers) render correctly in just dev, but in a bundled release build (just bundle) the same tool result shows "Unable to render MCP App inline." The cause is the production CSP in src-tauri/tauri.conf.json: it has no frame-src directive, so iframes fall back to default-src 'self' asset:, which blocks the MCP app sandbox iframe pointed at the local goose serve proxy (http://127.0.0.1:<port>/mcp-app-proxy?...).
Steps to reproduce
- Connect an MCP server whose tool results include an MCP App UI resource (reproduced with a streamable-HTTP server; any app-returning server should do).
- Build and install a release bundle:
just setup && just bundle, then launch the builtBerd.app. - New chat (Claude Sonnet via Anthropic in my case; model doesn't appear to matter), send a prompt that triggers the MCP tool that returns an app.
- The tool call completes, but the widget area shows "MCP APP — Unable to render MCP App inline."
- Same server, same prompt under
just dev: the app renders fine.
Expected
Inline MCP Apps render in bundled builds the same way they do in dev builds.
Actual
Bundled builds always show the message.mcpAppRenderError fallback ("Unable to render MCP App inline."); dev builds render the app.
Frequency
Every time, in bundled builds only.
Version and platform
- Berd 0.6.3, built from source at
main@977d35fc(newer than the latest published release; bug present in the pinned config on that commit) - macOS 26.5.2, Apple Silicon (aarch64)
Analysis (from reading the source)
- The MCP app sandbox iframe URL is built in
src/features/chat/ui/useMcpAppSandbox.ts(buildProxyUrl) ashttp://127.0.0.1:<port>/mcp-app-proxy?...against the local goose serve HTTP base URL. - The production CSP in
src-tauri/tauri.conf.json(app.security.csp) defines noframe-src(and nochild-src), so iframe loads fall back todefault-src: 'self' asset:— which does not permithttp://127.0.0.1:*. The webview blocks the iframe andMcpAppViewshows the render-error fallback. connect-srcalready allowshttp://localhost:* ws://localhost:* http://127.0.0.1:* ws://127.0.0.1:*, so the WebSocket/HTTP side of the same server is permitted — the iframe case looks like an oversight.- Dev builds don't hit this because no
devCspis configured, so the dev webview runs without the production CSP — which is why the bug only appears in bundles.
Suggested fix (one line in tauri.conf.json):
"frame-src": "'self' http://localhost:* http://127.0.0.1:*"
Logs
~/Library/Logs/xyz.block.berd/berd.log contains no relevant lines — the CSP violation surfaces in the webview console, not the app log. Happy to capture a webview console log from a just bundle-debug build if useful.
Prior issues
Searched open and closed issues for "mcp app render", "csp", "iframe", "frame-src", "unable to render" — none found.
Steps to reproduce
- Build and install a release bundle from source:
just setup && just bundle(macOS, Apple Silicon), then launch the builtBerd.app. - Connect an MCP server whose tool results include an MCP App UI resource. Mine is a remote streamable-HTTP server (
https://mcp.superstock.com/mcp, OAuth via dynamic client registration), but any app-returning MCP server should reproduce it. - Start a new chat (Claude Sonnet via Anthropic; fresh chat, no prior history — model/provider don't appear to matter) and send a prompt that triggers the MCP tool that returns an app (for me: an image search).
- The tool call completes, but the widget area shows "MCP APP — Unable to render MCP App inline."
- Run the same server + same prompt under
just dev: the app renders correctly.
Cause (from reading the source): the MCP app sandbox iframe is pointed at the local goose serve proxy, http://127.0.0.1:<port>/mcp-app-proxy?... (src/features/chat/ui/useMcpAppSandbox.ts, buildProxyUrl). The production CSP in src-tauri/tauri.conf.json defines no frame-src (and no child-src), so iframes fall back to default-src: 'self' asset:, which blocks http://127.0.0.1:* — the webview blocks the iframe and McpAppView shows the message.mcpAppRenderError fallback. connect-src already allows http://localhost:* http://127.0.0.1:* (plus the ws: variants), so the WebSocket/HTTP side of the same server is permitted — the iframe case looks like an oversight. Dev builds don't hit it because no devCsp is configured, so the dev webview runs without the production CSP.
Suggested one-line fix in src-tauri/tauri.conf.json:
"frame-src": "'self' http://localhost:* http://127.0.0.1:*"
Verified locally: adding that line and rebuilding the bundle makes the same MCP app render inline.
Version: Berd 0.6.3 built from main @ 977d35fc; macOS 26.5.2 (aarch64). Logs: ~/Library/Logs/xyz.block.berd/berd.log has no relevant lines — the CSP violation surfaces in the webview console, not the app log; happy to capture a just bundle-debug webview console log if useful.
What you expected to happen
Inline MCP Apps render in bundled release builds the same way they do in just dev.
What actually happened
In bundled builds, every MCP App shows the fallback "Unable to render MCP App inline." instead of the app — every time, bundles only; the identical server and prompt render fine in dev builds.
How often does it happen?
Every time — reliably reproducible
Berd version
0.6.3 (built from source, main @ 977d35fc)
Operating system
macOS (Apple Silicon)
Model and provider
(irrelevant to the bug — reproduces regardless of model)
Relevant log output
No relevant log output — berd.log has no lines around the failure. The block
happens inside the webview (CSP violation), which logs to the webview console
rather than the app log. Happy to capture a webview console log from a
`just bundle-debug` build if useful.
Screenshots, recordings, or other context
No response
- Lingua principale
- TypeScript
- Stelle
- 928
- Fork
- 121
- Merge medio
- 1g 11h
- PR unite (30g)
- 71
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di block/berd
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Saving a custom provider does not set Goose's default provider/model, leaving Goose unavailableApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
block/berd#140 · 1 commento · 3 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
needs:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
ai-discovered
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
jessepollak/home#1627 ·
I maintainer di solito rispondono entro 1 giorno
-
agent-canvas bug llm priority:low ready-for-dev
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
OpenHands/OpenHands#17806 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
radius-project/ai-extensions#923 ·
I maintainer di solito rispondono entro 1 giorno