Include OAI migration guide in TypeDoc documentation
- Add migration guide to `projectDocuments` in `typedoc.config.mjs` - Add YAML frontmatter with title to `migrate_from_openai_apps.md` - Fix heading hierarchy (### → ####) for proper nesting - Fix "Client-side" → "Client-Side" capitalization - Rename "Full Migration Example" → "Client-Side Migration Example" - Remove TODO placeholder sections from `patterns.md` Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e626b84d44
commit
8cd96adc5a
4 changed files with 13 additions and 40 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
---
|
||||||
|
title: Migrate OpenAI App
|
||||||
|
---
|
||||||
|
|
||||||
# Migrating from OpenAI Apps SDK to MCP Apps SDK
|
# Migrating from OpenAI Apps SDK to MCP Apps SDK
|
||||||
|
|
||||||
This guide helps you migrate from the OpenAI Apps SDK to the MCP Apps SDK (`@modelcontextprotocol/ext-apps`).
|
This guide helps you migrate from the OpenAI Apps SDK to the MCP Apps SDK (`@modelcontextprotocol/ext-apps`).
|
||||||
|
|
@ -50,7 +54,7 @@ This guide helps you migrate from the OpenAI Apps SDK to the MCP Apps SDK (`@mod
|
||||||
|
|
||||||
### Server-Side Migration Example
|
### Server-Side Migration Example
|
||||||
|
|
||||||
### Before (OpenAI)
|
#### Before (OpenAI)
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||||
|
|
@ -110,7 +114,7 @@ function createServer() {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### After (MCP Apps)
|
#### After (MCP Apps)
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
||||||
|
|
@ -184,7 +188,7 @@ function createServer() {
|
||||||
6. **Helper Functions**: MCP provides `registerAppTool()` and `registerAppResource()` helpers
|
6. **Helper Functions**: MCP provides `registerAppTool()` and `registerAppResource()` helpers
|
||||||
7. **Not Yet Implemented**: `_meta["openai/toolInvocation/invoking"]`, `_meta["openai/toolInvocation/invoked"]`, and `_meta["openai/widgetDescription"]` don't have MCP equivalents yet
|
7. **Not Yet Implemented**: `_meta["openai/toolInvocation/invoking"]`, `_meta["openai/toolInvocation/invoked"]`, and `_meta["openai/widgetDescription"]` don't have MCP equivalents yet
|
||||||
|
|
||||||
## Client-side
|
## Client-Side
|
||||||
|
|
||||||
### Quick Start Comparison
|
### Quick Start Comparison
|
||||||
|
|
||||||
|
|
@ -302,7 +306,7 @@ function createServer() {
|
||||||
| — | `app.getHostVersion()` | Returns `{ name, version }` of host |
|
| — | `app.getHostVersion()` | Returns `{ name, version }` of host |
|
||||||
| — | `app.getHostCapabilities()` | Check `serverTools`, `openLinks`, `logging`, etc. |
|
| — | `app.getHostCapabilities()` | Check `serverTools`, `openLinks`, `logging`, etc. |
|
||||||
|
|
||||||
### Full Migration Example
|
### Client-Side Migration Example
|
||||||
|
|
||||||
#### Before (OpenAI)
|
#### Before (OpenAI)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,17 +98,3 @@ Use {@link app!App.ontoolinputpartial ontoolinputpartial} to receive streaming t
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> Partial arguments are "healed" JSON — the host closes unclosed brackets/braces to produce valid JSON. This means objects may be incomplete (e.g., the last item in an array may be truncated). Don't rely on partial data for critical operations; use it only for preview UI.
|
> Partial arguments are "healed" JSON — the host closes unclosed brackets/braces to produce valid JSON. This means objects may be incomplete (e.g., the last item in an array may be truncated). Don't rely on partial data for critical operations; use it only for preview UI.
|
||||||
|
|
||||||
## [TODO] Supporting both iframe & MCP Apps in same binary
|
|
||||||
|
|
||||||
See recipe: https://github.com/modelcontextprotocol/ext-apps/issues/34
|
|
||||||
|
|
||||||
{@includeCode ./patterns.tsx#iframeAndMcpApps}
|
|
||||||
|
|
||||||
## [TODO] Migrating from OpenAI to MCP Apps
|
|
||||||
|
|
||||||
See [OpenAI -> MCP Apps](https://docs.google.com/document/d/13ROImOR9B8xc32yhqsFyC9Hh3_H63JFORDIyjyIPcU4/edit) migration guide.
|
|
||||||
|
|
||||||
Also: [Managing State](https://platform.openai.com/docs/actions/managing-state) (OpenAI)
|
|
||||||
|
|
||||||
{@includeCode ./patterns.tsx#migrateFromOpenai}
|
|
||||||
|
|
|
||||||
|
|
@ -305,25 +305,6 @@ function visibilityBasedPause(
|
||||||
//#endregion visibilityBasedPause
|
//#endregion visibilityBasedPause
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Example: Supporting both iframe & MCP Apps in same binary
|
|
||||||
*/
|
|
||||||
function iframeAndMcpApps() {
|
|
||||||
//#region iframeAndMcpApps
|
|
||||||
// TODO: See recipe: https://github.com/modelcontextprotocol/ext-apps/issues/34
|
|
||||||
//#endregion iframeAndMcpApps
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example: Migrating from OpenAI to MCP Apps
|
|
||||||
*/
|
|
||||||
function migrateFromOpenai() {
|
|
||||||
//#region migrateFromOpenai
|
|
||||||
// TODO: See OpenAI -> MCP Apps migration guide
|
|
||||||
// https://docs.google.com/document/d/13ROImOR9B8xc32yhqsFyC9Hh3_H63JFORDIyjyIPcU4/edit
|
|
||||||
//#endregion migrateFromOpenai
|
|
||||||
}
|
|
||||||
|
|
||||||
// Suppress unused variable warnings
|
// Suppress unused variable warnings
|
||||||
void chunkedDataServer;
|
void chunkedDataServer;
|
||||||
void chunkedDataClient;
|
void chunkedDataClient;
|
||||||
|
|
@ -332,5 +313,3 @@ void hostStylingReact;
|
||||||
void persistWidgetStateServer;
|
void persistWidgetStateServer;
|
||||||
void persistWidgetState;
|
void persistWidgetState;
|
||||||
void visibilityBasedPause;
|
void visibilityBasedPause;
|
||||||
void iframeAndMcpApps;
|
|
||||||
void migrateFromOpenai;
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,11 @@ import { OptionDefaults } from "typedoc";
|
||||||
const config = {
|
const config = {
|
||||||
blockTags: [...OptionDefaults.blockTags, "@description"],
|
blockTags: [...OptionDefaults.blockTags, "@description"],
|
||||||
intentionallyNotExported: ["AppOptions"],
|
intentionallyNotExported: ["AppOptions"],
|
||||||
projectDocuments: ["docs/quickstart.md", "docs/patterns.md"],
|
projectDocuments: [
|
||||||
|
"docs/quickstart.md",
|
||||||
|
"docs/patterns.md",
|
||||||
|
"docs/migrate_from_openai_apps.md",
|
||||||
|
],
|
||||||
entryPoints: [
|
entryPoints: [
|
||||||
"src/server/index.ts",
|
"src/server/index.ts",
|
||||||
"src/app.ts",
|
"src/app.ts",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue