Skip to content

Commit 0af1532

Browse files
antonpk1claude
andauthored
fix: use profile parameter for MIME type instead of suffix (#75)
Change MIME type from `text/html+mcp` to `text/html;profile=mcp-app` to follow RFC 6838 recommendations for custom media types. The `+suffix` format (like `text/html+mcp`) is intended for structured syntax suffixes (e.g., `+json`, `+xml`) that describe the underlying format. Since MCP Apps doesn't define a new syntax but rather a profile of HTML, using a profile parameter is more semantically correct. Fixes #59 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent 7eac6f6 commit 0af1532

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

examples/simple-host/src/app-host-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export async function readToolUiResourceHtml(
8989
}
9090
const content = resource.contents[0];
9191
let html: string;
92-
const isHtml = (t?: string) => t === "text/html+mcp";
92+
const isHtml = (t?: string) => t === "text/html;profile=mcp-app";
9393

9494
if (
9595
"text" in content &&

examples/simple-server/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const getServer = async () => {
6868
uri: "ui://raw",
6969
title: "Raw UI Template",
7070
description: "A simple raw HTML UI",
71-
mimeType: "text/html+mcp",
71+
mimeType: "text/html;profile=mcp-app",
7272
},
7373
rawHtml,
7474
);
@@ -99,7 +99,7 @@ const getServer = async () => {
9999
uri: "ui://vanilla",
100100
title: "Vanilla UI Template",
101101
description: "A simple vanilla JS UI",
102-
mimeType: "text/html+mcp",
102+
mimeType: "text/html;profile=mcp-app",
103103
},
104104
vanillaHtml,
105105
);
@@ -130,7 +130,7 @@ const getServer = async () => {
130130
uri: "ui://react",
131131
title: "React UI Template",
132132
description: "A React-based UI",
133-
mimeType: "text/html+mcp",
133+
mimeType: "text/html;profile=mcp-app",
134134
},
135135
reactHtml,
136136
);

specification/draft/apps.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## Abstract
99

10-
This SEP proposes an extension (per SEP-1724) to MCP that enables servers to deliver interactive user interfaces to hosts. MCP Apps introduces a standardized pattern for declaring UI resources via the `ui://` URI scheme, associating them with tools through metadata, and facilitating bidirectional communication between the UI and the host using MCP's JSON-RPC base protocol. This extension addresses the growing community need for rich, interactive experiences in MCP-enabled applications, maintaining security, auditability, and alignment with MCP's core architecture. The initial specification focuses on HTML resources (`text/html+mcp`) with a clear path for future extensions.
10+
This SEP proposes an extension (per SEP-1724) to MCP that enables servers to deliver interactive user interfaces to hosts. MCP Apps introduces a standardized pattern for declaring UI resources via the `ui://` URI scheme, associating them with tools through metadata, and facilitating bidirectional communication between the UI and the host using MCP's JSON-RPC base protocol. This extension addresses the growing community need for rich, interactive experiences in MCP-enabled applications, maintaining security, auditability, and alignment with MCP's core architecture. The initial specification focuses on HTML resources (`text/html;profile=mcp-app`) with a clear path for future extensions.
1111

1212
## Motivation
1313

@@ -43,7 +43,7 @@ MCP Apps extends the Model Context Protocol to enable servers to deliver interac
4343
- **Bidirectional Communication:** UI iframes communicate with hosts using standard MCP JSON-RPC protocol
4444
- **Security Model:** Mandatory iframe sandboxing with auditable communication
4545

46-
This specification focuses on HTML content (`text/html+mcp`) as the initial content type, with extensibility for future formats.
46+
This specification focuses on HTML content (`text/html;profile=mcp-app`) as the initial content type, with extensibility for future formats.
4747

4848
As an extension, MCP Apps is optional and must be explicitly negotiated between clients and servers through the extension capabilities mechanism (see Capability Negotiation section).
4949

@@ -87,11 +87,11 @@ interface UIResource {
8787
/**
8888
* MIME type of the UI content
8989
*
90-
* SHOULD be `text/html+mcp` for HTML-based UIs in the initial MVP.
90+
* SHOULD be `text/html;profile=mcp-app` for HTML-based UIs in the initial MVP.
9191
* Other content types are reserved for future extensions.
9292
*
9393
* @example
94-
* "text/html+mcp"
94+
* "text/html;profile=mcp-app"
9595
*/
9696
mimeType: string;
9797

@@ -168,7 +168,7 @@ The resource content is returned via `resources/read`:
168168
{
169169
contents: [{
170170
uri: string; // Matching UI resource URI
171-
mimeType: "text/html+mcp"; // MUST be "text/html+mcp"
171+
mimeType: "text/html;profile=mcp-app"; // MUST be "text/html;profile=mcp-app"
172172
text?: string; // HTML content as string
173173
blob?: string; // OR base64-encoded HTML
174174
_meta?: {
@@ -188,7 +188,7 @@ The resource content is returned via `resources/read`:
188188
#### Content Requirements:
189189

190190
- URI MUST start with `ui://` scheme
191-
- `mimeType` MUST be `text/html+mcp` (other types reserved for future extensions)
191+
- `mimeType` MUST be `text/html;profile=mcp-app` (other types reserved for future extensions)
192192
- Content MUST be provided via either `text` (string) or `blob` (base64-encoded)
193193
- Content MUST be valid HTML5 document
194194

@@ -216,14 +216,14 @@ Example:
216216
"uri": "ui://weather-server/dashboard-template",
217217
"name": "weather_dashboard",
218218
"description": "Interactive weather dashboard widget",
219-
"mimeType": "text/html+mcp"
219+
"mimeType": "text/html;profile=mcp-app"
220220
}
221221

222222
// Resource content with metadata
223223
{
224224
"contents": [{
225225
"uri": "ui://weather-server/dashboard-template",
226-
"mimeType": "text/html+mcp",
226+
"mimeType": "text/html;profile=mcp-app",
227227
"text": "<!DOCTYPE html><html>...</html>",
228228
"_meta": {
229229
"ui" : {
@@ -919,7 +919,7 @@ Clients advertise MCP Apps support in the initialize request using the extension
919919
"capabilities": {
920920
"extensions": {
921921
"io.modelcontextprotocol/ui": {
922-
"mimeTypes": ["text/html+mcp"]
922+
"mimeTypes": ["text/html;profile=mcp-app"]
923923
}
924924
}
925925
},
@@ -933,7 +933,7 @@ Clients advertise MCP Apps support in the initialize request using the extension
933933

934934
**Extension Settings:**
935935

936-
- `mimeTypes`: Array of supported content types (REQUIRED, e.g., `["text/html+mcp"]`)
936+
- `mimeTypes`: Array of supported content types (REQUIRED, e.g., `["text/html;profile=mcp-app"]`)
937937

938938
Future versions may add additional settings:
939939

@@ -946,7 +946,7 @@ Servers SHOULD check client (host would-be) capabilities before registering UI-e
946946

947947
```typescript
948948
const hasUISupport =
949-
clientCapabilities?.extensions?.["io.modelcontextprotocol/ui"]?.mimeTypes?.includes("text/html+mcp");
949+
clientCapabilities?.extensions?.["io.modelcontextprotocol/ui"]?.mimeTypes?.includes("text/html;profile=mcp-app");
950950

951951
if (hasUISupport) {
952952
// Register tools with UI templates
@@ -1030,7 +1030,7 @@ This proposal synthesizes feedback from the UI CWG and MCP-UI community, host im
10301030

10311031
#### 3. Support Raw HTML Content Type
10321032

1033-
**Decision:** MVP supports only `text/html+mcp` (rawHtml), with other types explicitly deferred.
1033+
**Decision:** MVP supports only `text/html;profile=mcp-app` (rawHtml), with other types explicitly deferred.
10341034

10351035
**Rationale:**
10361036

0 commit comments

Comments
 (0)