44
55import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js" ;
66import type { ServerConfig } from "./config.js" ;
7+ import { ReadChapterInputSchema , ReadOutlineInputSchema } from "./schemas/tool-schemas.js" ;
78import { ChapterIndexService } from "./services/chapter-index.js" ;
89import { SpecLoader } from "./services/spec-loader.js" ;
9- import {
10- ReadOutlineInputSchema ,
11- ReadChapterInputSchema ,
12- } from "./schemas/tool-schemas.js" ;
13- import { handleReadOutline , handleReadChapter } from "./tools/index.js" ;
10+ import { handleReadChapter , handleReadOutline } from "./tools/index.js" ;
1411
1512export function createServer ( config : ServerConfig ) : McpServer {
1613 const server = new McpServer (
1714 { name : config . name , version : config . version } ,
18- { capabilities : { tools : { } } }
15+ { capabilities : { tools : { } } } ,
1916 ) ;
2017
2118 const indexService = new ChapterIndexService ( config . specsPath ) ;
@@ -26,15 +23,15 @@ export function createServer(config: ServerConfig): McpServer {
2623 "cityjson_read_spec_outline" ,
2724 "Returns the table of contents for the CityJSON specification, including all chapters and their sections" ,
2825 ReadOutlineInputSchema . shape ,
29- async ( params ) => handleReadOutline ( params , indexService )
26+ async ( params ) => handleReadOutline ( params , indexService ) ,
3027 ) ;
3128
3229 // Register cityjson_read_spec_chapter
3330 server . tool (
3431 "cityjson_read_spec_chapter" ,
3532 "Returns the full specification content for a specific chapter in Markdown format" ,
3633 ReadChapterInputSchema . shape ,
37- async ( params ) => handleReadChapter ( params , specLoader , indexService )
34+ async ( params ) => handleReadChapter ( params , specLoader , indexService ) ,
3835 ) ;
3936
4037 return server ;
0 commit comments