Skip to content

Commit aae2a86

Browse files
ochafikclaude
andcommitted
docs: restore educational comments in basic-server examples
Addresses PR review feedback to preserve explanatory comments that help developers understand the MCP App registration pattern. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 8bab9ef commit aae2a86

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

examples/basic-server-react/server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ export function createServer(): McpServer {
1717
version: "1.0.0",
1818
});
1919

20+
// Two-part registration: tool + resource, tied together by the resource URI.
2021
const resourceUri = "ui://get-time/mcp-app.html";
2122

23+
// Register a tool with UI metadata. When the host calls this tool, it reads
24+
// `_meta[RESOURCE_URI_META_KEY]` to know which resource to fetch and render
25+
// as an interactive UI.
2226
registerAppTool(server,
2327
"get-time",
2428
{
@@ -32,6 +36,7 @@ export function createServer(): McpServer {
3236
},
3337
);
3438

39+
// Register the resource, which returns the bundled HTML/JavaScript for the UI.
3540
registerAppResource(server,
3641
resourceUri,
3742
resourceUri,

examples/basic-server-vanillajs/server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export function createServer(): McpServer {
3838
},
3939
);
4040

41+
// Register the resource, which returns the bundled HTML/JavaScript for the UI.
4142
registerAppResource(server,
4243
RESOURCE_URI,
4344
RESOURCE_URI,

0 commit comments

Comments
 (0)