11import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js" ;
22import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js" ;
3- import type { CallToolResult , ReadResourceResult } from "@modelcontextprotocol/sdk/types.js" ;
3+ import type {
4+ CallToolResult ,
5+ ReadResourceResult ,
6+ } from "@modelcontextprotocol/sdk/types.js" ;
47import fs from "node:fs/promises" ;
58import path from "node:path" ;
6- import { registerAppTool , registerAppResource , RESOURCE_MIME_TYPE , RESOURCE_URI_META_KEY } from "@modelcontextprotocol/ext-apps/server" ;
9+ import {
10+ registerAppTool ,
11+ registerAppResource ,
12+ RESOURCE_MIME_TYPE ,
13+ RESOURCE_URI_META_KEY ,
14+ } from "@modelcontextprotocol/ext-apps/server" ;
715import { startServer } from "./server-utils.js" ;
816
917const DIST_DIR = path . join ( import . meta. dirname , "dist" ) ;
@@ -29,7 +37,12 @@ export function createServer(): McpServer {
2937 } ,
3038 async ( ) : Promise < CallToolResult > => {
3139 return {
32- content : [ { type : "text" , text : JSON . stringify ( { time : new Date ( ) . toISOString ( ) } ) } ] ,
40+ content : [
41+ {
42+ type : "text" ,
43+ text : JSON . stringify ( { time : new Date ( ) . toISOString ( ) } ) ,
44+ } ,
45+ ] ,
3346 } ;
3447 } ,
3548 ) ;
@@ -40,9 +53,14 @@ export function createServer(): McpServer {
4053 RESOURCE_URI ,
4154 { mimeType : RESOURCE_MIME_TYPE } ,
4255 async ( ) : Promise < ReadResourceResult > => {
43- const html = await fs . readFile ( path . join ( DIST_DIR , "mcp-app.html" ) , "utf-8" ) ;
56+ const html = await fs . readFile (
57+ path . join ( DIST_DIR , "mcp-app.html" ) ,
58+ "utf-8" ,
59+ ) ;
4460 return {
45- contents : [ { uri : RESOURCE_URI , mimeType : RESOURCE_MIME_TYPE , text : html } ] ,
61+ contents : [
62+ { uri : RESOURCE_URI , mimeType : RESOURCE_MIME_TYPE , text : html } ,
63+ ] ,
4664 } ;
4765 } ,
4866 ) ;
0 commit comments