@@ -29,23 +29,36 @@ export function createServer(): McpServer {
2929 // TODO: Replace with your own tool and resource.
3030 const resourceUri = "ui://my-tool/mcp-app.html" ;
3131
32- registerAppTool ( server , "my-tool" , {
33- title : "My Tool" ,
34- description : "TODO: Describe what this tool does." ,
35- inputSchema : { } ,
36- _meta : { ui : { resourceUri } } ,
37- } , async ( ) : Promise < CallToolResult > => {
38- return { content : [ { type : "text" , text : "TODO: Return tool result." } ] } ;
39- } ) ;
32+ registerAppTool (
33+ server ,
34+ "my-tool" ,
35+ {
36+ title : "My Tool" ,
37+ description : "TODO: Describe what this tool does." ,
38+ inputSchema : { } ,
39+ _meta : { ui : { resourceUri } } ,
40+ } ,
41+ async ( ) : Promise < CallToolResult > => {
42+ return { content : [ { type : "text" , text : "TODO: Return tool result." } ] } ;
43+ } ,
44+ ) ;
4045
41- registerAppResource ( server , resourceUri , resourceUri , {
42- mimeType : RESOURCE_MIME_TYPE ,
43- } , async ( ) : Promise < ReadResourceResult > => {
44- const html = await readAppHtml ( "mcp-app.html" ) ;
45- return {
46- contents : [ { uri : resourceUri , mimeType : RESOURCE_MIME_TYPE , text : html } ] ,
47- } ;
48- } ) ;
46+ registerAppResource (
47+ server ,
48+ resourceUri ,
49+ resourceUri ,
50+ {
51+ mimeType : RESOURCE_MIME_TYPE ,
52+ } ,
53+ async ( ) : Promise < ReadResourceResult > => {
54+ const html = await readAppHtml ( "mcp-app.html" ) ;
55+ return {
56+ contents : [
57+ { uri : resourceUri , mimeType : RESOURCE_MIME_TYPE , text : html } ,
58+ ] ,
59+ } ;
60+ } ,
61+ ) ;
4962
5063 return server ;
5164}
0 commit comments