Skip to content

Commit 30de2e9

Browse files
Merge pull request #28 from antonpk1/fix/mcp-apps-new-meta-format
fix: update MCP Apps to use new _meta.ui.resourceUri format
2 parents e040655 + 2903c3a commit 30de2e9

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"clean": "rm -rf dist"
2424
},
2525
"dependencies": {
26-
"@modelcontextprotocol/ext-apps": "https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/ext-apps@95663d4",
26+
"@modelcontextprotocol/ext-apps": "^0.4.0",
2727
"@modelcontextprotocol/sdk": "^1.24.2",
2828
"@redis/client": "^1.6.0",
2929
"cors": "^2.8.5",

src/modules/mcp/services/mcp.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ enum ToolName {
9696
}
9797

9898
// MCP Apps constants
99-
const RESOURCE_URI_META_KEY = "ui/resourceUri";
10099
const HELLO_WORLD_APP_URI = "ui://hello-world/app.html";
101100

102101
enum PromptName {
@@ -492,7 +491,7 @@ export const createMcpServer = (): McpServerWrapper => {
492491
description:
493492
"Demonstrates MCP Apps - returns an interactive UI that runs in the client",
494493
inputSchema: { type: "object", properties: {} },
495-
_meta: { [RESOURCE_URI_META_KEY]: HELLO_WORLD_APP_URI },
494+
_meta: { ui: { resourceUri: HELLO_WORLD_APP_URI } },
496495
},
497496
];
498497

@@ -767,7 +766,19 @@ export const createMcpServer = (): McpServerWrapper => {
767766
text: "If this client supports MCP Apps, an interactive UI should have rendered for the user.",
768767
},
769768
],
770-
_meta: { [RESOURCE_URI_META_KEY]: HELLO_WORLD_APP_URI },
769+
structuredContent: {
770+
greeting: "Hello from MCP Apps!",
771+
timestamp: new Date().toISOString(),
772+
features: ["interactive UI", "bidirectional communication", "theme support"],
773+
stats: {
774+
version: "1.0.0",
775+
requestCount: Math.floor(Math.random() * 1000),
776+
},
777+
},
778+
_meta: {
779+
exampleKey: "exampleValue",
780+
processed: true,
781+
},
771782
};
772783
}
773784

0 commit comments

Comments
 (0)