Skip to content

Commit 8bb58f3

Browse files
Update MIME type to text/html;profile=mcp-app
Apply MIME type change from commit 0af1532 to all examples and docs. The profile parameter follows RFC 6838 recommendations for custom media types, as MCP Apps is a profile of HTML rather than a new syntax. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a9d6ecd commit 8bb58f3

File tree

9 files changed

+43
-15
lines changed

9 files changed

+43
-15
lines changed

docs/quickstart.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ server.registerResource(resourceUri, resourceUri, {}, async () => {
132132
"utf-8",
133133
);
134134
return {
135-
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
135+
contents: [
136+
{ uri: resourceUri, mimeType: "text/html;profile=mcp-app", text: html },
137+
],
136138
};
137139
});
138140

examples/basic-host/src/implementation.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ async function getUiResourceHtml(serverInfo: ServerInfo, uri: string): Promise<s
106106

107107
const content = resource.contents[0];
108108

109-
// Per the MCP App specification, "text/html+mcp" signals this resource is
110-
// indeed for an MCP App UI.
111-
if (content.mimeType !== "text/html+mcp") {
109+
// Per the MCP App specification, "text/html;profile=mcp-app" signals this
110+
// resource is indeed for an MCP App UI.
111+
if (content.mimeType !== "text/html;profile=mcp-app") {
112112
throw new Error(`Unsupported MIME type: ${content.mimeType}`);
113113
}
114114

examples/basic-server-react/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ const server = new McpServer({
5151

5252
return {
5353
contents: [
54-
// Per the MCP App specification, "text/html+mcp" signals to the Host
55-
// that this resource is indeed for an MCP App UI.
56-
{ uri: resourceUri, mimeType: "text/html+mcp", text: html },
54+
// Per the MCP App specification, "text/html;profile=mcp-app" signals
55+
// to the Host that this resource is indeed for an MCP App UI.
56+
{ uri: resourceUri, mimeType: "text/html;profile=mcp-app", text: html },
5757
],
5858
};
5959
},

examples/basic-server-vanillajs/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ const server = new McpServer({
5151

5252
return {
5353
contents: [
54-
// Per the MCP App specification, "text/html+mcp" signals to the Host
55-
// that this resource is indeed for an MCP App UI.
56-
{ uri: resourceUri, mimeType: "text/html+mcp", text: html },
54+
// Per the MCP App specification, "text/html;profile=mcp-app" signals
55+
// to the Host that this resource is indeed for an MCP App UI.
56+
{ uri: resourceUri, mimeType: "text/html;profile=mcp-app", text: html },
5757
],
5858
};
5959
},

examples/budget-allocator-server/server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,9 @@ server.registerResource(
310310
"utf-8",
311311
);
312312
return {
313-
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
313+
contents: [
314+
{ uri: resourceUri, mimeType: "text/html;profile=mcp-app", text: html },
315+
],
314316
};
315317
},
316318
);

examples/cohort-heatmap-server/server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,13 @@ const server = new McpServer({
205205
);
206206

207207
return {
208-
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
208+
contents: [
209+
{
210+
uri: resourceUri,
211+
mimeType: "text/html;profile=mcp-app",
212+
text: html,
213+
},
214+
],
209215
};
210216
},
211217
);

examples/customer-segmentation-server/server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@ const server = new McpServer({
116116
);
117117

118118
return {
119-
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
119+
contents: [
120+
{
121+
uri: resourceUri,
122+
mimeType: "text/html;profile=mcp-app",
123+
text: html,
124+
},
125+
],
120126
};
121127
},
122128
);

examples/scenario-modeler-server/server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,13 @@ const server = new McpServer({
344344
"utf-8",
345345
);
346346
return {
347-
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
347+
contents: [
348+
{
349+
uri: resourceUri,
350+
mimeType: "text/html;profile=mcp-app",
351+
text: html,
352+
},
353+
],
348354
};
349355
},
350356
);

examples/system-monitor-server/server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,13 @@ const server = new McpServer({
165165
);
166166

167167
return {
168-
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
168+
contents: [
169+
{
170+
uri: resourceUri,
171+
mimeType: "text/html;profile=mcp-app",
172+
text: html,
173+
},
174+
],
169175
};
170176
},
171177
);

0 commit comments

Comments
 (0)