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 <noreply@anthropic.com>
This commit is contained in:
parent
a9d6ecd20c
commit
8bb58f332a
9 changed files with 43 additions and 15 deletions
|
|
@ -132,7 +132,9 @@ server.registerResource(resourceUri, resourceUri, {}, async () => {
|
|||
"utf-8",
|
||||
);
|
||||
return {
|
||||
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
|
||||
contents: [
|
||||
{ uri: resourceUri, mimeType: "text/html;profile=mcp-app", text: html },
|
||||
],
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -106,9 +106,9 @@ async function getUiResourceHtml(serverInfo: ServerInfo, uri: string): Promise<s
|
|||
|
||||
const content = resource.contents[0];
|
||||
|
||||
// Per the MCP App specification, "text/html+mcp" signals this resource is
|
||||
// indeed for an MCP App UI.
|
||||
if (content.mimeType !== "text/html+mcp") {
|
||||
// Per the MCP App specification, "text/html;profile=mcp-app" signals this
|
||||
// resource is indeed for an MCP App UI.
|
||||
if (content.mimeType !== "text/html;profile=mcp-app") {
|
||||
throw new Error(`Unsupported MIME type: ${content.mimeType}`);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ const server = new McpServer({
|
|||
|
||||
return {
|
||||
contents: [
|
||||
// Per the MCP App specification, "text/html+mcp" signals to the Host
|
||||
// that this resource is indeed for an MCP App UI.
|
||||
{ uri: resourceUri, mimeType: "text/html+mcp", text: html },
|
||||
// Per the MCP App specification, "text/html;profile=mcp-app" signals
|
||||
// to the Host that this resource is indeed for an MCP App UI.
|
||||
{ uri: resourceUri, mimeType: "text/html;profile=mcp-app", text: html },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ const server = new McpServer({
|
|||
|
||||
return {
|
||||
contents: [
|
||||
// Per the MCP App specification, "text/html+mcp" signals to the Host
|
||||
// that this resource is indeed for an MCP App UI.
|
||||
{ uri: resourceUri, mimeType: "text/html+mcp", text: html },
|
||||
// Per the MCP App specification, "text/html;profile=mcp-app" signals
|
||||
// to the Host that this resource is indeed for an MCP App UI.
|
||||
{ uri: resourceUri, mimeType: "text/html;profile=mcp-app", text: html },
|
||||
],
|
||||
};
|
||||
},
|
||||
|
|
|
|||
|
|
@ -310,7 +310,9 @@ server.registerResource(
|
|||
"utf-8",
|
||||
);
|
||||
return {
|
||||
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
|
||||
contents: [
|
||||
{ uri: resourceUri, mimeType: "text/html;profile=mcp-app", text: html },
|
||||
],
|
||||
};
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -205,7 +205,13 @@ const server = new McpServer({
|
|||
);
|
||||
|
||||
return {
|
||||
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
|
||||
contents: [
|
||||
{
|
||||
uri: resourceUri,
|
||||
mimeType: "text/html;profile=mcp-app",
|
||||
text: html,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -116,7 +116,13 @@ const server = new McpServer({
|
|||
);
|
||||
|
||||
return {
|
||||
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
|
||||
contents: [
|
||||
{
|
||||
uri: resourceUri,
|
||||
mimeType: "text/html;profile=mcp-app",
|
||||
text: html,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -344,7 +344,13 @@ const server = new McpServer({
|
|||
"utf-8",
|
||||
);
|
||||
return {
|
||||
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
|
||||
contents: [
|
||||
{
|
||||
uri: resourceUri,
|
||||
mimeType: "text/html;profile=mcp-app",
|
||||
text: html,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -165,7 +165,13 @@ const server = new McpServer({
|
|||
);
|
||||
|
||||
return {
|
||||
contents: [{ uri: resourceUri, mimeType: "text/html+mcp", text: html }],
|
||||
contents: [
|
||||
{
|
||||
uri: resourceUri,
|
||||
mimeType: "text/html;profile=mcp-app",
|
||||
text: html,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue