@@ -186,7 +186,7 @@ func (s *FilesystemServer) handleListTools(
186
186
"the contents of a single file. Only works within allowed directories." ,
187
187
InputSchema : mcp.ToolInputSchema {
188
188
Type : "object" ,
189
- Properties : map [ string ] interface {} {
189
+ Properties : mcp. ToolInputSchemaProperties {
190
190
"path" : map [string ]interface {}{
191
191
"type" : "string" ,
192
192
"description" : "Path to the file to read" ,
@@ -201,7 +201,7 @@ func (s *FilesystemServer) handleListTools(
201
201
"or compare multiple files." ,
202
202
InputSchema : mcp.ToolInputSchema {
203
203
Type : "object" ,
204
- Properties : map [ string ] interface {} {
204
+ Properties : mcp. ToolInputSchemaProperties {
205
205
"paths" : map [string ]interface {}{
206
206
"type" : "array" ,
207
207
"items" : map [string ]interface {}{
@@ -218,7 +218,7 @@ func (s *FilesystemServer) handleListTools(
218
218
"Use with caution as it will overwrite existing files without warning." ,
219
219
InputSchema : mcp.ToolInputSchema {
220
220
Type : "object" ,
221
- Properties : map [ string ] interface {} {
221
+ Properties : mcp. ToolInputSchemaProperties {
222
222
"path" : map [string ]interface {}{
223
223
"type" : "string" ,
224
224
"description" : "Path where to write the file" ,
@@ -236,7 +236,7 @@ func (s *FilesystemServer) handleListTools(
236
236
"Can create multiple nested directories in one operation." ,
237
237
InputSchema : mcp.ToolInputSchema {
238
238
Type : "object" ,
239
- Properties : map [ string ] interface {} {
239
+ Properties : mcp. ToolInputSchemaProperties {
240
240
"path" : map [string ]interface {}{
241
241
"type" : "string" ,
242
242
"description" : "Path of the directory to create" ,
@@ -250,7 +250,7 @@ func (s *FilesystemServer) handleListTools(
250
250
"Results clearly distinguish between files and directories with [FILE] and [DIR] prefixes." ,
251
251
InputSchema : mcp.ToolInputSchema {
252
252
Type : "object" ,
253
- Properties : map [ string ] interface {} {
253
+ Properties : mcp. ToolInputSchemaProperties {
254
254
"path" : map [string ]interface {}{
255
255
"type" : "string" ,
256
256
"description" : "Path of the directory to list" ,
@@ -264,7 +264,7 @@ func (s *FilesystemServer) handleListTools(
264
264
"and rename them in a single operation." ,
265
265
InputSchema : mcp.ToolInputSchema {
266
266
Type : "object" ,
267
- Properties : map [ string ] interface {} {
267
+ Properties : mcp. ToolInputSchemaProperties {
268
268
"source" : map [string ]interface {}{
269
269
"type" : "string" ,
270
270
"description" : "Source path of the file or directory" ,
@@ -282,7 +282,7 @@ func (s *FilesystemServer) handleListTools(
282
282
"Searches through all subdirectories from the starting path." ,
283
283
InputSchema : mcp.ToolInputSchema {
284
284
Type : "object" ,
285
- Properties : map [ string ] interface {} {
285
+ Properties : mcp. ToolInputSchemaProperties {
286
286
"path" : map [string ]interface {}{
287
287
"type" : "string" ,
288
288
"description" : "Starting path for the search" ,
@@ -300,7 +300,7 @@ func (s *FilesystemServer) handleListTools(
300
300
"creation time, last modified time, permissions, and type." ,
301
301
InputSchema : mcp.ToolInputSchema {
302
302
Type : "object" ,
303
- Properties : map [ string ] interface {} {
303
+ Properties : mcp. ToolInputSchemaProperties {
304
304
"path" : map [string ]interface {}{
305
305
"type" : "string" ,
306
306
"description" : "Path to the file or directory" ,
@@ -313,7 +313,7 @@ func (s *FilesystemServer) handleListTools(
313
313
Description : "Returns the list of directories that this server is allowed to access." ,
314
314
InputSchema : mcp.ToolInputSchema {
315
315
Type : "object" ,
316
- Properties : map [ string ] interface {} {},
316
+ Properties : mcp. ToolInputSchemaProperties {},
317
317
},
318
318
},
319
319
},
@@ -333,9 +333,7 @@ func (s *FilesystemServer) handleInitialize(
333
333
},
334
334
ProtocolVersion : "2024-11-05" ,
335
335
Capabilities : mcp.ServerCapabilities {
336
- Tools : & struct {
337
- ListChanged bool `json:"listChanged"`
338
- }{
336
+ Tools : & mcp.ServerCapabilitiesTools {
339
337
ListChanged : true ,
340
338
},
341
339
},
@@ -376,7 +374,7 @@ func (s *FilesystemServer) handleToolCall(
376
374
content , err := os .ReadFile (validPath )
377
375
if err != nil {
378
376
return & mcp.CallToolResult {
379
- Content : []mcp. Content {
377
+ Content : []interface {} {
380
378
mcp.TextContent {
381
379
Type : "text" ,
382
380
Text : fmt .Sprintf ("Error reading file: %v" , err ),
@@ -387,7 +385,7 @@ func (s *FilesystemServer) handleToolCall(
387
385
}
388
386
389
387
return & mcp.CallToolResult {
390
- Content : []mcp. Content {
388
+ Content : []interface {} {
391
389
mcp.TextContent {
392
390
Type : "text" ,
393
391
Text : string (content ),
@@ -428,7 +426,7 @@ func (s *FilesystemServer) handleToolCall(
428
426
}
429
427
430
428
return & mcp.CallToolResult {
431
- Content : []mcp. Content {
429
+ Content : []interface {} {
432
430
mcp.TextContent {
433
431
Type : "text" ,
434
432
Text : result .String (),
@@ -453,7 +451,7 @@ func (s *FilesystemServer) handleToolCall(
453
451
454
452
if err := os .WriteFile (validPath , []byte (content ), 0644 ); err != nil {
455
453
return & mcp.CallToolResult {
456
- Content : []mcp. Content {
454
+ Content : []interface {} {
457
455
mcp.TextContent {
458
456
Type : "text" ,
459
457
Text : fmt .Sprintf ("Error writing file: %v" , err ),
@@ -464,7 +462,7 @@ func (s *FilesystemServer) handleToolCall(
464
462
}
465
463
466
464
return & mcp.CallToolResult {
467
- Content : []mcp. Content {
465
+ Content : []interface {} {
468
466
mcp.TextContent {
469
467
Type : "text" ,
470
468
Text : fmt .Sprintf ("Successfully wrote to %s" , path ),
@@ -485,7 +483,7 @@ func (s *FilesystemServer) handleToolCall(
485
483
486
484
if err := os .MkdirAll (validPath , 0755 ); err != nil {
487
485
return & mcp.CallToolResult {
488
- Content : []mcp. Content {
486
+ Content : []interface {} {
489
487
mcp.TextContent {
490
488
Type : "text" ,
491
489
Text : fmt .Sprintf ("Error creating directory: %v" , err ),
@@ -496,7 +494,7 @@ func (s *FilesystemServer) handleToolCall(
496
494
}
497
495
498
496
return & mcp.CallToolResult {
499
- Content : []mcp. Content {
497
+ Content : []interface {} {
500
498
mcp.TextContent {
501
499
Type : "text" ,
502
500
Text : fmt .Sprintf (
@@ -521,7 +519,7 @@ func (s *FilesystemServer) handleToolCall(
521
519
entries , err := os .ReadDir (validPath )
522
520
if err != nil {
523
521
return & mcp.CallToolResult {
524
- Content : []mcp. Content {
522
+ Content : []interface {} {
525
523
mcp.TextContent {
526
524
Type : "text" ,
527
525
Text : fmt .Sprintf ("Error reading directory: %v" , err ),
@@ -541,7 +539,7 @@ func (s *FilesystemServer) handleToolCall(
541
539
}
542
540
543
541
return & mcp.CallToolResult {
544
- Content : []mcp. Content {
542
+ Content : []interface {} {
545
543
mcp.TextContent {
546
544
Type : "text" ,
547
545
Text : result .String (),
@@ -570,7 +568,7 @@ func (s *FilesystemServer) handleToolCall(
570
568
571
569
if err := os .Rename (validSource , validDest ); err != nil {
572
570
return & mcp.CallToolResult {
573
- Content : []mcp. Content {
571
+ Content : []interface {} {
574
572
mcp.TextContent {
575
573
Type : "text" ,
576
574
Text : fmt .Sprintf ("Error moving file: %v" , err ),
@@ -581,7 +579,7 @@ func (s *FilesystemServer) handleToolCall(
581
579
}
582
580
583
581
return & mcp.CallToolResult {
584
- Content : []mcp. Content {
582
+ Content : []interface {} {
585
583
mcp.TextContent {
586
584
Type : "text" ,
587
585
Text : fmt .Sprintf (
@@ -611,7 +609,7 @@ func (s *FilesystemServer) handleToolCall(
611
609
results , err := s .searchFiles (validPath , pattern )
612
610
if err != nil {
613
611
return & mcp.CallToolResult {
614
- Content : []mcp. Content {
612
+ Content : []interface {} {
615
613
mcp.TextContent {
616
614
Type : "text" ,
617
615
Text : fmt .Sprintf ("Error searching files: %v" , err ),
@@ -622,7 +620,7 @@ func (s *FilesystemServer) handleToolCall(
622
620
}
623
621
624
622
return & mcp.CallToolResult {
625
- Content : []mcp. Content {
623
+ Content : []interface {} {
626
624
mcp.TextContent {
627
625
Type : "text" ,
628
626
Text : strings .Join (results , "\n " ),
@@ -644,7 +642,7 @@ func (s *FilesystemServer) handleToolCall(
644
642
info , err := s .getFileStats (validPath )
645
643
if err != nil {
646
644
return & mcp.CallToolResult {
647
- Content : []mcp. Content {
645
+ Content : []interface {} {
648
646
mcp.TextContent {
649
647
Type : "text" ,
650
648
Text : fmt .Sprintf ("Error getting file info: %v" , err ),
@@ -655,7 +653,7 @@ func (s *FilesystemServer) handleToolCall(
655
653
}
656
654
657
655
return & mcp.CallToolResult {
658
- Content : []mcp. Content {
656
+ Content : []interface {} {
659
657
mcp.TextContent {
660
658
Type : "text" ,
661
659
Text : fmt .Sprintf (
@@ -674,7 +672,7 @@ func (s *FilesystemServer) handleToolCall(
674
672
675
673
case "list_allowed_directories" :
676
674
return & mcp.CallToolResult {
677
- Content : []mcp. Content {
675
+ Content : []interface {} {
678
676
mcp.TextContent {
679
677
Type : "text" ,
680
678
Text : fmt .Sprintf (
0 commit comments