Commit Graph

3 Commits

Author SHA1 Message Date
adam jones
4dc24cf349 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?
2025-11-20 17:00:04 +00:00
Sanghee Son
bd39b09e4c fix: exclude test files from filesystem build
test files were being compiled into dist during build,
causing issues in docker environments. added exclude
pattern to tsconfig to skip __tests__ directory.

fixes #2928
2025-10-31 16:33:22 +09:00
Mahesh Murag
3ded1f161d Updated Filesystem 2024-11-20 22:32:38 -05:00