Skip to content

Commit 0c56400

Browse files
authored
Merge pull request #6 from modelcontextprotocol/fix/mime-type-suffix-format
fix: use text/html+mcp mimeType format
2 parents f96c526 + c65006a commit 0c56400

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

examples/simple-server/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const getServer = async () => {
4747
uri: "ui://vanilla",
4848
title: "Vanilla UI Template",
4949
description: "A simple vanilla JS UI",
50-
mimeType: "text/vnd.mcp.ui+html",
50+
mimeType: "text/html+mcp",
5151
};
5252

5353
server.registerResource(
@@ -89,7 +89,7 @@ const getServer = async () => {
8989
uri: "ui://react",
9090
title: "React UI Template",
9191
description: "A React-based UI",
92-
mimeType: "text/vnd.mcp.ui+html",
92+
mimeType: "text/html+mcp",
9393
};
9494

9595
server.registerResource(

specification/draft/apps.mdx

Lines changed: 11 additions & 11 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/vnd.mcp.ui+html`) 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+mcp`) 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/vnd.mcp.ui+html`) as the initial content type, with extensibility for future formats.
46+
This specification focuses on HTML content (`text/html+mcp`) 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

@@ -56,7 +56,7 @@ interface UIResource {
5656
uri: string; // MUST start with 'ui://'
5757
name: string; // Human-readable identifier
5858
description?: string; // Description of the UI resource
59-
mimeType: string; // SHOULD be 'text/vnd.mcp.ui+html' in MVP
59+
mimeType: string; // SHOULD be 'text/html+mcp' in MVP
6060
_meta?: UIResourceMeta // Resource Metadata
6161
}
6262

@@ -77,7 +77,7 @@ The resource content is returned via `resources/read`:
7777
{
7878
contents: [{
7979
uri: string; // Matching UI resource URI
80-
mimeType: "text/vnd.mcp.ui+html"; // MUST be "text/vnd.mcp.ui+html"
80+
mimeType: "text/html+mcp"; // MUST be "text/html+mcp"
8181
text?: string; // HTML content as string
8282
blob?: string; // OR base64-encoded HTML
8383
_meta?: {
@@ -97,7 +97,7 @@ The resource content is returned via `resources/read`:
9797
#### Content Requirements:
9898

9999
- URI MUST start with `ui://` scheme
100-
- `mimeType` MUST be `text/vnd.mcp.ui+html` (other types reserved for future extensions)
100+
- `mimeType` MUST be `text/html+mcp` (other types reserved for future extensions)
101101
- Content MUST be provided via either `text` (string) or `blob` (base64-encoded)
102102
- Content MUST be valid HTML5 document
103103

@@ -156,14 +156,14 @@ Example:
156156
"uri": "ui://weather-server/dashboard-template",
157157
"name": "weather_dashboard",
158158
"description": "Interactive weather dashboard widget",
159-
"mimeType": "text/vnd.mcp.ui+html"
159+
"mimeType": "text/html+mcp"
160160
}
161161

162162
// Resource content with metadata
163163
{
164164
"contents": [{
165165
"uri": "ui://weather-server/dashboard-template",
166-
"mimeType": "text/vnd.mcp.ui+html",
166+
"mimeType": "text/html+mcp",
167167
"text": "<!DOCTYPE html><html>...</html>",
168168
"_meta": {
169169
"ui" : {
@@ -828,7 +828,7 @@ Clients advertise MCP Apps support in the initialize request using the extension
828828
"capabilities": {
829829
"extensions": {
830830
"io.modelcontextprotocol/ui": {
831-
"mimeTypes": ["text/vnd.mcp.ui+html"]
831+
"mimeTypes": ["text/html+mcp"]
832832
}
833833
}
834834
},
@@ -842,7 +842,7 @@ Clients advertise MCP Apps support in the initialize request using the extension
842842

843843
**Extension Settings:**
844844

845-
- `mimeTypes`: Array of supported content types (REQUIRED, e.g., `["text/vnd.mcp.ui+html"]`)
845+
- `mimeTypes`: Array of supported content types (REQUIRED, e.g., `["text/html+mcp"]`)
846846

847847
Future versions may add additional settings:
848848

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

856856
```typescript
857857
const hasUISupport =
858-
clientCapabilities?.extensions?.["io.modelcontextprotocol/ui"]?.mimeTypes?.includes("text/vnd.mcp.ui+html");
858+
clientCapabilities?.extensions?.["io.modelcontextprotocol/ui"]?.mimeTypes?.includes("text/html+mcp");
859859

860860
if (hasUISupport) {
861861
// Register tools with UI templates
@@ -939,7 +939,7 @@ This proposal synthesizes feedback from the UI CWG and MCP-UI community, host im
939939

940940
#### 3. Support Raw HTML Content Type
941941

942-
**Decision:** MVP supports only `text/vnd.mcp.ui+html` (rawHtml), with other types explicitly deferred.
942+
**Decision:** MVP supports only `text/html+mcp` (rawHtml), with other types explicitly deferred.
943943

944944
**Rationale:**
945945

0 commit comments

Comments
 (0)