Skip to content

Commit 4dc24cf

Browse files
authored
fix(filesystem): convert to modern TypeScript SDK APIs (#3016)
* fix(filesystem): convert to modern TypeScript SDK APIs Convert the filesystem server to use the modern McpServer API instead of the low-level Server API. Key changes: - Replace Server with McpServer from @modelcontextprotocol/sdk/server/mcp.js - Convert all 13 tools to use registerTool() instead of manual request handlers - Use Zod schemas directly in inputSchema/outputSchema - Add structuredContent to all tool responses - Fix type literals to use 'as const' assertions - Update roots protocol handling to use server.server.* pattern - Fix tsconfig to exclude vitest.config.ts Tools converted: - read_file (deprecated) - read_text_file - read_media_file - read_multiple_files - write_file - edit_file - create_directory - list_directory - list_directory_with_sizes - directory_tree - move_file - search_files - get_file_info - list_allowed_directories The modern API provides: - Less boilerplate code - Better type safety with Zod - More declarative tool registration - Cleaner, more maintainable code * fix: use default import for minimatch minimatch v10+ uses default export instead of named export * fix(filesystem): use named import for minimatch The minimatch module doesn't have a default export, so we need to use the named import syntax instead. Fixes TypeScript compilation error: error TS2613: Module has no default export. Did you mean to use 'import { minimatch } from "minimatch"' instead?
1 parent 28a3132 commit 4dc24cf

File tree

2 files changed

+535
-447
lines changed

2 files changed

+535
-447
lines changed

0 commit comments

Comments
 (0)