Skip to content

Commit c91e533

Browse files
authored
fix: update MCP Apps adapter mimetype (#162)
1 parent cb215d9 commit c91e533

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

docs/src/guide/mcp-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ createUIResource({
210210

211211
## MIME Type
212212

213-
When the MCP Apps adapter is enabled, the resource MIME type is automatically set to `text/html+mcp`. This is the expected MIME type for MCP Apps-compliant hosts.
213+
When the MCP Apps adapter is enabled, the resource MIME type is automatically set to `text/html;profile=mcp`. This is the expected MIME type for MCP Apps-compliant hosts.
214214

215215
## Receiving Data in Your Widget
216216

docs/src/guide/supported-hosts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ These hosts use different protocols but can render MCP-UI widgets via adapters:
3131
MCP-UI provides two adapters to bridge protocol differences:
3232

3333
- **Apps SDK Adapter**: For ChatGPT and other Apps SDK hosts. Uses `text/html+skybridge` MIME type.
34-
- **MCP Apps Adapter**: For hosts implementing the [MCP Apps SEP protocol](https://github.com/modelcontextprotocol/ext-apps). Uses `text/html+mcp` MIME type.
34+
- **MCP Apps Adapter**: For hosts implementing the [MCP Apps SEP protocol](https://github.com/modelcontextprotocol/ext-apps). Uses `text/html;profile=mcp` MIME type.
3535

3636
Both adapters are automatically injected into your HTML when enabled, translating MCP-UI messages to the host's native protocol.
3737

sdks/typescript/server/src/__tests__/adapters/adapter-integration.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,14 +482,14 @@ describe('Adapter Integration', () => {
482482
});
483483

484484
describe('getAdapterMimeType with MCP Apps', () => {
485-
it('should return text/html+mcp for MCP Apps adapter', () => {
485+
it('should return text/html;profile=mcp for MCP Apps adapter', () => {
486486
const result = getAdapterMimeType({
487487
mcpApps: {
488488
enabled: true,
489489
},
490490
});
491491

492-
expect(result).toBe('text/html+mcp');
492+
expect(result).toBe('text/html;profile=mcp');
493493
});
494494
});
495495

@@ -555,7 +555,7 @@ describe('Adapter Integration', () => {
555555
expect(getAdapterMimeType({ appsSdk: { enabled: true } })).toBe('text/html+skybridge');
556556

557557
// MCP Apps adapter
558-
expect(getAdapterMimeType({ mcpApps: { enabled: true } })).toBe('text/html+mcp');
558+
expect(getAdapterMimeType({ mcpApps: { enabled: true } })).toBe('text/html;profile=mcp');
559559

560560
// No adapter
561561
expect(getAdapterMimeType({})).toBeUndefined();

sdks/typescript/server/src/adapters/mcp-apps/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ server.registerTool(
219219

220220
## MIME Type
221221

222-
When the MCP Apps adapter is enabled, the resource MIME type is automatically set to `text/html+mcp`, which is the expected type for MCP Apps hosts.
222+
When the MCP Apps adapter is enabled, the resource MIME type is automatically set to `text/html;profile=mcp`, which is the expected type for MCP Apps hosts.
223223

224224
## Mutual Exclusivity with Apps SDK Adapter
225225

sdks/typescript/server/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const RESOURCE_URI_META_KEY = 'ui/resourceUri' as const;
1818
// text/html for rawHtml content, text/uri-list for externalUrl content
1919
export type MimeType =
2020
| 'text/html'
21-
| 'text/html+mcp'
21+
| 'text/html;profile=mcp'
2222
| 'text/html+skybridge'
2323
| 'text/uri-list'
2424
| 'application/vnd.mcp-ui.remote-dom+javascript; framework=react'

sdks/typescript/server/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ export function getAdapterMimeType(adaptersConfig?: AdaptersConfig): string | un
7979
return adaptersConfig.appsSdk.mimeType ?? 'text/html+skybridge';
8080
}
8181

82-
// MCP Apps adapter uses text/html+mcp as per the ext-apps specification
82+
// MCP Apps adapter uses text/html;profile=mcp as per the ext-apps specification
8383
if (adaptersConfig.mcpApps?.enabled) {
84-
return 'text/html+mcp';
84+
return 'text/html;profile=mcp';
8585
}
8686

8787
// Future adapters can be added here by checking for their config and returning their mime type.

0 commit comments

Comments
 (0)