Skip to content

Host standard MCP Apps inline in desktop conversations - #3700

Merged
reachjalil merged 3 commits into
devfrom
codex/mcp-apps-host
Aug 12, 2026
Merged

reachjalil merged 3 commits into
devfrom
codex/mcp-apps-host

Conversation

@reachjalil

@reachjalil reachjalil commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds the desktop/web host needed to render standard MCP Apps attached to configured remote MCP tools.

  • preserves the original MCP content, structuredContent, and result metadata in completed tool parts
  • discovers the UI through the tool definition's exact _meta.ui.resourceUri
  • resolves ui:// resources through the originating configured MCP server and requires text/html;profile=mcp-app
  • keeps the normal tool result as the fallback when a view is absent or unavailable
  • mediates only app-visible, explicitly read-only, non-destructive same-server tool calls

Stable MCP Apps host boundary

The host follows the stable 2026-01-26 MCP Apps flow:

  1. fetch the exact resource named by the tool definition
  2. load a cross-origin sandbox proxy with an HTTP Content-Security-Policy
  3. send the raw resource through ui/notifications/sandbox-resource-ready
  4. run the View in an inner allow-scripts allow-same-origin iframe
  5. relay only the MCP Apps bridge messages between host and View

The direct srcdoc host path has been removed. Local desktop builds use the equivalent localhost / 127.0.0.1 origins for isolation; non-local deployments fail closed if the configured OpenWork server would share the host origin.

Remote MCP egress uses the existing guarded transport: HTTPS in production, DNS/address validation at the socket boundary, guarded redirects, and no credential forwarding across origins. Loopback HTTP remains available only in explicit development mode.

The host rejects full documents containing markup before the policy-bearing <head>, applies deny-by-default resource CSP, keeps MCP credentials server-side, and enforces resource, result, catalog, pagination, height, and event-rate limits. Device permissions, dedicated app origins, sampling, downloads, external links, write tools, and stdio resource resolution are not granted in this slice.

Compatibility with generated Artifact views (#3715)

The exact #3700 and #3715 heads are independently rebased onto the same dev head and merge without source conflicts. Together they provide:

Both sides enforce the same 512 KiB HTML ceiling.

Verification

  • OpenWork server MCP Apps host/sandbox tests: 9 passing
  • desktop app iframe-policy tests: 5 passing
  • OpenWork server TypeScript check
  • desktop app TypeScript check
  • combined current host/provider worktree: 25 focused tests passing
  • exact current heads merge cleanly
  • git diff --check

The opt-in Testkit journey remains available for a full packaged-app visual pass; that broader proof is separate from the focused contract and security checks above.

Current compatibility

Supports configured remote Streamable HTTP MCP servers with legacy SSE fallback. The Den openwork-cloud MCP used by #3715 is a configured runtime MCP and its server-side bearer headers stay on the server. Command/stdio MCP resources and separately vault-managed OAuth credential adapters remain follow-ups; the fallback transcript continues to work for them.

Base: 396a6e3141e302a230f2319afc45c2e855e79606
Head: dccc9e66f22e918baa20a07bb5f0c0b9fcc4d00b

@vercel

vercel Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview Aug 12, 2026 11:14am
openwork-den Ready Ready Preview Aug 12, 2026 11:14am
openwork-den-worker-proxy Ready Ready Preview Aug 12, 2026 11:14am
openwork-diagnostics Ready Ready Preview Aug 12, 2026 11:14am
openwork-landing Ready Ready Preview, v0 Aug 12, 2026 11:14am

Comment thread apps/server/src/mcp-app-host.ts Resolved
Comment thread apps/server/src/mcp-app-host.ts Resolved

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (dccc9e66f22e918baa20a07bb5f0c0b9fcc4d00b). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

This branch was successfully deployed

5 active deployments
Preview – openwork-den-worker-proxy — dccc9e66 Deployed Aug 12, 2026 by vercel[bot]
Preview – openwork-landing — dccc9e66 Deployed Aug 12, 2026 by vercel[bot]
Preview – openwork-den — dccc9e66 Deployed Aug 12, 2026 by vercel[bot]
Preview – openwork-app — dccc9e66 Deployed Aug 12, 2026 by vercel[bot]
Preview – openwork-diagnostics — dccc9e66 Deployed Aug 12, 2026 by vercel[bot]
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.

1 participant