Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 14 additions & 3 deletions src/modules/mcp/services/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 } },
},
];

Expand Down Expand Up @@ -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,
},
};
}

Expand Down