Skip to content

Commit bd5a34b

Browse files
antonpk1claude
andcommitted
fix: use consistent text/vnd.mcp.ui+html mimeType throughout
Replace all occurrences of text/html with text/vnd.mcp.ui+html in the specification and example code for consistency. The spec already defined text/vnd.mcp.ui+html in the capability negotiation section but used text/html in other places. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 7d38af9 commit bd5a34b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
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/html",
50+
mimeType: "text/vnd.mcp.ui+html",
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/html",
92+
mimeType: "text/vnd.mcp.ui+html",
9393
};
9494

9595
server.registerResource(

specification/draft/apps.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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`) as the initial content type, with extensibility for future formats.
46+
This specification focuses on HTML content (`text/vnd.mcp.ui+html`) 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/html' in MVP
59+
mimeType: string; // SHOULD be 'text/vnd.mcp.ui+html' in MVP
6060
}
6161
```
6262

@@ -67,7 +67,7 @@ The resource content is returned via `resources/read`:
6767
{
6868
contents: [{
6969
uri: string; // Matching UI resource URI
70-
mimeType: "text/html"; // MUST be "text/html"
70+
mimeType: "text/vnd.mcp.ui+html"; // MUST be "text/vnd.mcp.ui+html"
7171
text?: string; // HTML content as string
7272
blob?: string; // OR base64-encoded HTML
7373
_meta?: {
@@ -85,7 +85,7 @@ The resource content is returned via `resources/read`:
8585
#### Content Requirements:
8686

8787
- URI MUST start with `ui://` scheme
88-
- `mimeType` MUST be `text/html` (other types reserved for future extensions)
88+
- `mimeType` MUST be `text/vnd.mcp.ui+html` (other types reserved for future extensions)
8989
- Content MUST be provided via either `text` (string) or `blob` (base64-encoded)
9090
- Content MUST be valid HTML5 document
9191

@@ -144,14 +144,14 @@ Example:
144144
"uri": "ui://weather-server/dashboard-template",
145145
"name": "weather_dashboard",
146146
"description": "Interactive weather dashboard widget",
147-
"mimeType": "text/html"
147+
"mimeType": "text/vnd.mcp.ui+html"
148148
}
149149

150150
// Resource content with metadata
151151
{
152152
"contents": [{
153153
"uri": "ui://weather-server/dashboard-template",
154-
"mimeType": "text/html",
154+
"mimeType": "text/vnd.mcp.ui+html",
155155
"text": "<!DOCTYPE html><html>...</html>",
156156
"_meta": {
157157
"ui/csp": {
@@ -841,7 +841,7 @@ Servers SHOULD check client (host would-be) capabilities before registering UI-e
841841

842842
```typescript
843843
const hasUISupport =
844-
clientCapabilities?.extensions?.["io.modelcontextprotocol/ui"]?.mimeTypes?.includes("text/html");
844+
clientCapabilities?.extensions?.["io.modelcontextprotocol/ui"]?.mimeTypes?.includes("text/vnd.mcp.ui+html");
845845

846846
if (hasUISupport) {
847847
// Register tools with UI templates
@@ -925,7 +925,7 @@ This proposal synthesizes feedback from the UI CWG and MCP-UI community, host im
925925

926926
#### 3. Support Raw HTML Content Type
927927

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

930930
**Rationale:**
931931

0 commit comments

Comments
 (0)