Merge pull request #28 from antonpk1/fix/mcp-apps-new-meta-format

fix: update MCP Apps to use new _meta.ui.resourceUri format
This commit is contained in:
Jerome 2026-01-14 21:57:40 +00:00 • committed by GitHub
commit 30de2e9ccc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 4 deletions

View file

@ -23,7 +23,7 @@
"clean": "rm -rf dist"
},
"dependencies": {
"@modelcontextprotocol/ext-apps": "https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/ext-apps@95663d4",
"@modelcontextprotocol/ext-apps": "^0.4.0",
"@modelcontextprotocol/sdk": "^1.24.2",
"@redis/client": "^1.6.0",
"cors": "^2.8.5",

View file

@ -96,7 +96,6 @@ enum ToolName {
}
// MCP Apps constants
const RESOURCE_URI_META_KEY = "ui/resourceUri";
const HELLO_WORLD_APP_URI = "ui://hello-world/app.html";
enum PromptName {
@ -492,7 +491,7 @@ export const createMcpServer = (): McpServerWrapper => {
description:
"Demonstrates MCP Apps - returns an interactive UI that runs in the client",
inputSchema: { type: "object", properties: {} },
_meta: { [RESOURCE_URI_META_KEY]: HELLO_WORLD_APP_URI },
_meta: { ui: { resourceUri: HELLO_WORLD_APP_URI } },
},
];
@ -767,7 +766,19 @@ export const createMcpServer = (): McpServerWrapper => {
text: "If this client supports MCP Apps, an interactive UI should have rendered for the user.",
},
],
_meta: { [RESOURCE_URI_META_KEY]: HELLO_WORLD_APP_URI },
structuredContent: {
greeting: "Hello from MCP Apps!",
timestamp: new Date().toISOString(),
features: ["interactive UI", "bidirectional communication", "theme support"],
stats: {
version: "1.0.0",
requestCount: Math.floor(Math.random() * 1000),
},
},
_meta: {
exampleKey: "exampleValue",
processed: true,
},
};
}