Engineering
migrate-oai-app avatar

migrate-oai-app

Migrate existing OpenAI Apps SDK applications to the MCP Apps SDK, including step-by-step guidance, API mapping tables, and CSP investigation workflows.

Introduction

This skill provides an automated and guided path for developers looking to port legacy OpenAI Apps SDK applications to the Model Context Protocol (MCP) Apps SDK (@modelcontextprotocol/ext-apps). It is designed for engineers and platform developers who need to transition from proprietary window.openai patterns to the standardized, open, and interactive UI protocol offered by MCP. The skill acts as a migration architect, ensuring that logic previously tied to the OpenAI runtime is correctly refactored for the MCP lifecycle.

  • Step-by-step migration guidance for converting OpenAI Apps to MCP-compliant servers and UIs.

  • Comprehensive API mapping tables for replacing legacy window.openai calls with modern app instances and handlers.

  • Infrastructure guidance for modernizing server-side logic using registerAppTool and registerAppResource helpers.

  • Automated workflows for Content Security Policy (CSP) auditing to identify necessary resource, connect, and frame domains before deployment.

  • Integration support for major front-end frameworks including React, Vue, Svelte, Preact, and Solid.

  • Best practices for managing app state and host context without relying on global window objects.

  • Start by cloning the current SDK repository using the provided git commands to ensure you have the latest reference documentation and example server templates.

  • Use the migration reference guide located at /tmp/mcp-ext-apps/docs/migrate_from_openai_apps.md for precise before-and-after mapping of your codebase.

  • Always prioritize package manager-based dependency installation to ensure version compatibility instead of hardcoding version numbers.

  • Perform a thorough CSP investigation by tracing all network origins in your existing build, categorizing them into resource, connect, and frame domains.

  • Implement event handlers (ontoolinput, ontoolresult) before connecting to ensure reliable communication with the host environment.

  • Be aware that certain features like widgetState or direct file uploads from OpenAI do not have direct MCP equivalents and require server-side state management patterns.

  • Before finishing your migration, complete the explicit 'Before Finishing' checklist to ensure your app meets security and performance standards required by modern MCP hosts.

Repository Stats

Stars
2,150
Forks
266
Open Issues
137
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 06:12 PM
View on GitHub