fix: update adapter to latest MCP Apps spec#163
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the MCP Apps adapter to align with the latest MCP Apps specification from @modelcontextprotocol/ext-apps v0.0.7. The key changes include updating the MIME type from text/html;profile=mcp to text/html;profile=mcp-app, importing constants from the official ext-apps SDK instead of maintaining local copies, correcting protocol method names, fixing message content structure, and adding support for new lifecycle events.
Key Changes:
- Updated MIME type to
text/html;profile=mcp-appand now importsRESOURCE_MIME_TYPEandRESOURCE_URI_META_KEYfrom@modelcontextprotocol/ext-apps - Fixed protocol method name from
ui/notifications/size-changetoui/notifications/size-changed - Corrected
ui/messagecontent structure from array format[{ type: 'text', text }]to object format{ type: 'text', text } - Added handlers for new protocol events:
ui/notifications/tool-cancelledandui/resource-teardown
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdks/typescript/server/package.json | Adds @modelcontextprotocol/ext-apps@^0.0.7 as a dependency |
| sdks/typescript/server/src/types.ts | Re-exports RESOURCE_URI_META_KEY and RESOURCE_MIME_TYPE from ext-apps, updates MIME type in type union |
| sdks/typescript/server/src/utils.ts | Imports and uses RESOURCE_MIME_TYPE constant for MCP Apps adapter |
| sdks/typescript/server/src/index.ts | Exports RESOURCE_MIME_TYPE constant alongside RESOURCE_URI_META_KEY |
| sdks/typescript/server/src/adapters/mcp-apps/adapter-runtime.ts | Updates protocol version, imports ext-apps types, adds METHODS constant, fixes method names (size-change→size-changed), corrects ui/message content structure, adds tool-cancelled and resource-teardown handlers |
| sdks/typescript/server/src/tests/utils.test.ts | Updates test expectations to match new MIME type text/html;profile=mcp-app |
| sdks/typescript/server/src/tests/adapters/adapter-integration.test.ts | Updates test expectations for MCP Apps MIME type |
| sdks/typescript/server/scripts/bundle-adapter.js | Clarifies comment about type-only imports |
| docs/src/guide/mcp-apps.md | Updates documentation for corrected method names and new lifecycle events |
| pnpm-lock.yaml | Adds ext-apps v0.0.7 resolution and dependencies, removes obsolete example |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
sdks/typescript/server/src/adapters/mcp-apps/adapter-runtime.ts:48
- Unused variable METHODS.
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Used in switch cases below
| export { | ||
| RESOURCE_URI_META_KEY, | ||
| RESOURCE_MIME_TYPE, | ||
| } from '@modelcontextprotocol/ext-apps'; |
There was a problem hiding this comment.
The code assumes RESOURCE_MIME_TYPE from @modelcontextprotocol/ext-apps equals 'text/html;profile=mcp-app', but there's no test verifying this assumption. If the ext-apps package changes this value, the existing tests would still pass (they test the return value of getAdapterMimeType, not the imported constant directly).
Consider adding a test that directly imports and verifies RESOURCE_MIME_TYPE from @modelcontextprotocol/ext-apps to ensure it matches the expected value 'text/html;profile=mcp-app'. This would catch any breaking changes in the ext-apps package.
…er/v5.16.3) (2025-12-18) ### Bug Fixes * **client:** use type-only imports for @modelcontextprotocol/sdk types ([#157](#157)) ([d84cb3e](d84cb3e)) * trigger TS release ([e28d1f6](e28d1f6)) * update adapter to latest MCP Apps spec ([#163](#163)) ([e342034](e342034)) * update MCP Apps adapter mimetype ([#162](#162)) ([c91e533](c91e533)) * update ui/message to pass an array ([#167](#167)) ([80cf222](80cf222))
|
🎉 This PR is included in version 5.16.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…/v5.17.1...client/v5.18.0-alpha.1) (2025-12-18) ### Bug Fixes * **client:** use type-only imports for @modelcontextprotocol/sdk types ([#157](#157)) ([d84cb3e](d84cb3e)) * revert externalUrl adapter for compatibility ([#159](#159)) ([3c5289a](3c5289a)) * trigger TS release ([e28d1f6](e28d1f6)) * update adapter to latest MCP Apps spec ([#163](#163)) ([e342034](e342034)) * update MCP Apps adapter mimetype ([#162](#162)) ([c91e533](c91e533)) * update ui/message to pass an array ([#167](#167)) ([80cf222](80cf222)) ### Features * **client:** expose MCP request handlers and AppBridge ref ([3cf3c37](3cf3c37)) * **client:** make Client optional with onReadResource alternative ([fece80e](fece80e)) * use ext-apps branch with setter-based MCP forwarding handlers ([a312e52](a312e52))
|
🎉 This PR is included in version 5.18.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…nt/v5.17.2) (2025-12-20) ### Bug Fixes * **client:** use type-only imports for @modelcontextprotocol/sdk types ([#157](#157)) ([d84cb3e](d84cb3e)) * revert externalUrl adapter for compatibility ([#159](#159)) ([3c5289a](3c5289a)) * trigger TS release ([e28d1f6](e28d1f6)) * update adapter to latest MCP Apps spec ([#163](#163)) ([e342034](e342034)) * update MCP Apps adapter mimetype ([#162](#162)) ([c91e533](c91e533)) * update ui/message to pass an array ([#167](#167)) ([80cf222](80cf222))
|
🎉 This PR is included in version 5.17.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
…ver/v5.16.2...server/v5.16.3) (2025-12-18) ### Bug Fixes * **client:** use type-only imports for @modelcontextprotocol/sdk types ([#157](MCP-UI-Org/mcp-ui#157)) ([4ece399](MCP-UI-Org/mcp-ui@4ece399)) * trigger TS release ([fc8a053](MCP-UI-Org/mcp-ui@fc8a053)) * update adapter to latest MCP Apps spec ([#163](MCP-UI-Org/mcp-ui#163)) ([819cf59](MCP-UI-Org/mcp-ui@819cf59)) * update MCP Apps adapter mimetype ([#162](MCP-UI-Org/mcp-ui#162)) ([e99b306](MCP-UI-Org/mcp-ui@e99b306)) * update ui/message to pass an array ([#167](MCP-UI-Org/mcp-ui#167)) ([ba8afa7](MCP-UI-Org/mcp-ui@ba8afa7))
…ent/v5.17.1...client/v5.17.2) (2025-12-20) ### Bug Fixes * **client:** use type-only imports for @modelcontextprotocol/sdk types ([#157](MCP-UI-Org/mcp-ui#157)) ([4ece399](MCP-UI-Org/mcp-ui@4ece399)) * revert externalUrl adapter for compatibility ([#159](MCP-UI-Org/mcp-ui#159)) ([7a855e2](MCP-UI-Org/mcp-ui@7a855e2)) * trigger TS release ([fc8a053](MCP-UI-Org/mcp-ui@fc8a053)) * update adapter to latest MCP Apps spec ([#163](MCP-UI-Org/mcp-ui#163)) ([819cf59](MCP-UI-Org/mcp-ui@819cf59)) * update MCP Apps adapter mimetype ([#162](MCP-UI-Org/mcp-ui#162)) ([e99b306](MCP-UI-Org/mcp-ui@e99b306)) * update ui/message to pass an array ([#167](MCP-UI-Org/mcp-ui#167)) ([ba8afa7](MCP-UI-Org/mcp-ui@ba8afa7))
No description provided.