MCP App Host Comparison: mcp-ts vs mcp-ui
This document compares how @mcp-ts/sdk (client AppHost, React useMcpApps / McpAppRenderer) and @mcp-ui/client host MCP Apps: architecture, security, and feature overlap.
1. Architecture and design patterns
mcp-ui
AppRenderer(React): High level—resource/HTML, bridge configuration, streaming and host context props, optional MCPclientwith automatic forwarding.AppFrame(low level): Iframe lifecycle,PostMessageTransport, sandbox proxy handshake.
mcp-ts (current)
McpAppRenderer/McpAppView: React layer that owns iframe ref, fullscreen UI, and syncsinput/result/toolInputPartial/toolCancelled/ mergedhostContextintoAppHost.AppHost(core): Single class that ownsAppBridge, resource preload/cache, sandbox launch (setupSandboxProxyIframe+sendSandboxResourceReady), and MCP forwarding or overrides.
@modelcontextprotocol/ext-apps.
Difference: mcp-ui splits renderer vs frame; mcp-ts keeps most protocol and DOM logic in AppHost, with React focused on binding to useMcp / SSE and UX (fullscreen button, loaders).
2. Sandboxing and iframes
mcp-ui
- Expects an explicit
sandboxconfiguration (proxy URL, permissions, CSP). - Uses a proxy iframe and handshake so untrusted HTML is not executed in the parent document’s origin semantics without control.
mcp-ts (current)
- Raw HTML path requires
sandboxwith a proxy URL; otherwiselaunchthrows—no “silent” blob-URL-only hosting for that path. - CSP can be supplied as
sandbox.csp(oftenDEFAULT_MCP_APP_CSPextended per app); values are passed into the proxy (query / bridge) so the guest document can enforce policy. - Plain HTTP(S)
uri(non–ui:/// non–mcp-app://) can still load withiframe.srcand sandbox attributes (separate code path).
mcp-ts additionally documents DEFAULT_MCP_APP_CSP and bundles utilities/constants; the actual sandbox.html asset is still something the host app must serve (see examples/agents).
3. Resource prefetch and caching
mcp-ts
AppHost.preload(tools)with cache order: SSE client cache → in-memoryresourceCache→ network. Strong fit for instant tool UI after discovery.
mcp-ui
- Fetching is typically driven by React props and lifecycle; hosts can pass pre-fetched
htmlor atoolResourceUriif they already have content.
mcp-ts emphasizes built-in preload tied to tool lists from your MCP session.
4. MCP forwarding and overrides (client vs callbacks)
mcp-ui
clientis optional; if omitted, hosts implementonCallTool,onReadResource, etc., for mediation.
mcp-ts (current)
AppHostconstructor acceptsAppHostClient | null.- If
onCallToolis set, it runs instead ofclient.callTool. - If
onReadResourceis set, resource reads use it (including paths that would otherwise use the client). - If neither override nor a connected client is available where needed, operations fail with explicit errors (e.g. disconnected client).
useMcpApps, the SSE client is still passed from useMcp when present; advanced hosts can use useAppHost directly with client: null and full overrides.
5. Streaming, context, and display
mcp-ui
toolInputPartial,toolCancelled,hostContext,onFallbackRequest, etc., for agentic UIs and host–guest sync.
mcp-ts (current)
McpAppRenderer:toolInputPartial→host.sendToolInputPartial;toolCancelled→sendToolCancelled.hostContextmerged with defaults and an authoritativedisplayMode(inline|fullscreen) for guests that read host context.onFallbackRequest,onMessage,onOpenLink,onLoggingMessage,onSizeChanged,onRequestDisplayModeexposed on options/props.- Fullscreen: Implemented in the React layer using the Fullscreen API plus height restoration logic (guest resize events after exit can be misleading).
mcp-ui-style props for streaming and context.
Remaining gaps (illustrative, not exhaustive): Exact API parity with every mcp-ui prop name/edge case, tighter AppRenderer/AppFrame split, and any extra helpers mcp-ui ships for non-React stacks—verify against the @mcp-ui/client version you target.
Conclusion
mcp-tsis an SDK that includes MCP App hosting as part of the same package as SSE sessions, storage-backed servers, adapters, etc.@mcp-ui/clientis a focused UI/host library with a more granular React component split.
mcp-ts’s host behavior is much closer to mcp-ui in several areas: proxy sandboxing, CSP hooks, optional client with overrides, streaming/cancellation props, host context, and fullscreen display mode. The main structural difference remains monolithic AppHost + thin React versus AppRenderer + AppFrame, and mcp-ts’s preload/cache story is a differentiator for tool-heavy apps.
When choosing: prefer mcp-ui if you want the reference React decomposition and are building only the host UI layer; prefer mcp-ts if you already use (or want) the full client/server stack and a single dependency for SSE + OAuth + apps.