Skip to main content
MCP Apps SDK OpenAI Apps SDK code can move to MCP Apps without changing the core shape of your app. The server still exposes an MCP tool and an HTML resource. The View still renders in an iframe. The main changes are metadata names, the resource MIME type, CSP field names, and the client runtime API. Use this page as a migration checklist for existing OpenAI Apps SDK code. For a fresh MCP Apps server, start with Build an MCP App Server.

Migration Checklist

  • Replace OpenAI tool metadata keys with _meta.ui.
  • Replace text/html+skybridge with RESOURCE_MIME_TYPE, which is text/html;profile=mcp-app.
  • Convert resource CSP keys from snake case to camel case.
  • Register UI tools and resources with registerAppTool() and registerAppResource().
  • Keep readable content in tool results and put model-safe View data in structuredContent.
  • Replace window.openai reads and methods with the App class or React useApp() hook.
  • Register App event handlers before app.connect() when using the plain App class.
  • Test in a host that supports MCP Apps, then verify text fallback behavior for clients without UI support.

Server Metadata Mapping

MCP Apps visibility is an array. A normal UI-launching tool usually uses the default ["model", "app"]. A UI helper such as pagination or autosave uses ["app"] so it stays out of the model tool list.
See Tool Metadata and the Tool and Resource Contract for the full field reference.

Resource Mapping

MCP Apps HTML runs in a sandboxed iframe, so every external origin must be declared. Check built HTML, bundled JavaScript, CSS, image URLs, font URLs, API URLs, and nested iframes before shipping. See CSP and CORS.

Before and After

Before, an OpenAI Apps SDK tool links its UI with a flat metadata key:
After, MCP Apps uses nested UI metadata. The helper also writes compatibility metadata for older MCP Apps hosts:
Keep the tool name stable when you can. Existing prompts, evals, and client code are easier to migrate when the same tool name returns the same core data.

Client Runtime Mapping

OpenAI Apps SDK Views usually read a pre-populated window.openai object. MCP Apps Views create an App instance, register handlers, and connect to the host.
For React Views, use useApp(), which manages the connection lifecycle for you.

Features Without Direct Equivalents

Some OpenAI Apps SDK APIs do not have direct MCP Apps equivalents. Keep these migrations explicit so the app fails predictably during review:

Validate the Migration

Run these checks before testing in a real host:
  • Search for "openai/ in server code. Remaining hits should be deliberate host-specific compatibility code.
  • Search for text/html+skybridge. Replace it with RESOURCE_MIME_TYPE.
  • Search for resource_domains, connect_domains, and frame_domains. Replace them with MCP Apps camel-case fields.
  • Search for window.openai in View code. Replace common runtime calls with App or React hooks.
  • Call tools/list and confirm the UI tool includes _meta.ui.resourceUri.
  • Call resources/read and confirm the resource returns mimeType: "text/html;profile=mcp-app".
  • Call the UI tool and confirm the result includes readable content and model-safe structuredContent.
  • Open the app in the sunpeak inspector and verify the iframe can load every declared external origin.
For automated coverage, use MCP App E2E tests to call the tool, render the View, and assert against the double-iframe app content.