Skip to content
Back to blog

OpenAI Apps SDK in xmcp: migrating to MCP Apps

xmcp shipped OpenAI Apps SDK support in 2025 and now builds MCP Apps. How to move a ChatGPT widget to _meta.ui.

In October 2025, xmcp added support for building ChatGPT apps with OpenAI's Apps SDK. A tool could return a UI, xmcp registered the matching widget resource, and ChatGPT rendered it inline in the conversation.

Since then, interactive UIs moved into the protocol itself. MCP Apps is the MCP extension for UI resources, and ChatGPT supports it. xmcp followed: the OpenAI-specific _meta.openai keys and the text/html+skybridge resource type were removed, and every widget is now an MCP App. This post covers what changed and how to move a project built on the original Apps SDK support.

What the Apps SDK support did

The first version mapped xmcp files onto OpenAI's conventions:

  • A tool declared its widget with _meta.openai keys, such as widgetCSP, widgetDomain, and widgetPrefersBorder. xmcp flattened them into the openai/* keys ChatGPT reads.
  • Each widget was served as a resource with the text/html+skybridge MIME type at ui://widget/<name>.html.
  • openai/outputTemplate connected the tool to that resource.

The approach worked in ChatGPT only. Other clients ignored the openai/* keys, so the same server showed text everywhere else.

What xmcp does now

A tool becomes an MCP App when it has _meta.ui metadata or is a React component in a .tsx file. For each one, xmcp:

  1. Registers a resource at ui://app/<tool-name>.html with the text/html;profile=mcp-app MIME type.
  2. Sets _meta.ui.resourceUri on the tool so the host knows which resource to render, unless you set it yourself.
  3. Bundles React components for the browser and serves the bundle from that resource.
  4. Adds https://esm.sh to the widget's allowed resource domains, so the default runtime can load.

You don't create the resource file. The tool is the single source for both the model-facing definition and the UI.

Migrate a widget

1. Replace _meta.openai with _meta.ui

Most keys have a direct equivalent. CSP origins move from snake_case to camelCase:

Apps SDK support (removed)MCP Apps (current)
_meta.openai.widgetCSP.connect_domains_meta.ui.csp.connectDomains
_meta.openai.widgetCSP.resource_domains_meta.ui.csp.resourceDomains
_meta.openai.widgetDomain_meta.ui.domain
_meta.openai.widgetPrefersBorder_meta.ui.prefersBorder
openai/outputTemplate_meta.ui.resourceUri, generated automatically
text/html+skybridge resourcetext/html;profile=mcp-app, generated
ui://widget/<name>.htmlui://app/<tool-name>.html

A tool that used to look like this:

src/tools/show-map.ts (before)

becomes:

src/tools/show-map.ts (after)

The ui block also accepts csp.frameDomains, csp.baseUriDomains, browser permissions such as clipboardWrite, and visibility to control whether the model, the app, or both can see the tool. The MCP Apps metadata reference lists every field.

The loading and completion messages from openai/toolInvocation have no _meta.ui equivalent. Remove them.

2. Delete the hand-written widget resource

If you kept the HTML in src/resources/ with mimeType: "text/html+skybridge", move the markup into the tool handler and delete the resource file. A handler can return an HTML string, or the tool file can be a React component:

src/tools/show-map.tsx

React tools need react and react-dom installed and "jsx": "react-jsx" in tsconfig.json. The handler types guide covers both options.

3. Replace window.openai calls

Widgets written for the Apps SDK called window.openai directly. MCP Apps talk to the host over a standard bridge, and @xmcp-dev/ui wraps it in a React hook:

TSX

The hook also exposes readResource, sendMessage, updateModelContext, and the host's context and capabilities. Check hostCapabilities before relying on one, because hosts don't all support the same set. The MCP Apps reference documents each call.

4. Test in more than one host

Run the server with xmcp dev and open it in MCPJam to check the widget outside ChatGPT. Then connect it to ChatGPT in developer mode to confirm CSP origins and display modes. Because the widget no longer depends on openai/* keys, the same build also works in other clients that support MCP Apps.

Start a new app

New projects don't need any of the above. Scaffold one with the MCP App template:

Shell

Use --ui-kit instead to include @xmcp-dev/ui components and Tailwind CSS. From there, follow how to build an MCP App, and prepare it for OpenAI review when you're ready to submit it to ChatGPT.

One framework to rule them all