/mcp-apps-studio:ui-porting-migrationfrom mcp-apps-studio
Provides mapping tables and adapter architecture guidance for porting agent UI between OpenAI Apps SDK, MCP Apps, and A2UI protocols.
Ships in mcp-apps-studio. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Most ports are mechanical if the app was built with an adapter, and a rewrite if it was not. Establish the adapter first, then port.
Every host interaction goes through one module. Components never touch
window.openai, app.*, or postMessage directly.
// bridge.ts — the only file that knows which protocol you are on
export interface HostBridge {
onToolInput(cb: (input: unknown) => void): void;
onToolResult(cb: (result: ToolResult) => void): void;
callTool(name: string, args: unknown): Promise<ToolResult>;
sendMessage(text: string): Promise<void>;
updateModelContext(ctx: unknown): Promise<void>;
openLink(url: string): Promise<void>;
setSize(w: number, h: number): void;
requestDisplayMode(mode: DisplayMode): Promise<DisplayMode>;
getContext(): HostContext | undefined;
capabilities(): Capabilities;
}
With this in place a port is: write a new HostBridge implementation, swap the
import, adjust the server registration. Without it, every component is a
migration site.
Building an app that must reach two protocols at once? Implement both and select
at init by probing (app.getHostCapabilities(), then window.openai, then
mcp-ui postMessage liveness).
The most common port, and the cheapest — ChatGPT already implements MCP Apps, so this is de-risking, not rewriting.
| From | To |
|---|---|
_meta["openai/outputTemplate"] | _meta.ui.resourceUri |
_meta["openai/widgetCSP"] | _meta.ui.csp |
_meta["openai/widgetPrefersBorder"] | _meta.ui.prefersBorder |
_meta["openai/widgetDomain"] | _meta.ui.domain |
_meta["openai/visibility"] | _meta.ui.visibility |
_meta["openai/widgetAccessible"] | _meta.ui.visibility: ["model","app"] |
connect_domains / resource_domains / frame_domains | connectDomains / resourceDomains / frameDomains |
text/html+skybridge | text/html;profile=mcp-app (RESOURCE_MIME_TYPE) |
Keep the openai/* aliases alongside the standard fields during rollout —
ChatGPT honors both, and dual-writing means no flag day.
| From | To |
|---|---|
window.openai.toolInput | app.ontoolinput |
window.openai.toolOutput | app.ontoolresult |
window.openai.toolResponseMetadata | app.ontoolresult → params._meta |
window.openai.callTool(name, args) | app.callServerTool({ name, arguments }) |
window.openai.sendFollowUpMessage({ prompt }) | app.sendMessage({ … }) |
window.openai.requestDisplayMode(…) | app.requestDisplayMode({ mode }) |
window.openai.notifyIntrinsicHeight(…) | app.sendSizeChanged({ width, height }) |
window.openai.openExternal({ href }) | app.openLink({ url }) |
window.openai.theme | app.getHostContext()?.theme |
window.openai.displayMode | app.getHostContext()?.displayMode |
window.openai.maxHeight | app.getHostContext()?.viewport?.maxHeight |
window.openai.safeArea | app.getHostContext()?.safeAreaInsets |
window.openai.locale | app.getHostContext()?.locale |
window.openai.userAgent | app.getHostContext()?.userAgent |
No standard equivalent — keep these feature-detected:
requestCheckout, uploadFile, selectFiles, getFileDownloadUrl,
requestModal, widgetState / setWidgetState.
For setWidgetState, the portable substitute is app.updateModelContext() for
the model-visible slice. There is no portable durable-state mechanism — that
slice moves to your server.
window.openai._meta (standard + aliases).App class, keeping window.openai fallbacks for the
six extension APIs.ui/* bridge| From (mcp-ui) | To (MCP Apps) |
|---|---|
postMessage({type:'tool', payload:{toolName, params}}) | app.callServerTool({ name, arguments }) |
postMessage({type:'prompt', payload:{prompt}}) | app.sendMessage({ … }) |
postMessage({type:'link', payload:{url}}) | app.openLink({ url }) |
postMessage({type:'intent', payload:{intent, params}}) | No direct equivalent — map to a tool call, or keep on hosts that support it |
postMessage({type:'notify', payload:{message}}) | app.updateModelContext(…) or an app-only tool |
ui-lifecycle-iframe-ready | app.connect() / ui/initialize |
ui-lifecycle-iframe-render-data | ui/notifications/tool-input + host context |
ui-message-received / ui-message-response | JSON-RPC response to tools/call |
intent is the one real loss. Its value was letting the host route a
user-expressed intent without the View knowing the tool name. Replacements, in
order of preference: a generic server-side handle_intent tool; or keep the
intent post as a fallback branch for mcp-ui hosts.
externalUrl and remoteDom have no MCP Apps equivalent. An externalUrl
resource ports by inlining the app or serving it as the resource HTML (and
declaring its origins in CSP). A remoteDom resource is a genuine rewrite —
consider A2UI instead, which is what remoteDom was reaching toward.
Not a port. A reimplementation, because the model inverts: you stop shipping markup and start describing components the client owns.
What survives:
structuredContent becomes the A2UI data model (JSON Pointer paths).What is rewritten:
updateComponents messages.action.event (agent round trip) or action.functionCall
(local).CheckRule objects.Do this when the client must render natively (Flutter, SwiftUI), when a design system must own every pixel, or when executing model-influenced markup is unacceptable.
callRendererFunction /
callAgentFunction), verified against catalog definitions.createSurface may carry components and dataModel in one message.instructions field.functions become object maps with $schema / $id.@ is reserved.Additive, not a replacement. Keep MCP Apps for the final artifact and add AG-UI for the run.
RunStarted → content events → RunFinished/RunError.StepStarted/StepFinished and Activity*.StateSnapshot on connect, StateDelta (RFC 6902) thereafter.Preserve rawEvent while wrapping. It is the only way to debug a translated
stream.
content) still completes the workflowRun /ui:port --from <protocol> --to <protocol> to apply the mechanical parts
and produce a report of what needs human judgment.
protocol-selection — whether the port is the right move at all.host-capability-matrix — what the destination host supports.openai-apps-sdk, mcp-apps-protocol, a2ui-protocol, ag-ui-protocol.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub thelobbi/claude --plugin mcp-apps-studio16 skills in this plugin
/a2ui-protocolThis skill should be used when building A2UI (Agent to UI) interfaces — the six streamed message types, surfaces, the flat adjacency-list component model, component catalogs, JSON Pointer data binding and two-way input binding, actions vs functionCalls, CheckRule validation, and progressive streaming./ag-ui-protocolThis skill should be used when integrating AG-UI — the full event taxonomy (lifecycle, text message, tool call, state, activity, reasoning, custom), RunAgentInput, SSE and binary transports, AbstractAgent/HttpAgent, STATE_DELTA JSON Patch, generative UI, human-in-the-loop interrupts, and CopilotKit frontends./host-capability-matrixOther plugins' skills for the same job