Commit Graph

133 Commits

Author SHA1 Message Date
GitHub Actions
3e805376da Automatic update of packages 2026-01-14 11:41:22 +00:00
dependabot[bot]
737ce98e4a Bump @modelcontextprotocol/sdk
Bumps the npm_and_yarn group with 1 update in the / directory: [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk).


Updates `@modelcontextprotocol/sdk` from 1.24.0 to 1.25.2
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](https://github.com/modelcontextprotocol/typescript-sdk/compare/1.24.0...v1.25.2)

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.25.2
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-07 16:49:05 +00:00
tomonacci
1ae217d74d Remove only trailing slashes (#3183) 2026-01-05 18:42:10 +00:00
Ola Hungerford
968acc2ec9 fix(filesystem): return string in structuredContent to match outputSchema (#3113)
* fix(filesystem): return string in structuredContent to match outputSchema

The directory_tree, move_file, and list_directory_with_sizes tools were
returning an array in structuredContent.content, but outputSchema declares
content as z.string(). This caused MCP error -32602 validation failures.

Changed structuredContent from { content: [contentBlock] } to { content: text }
to match the declared outputSchema and be consistent with other filesystem
tools like list_directory and search_files.

Fixes #3110, #3106, #3093

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(filesystem): add integration tests for structuredContent schema compliance

Adds tests to verify that directory_tree, list_directory_with_sizes, and
move_file tools return structuredContent.content as a string (matching
outputSchema) rather than an array.

These tests prevent regression of issues #3110, #3106, #3093.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: adam jones <domdomegg+git@gmail.com>
2025-12-11 13:50:27 +00:00
Stefan Dirkse
e6933ca98b Fix: Changed structuredContent output to match outputSchema (#3099) 2025-12-11 13:48:04 +00:00
dependabot[bot]
1c654a4e7d chore(deps): bump @modelcontextprotocol/sdk
Bumps the npm_and_yarn group with 1 update in the / directory: [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk).


Updates `@modelcontextprotocol/sdk` from 1.23.0 to 1.24.0
- [Release notes](https://github.com/modelcontextprotocol/typescript-sdk/releases)
- [Commits](https://github.com/modelcontextprotocol/typescript-sdk/compare/1.23.0...1.24.0)

---
updated-dependencies:
- dependency-name: "@modelcontextprotocol/sdk"
  dependency-version: 1.24.0
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-02 17:40:23 +00:00
adam jones
d9929014d5 Add mcpName and repository fields for MCP registry (#3068)
Adds metadata required for registering servers in the MCP registry:

- NPM servers (everything, filesystem, memory, sequentialthinking):
  Added mcpName and repository fields to package.json

- PyPI servers (fetch, git, time):
  Added mcp-name comment to README.md

Part of #3047
2025-11-26 14:29:36 +00:00
dependabot[bot]
c017f44ee2 chore(deps): bump glob in the npm_and_yarn group across 1 directory (#3076)
Bumps the npm_and_yarn group with 1 update in the / directory: [glob](https://github.com/isaacs/node-glob).


Updates `glob` from 10.4.5 to 10.5.0
- [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v10.4.5...v10.5.0)

---
updated-dependencies:
- dependency-name: glob
  dependency-version: 10.5.0
  dependency-type: direct:production
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-26 13:18:16 +00:00
adam jones
3154518344 Update @modelcontextprotocol/sdk to 1.23.0 in TypeScript servers (#3065)
Update the SDK from ^1.19.1 to ^1.23.0 in all TypeScript reference servers:
- everything
- filesystem
- memory
- sequentialthinking

Also update everything server for SDK breaking changes:
- Update zod to ^3.25.0 (zod v4 compatibility)
- Fix ToolInput/ToolOutput types to use Tool["inputSchema"] instead of
  inferring from zod schemas
- Fix result.content handling to support array format

Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
2025-11-26 12:32:37 +00:00
Adam Jones
350ffeec01 Fix VS Code MCP documentation URLs
Update links to point to the new location at /docs/copilot/customization/mcp-servers
2025-11-25 22:11:56 +00:00
Valeriy Pavlovich
84c2824f03 # feat(filesystem): add ToolAnnotations hints to filesystem tools (#3045)
**Files touched**

- [src/filesystem/index.ts](../blob/HEAD/src/filesystem/index.ts) — add `annotations` metadata to each tool definition
- [src/filesystem/README.md](../blob/HEAD/src/filesystem/README.md) — document ToolAnnotations mapping for all filesystem tools

## Description

This change adds MCP `ToolAnnotations` (`readOnlyHint`, `idempotentHint`, `destructiveHint`) to all filesystem tools and documents the mapping in the filesystem README. MCP clients can now accurately distinguish read‑only vs. write tools, understand which operations are safe to retry, and highlight potentially destructive actions.

## Server Details

- **Server**: filesystem
- **Area**: tools (metadata returned via `listTools` / `ListToolsRequest`) and server docs

## Motivation and Context

Previously, the filesystem server did not expose ToolAnnotations, so many clients (e.g. ChatGPT Apps) conservatively treated filesystem tools as generic write operations. This led to:

- READ operations being surfaced with WRITE badges and confirmation prompts.
- No way for clients to know which write tools are idempotent or potentially destructive.

This PR aligns the implementation with `servers#2988` and updates the README to clearly document the semantics of each tool. Read‑only operations no longer need to be treated as writes, and destructive/idempotent behavior is explicit for UI and retry logic.

## How Has This Been Tested?

- `npm run build --workspace @modelcontextprotocol/server-filesystem`
- `npm test --workspaces --if-present`

## Breaking Changes

None.

## Types of changes

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] Documentation update

## Checklist

- [x] I have read the [MCP Protocol Documentation](https://modelcontextprotocol.io)
- [x] My changes follows MCP security best practices
- [x] I have updated the server's README accordingly
- [x] I have tested this with an LLM client
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [ ] I have documented all environment variables and configuration options

## Additional context

None.

Co-authored-by: Valeriy_Pavlovich <vp@strato.space>
2025-11-24 15:58:15 +00:00
Adam Jones
3f2ddb0479 fix: simplify output schemas for text-only tools and add structuredContent
For text-only tool responses, simplify outputSchemas from complex nested
arrays to simple { content: z.string() } format. All tool responses now
include structuredContent matching their outputSchema, fixing MCP protocol
violations when tools had output schemas but no structured content.

This applies to both filesystem and everything servers.
2025-11-20 21:44:36 +00:00
adam jones
55c3a31690 fix(filesystem): address review feedback from #3016 (#3031)
Address two items from Camila's review:

1. Use blob type for non-image/non-audio media files, restoring the
   original behavior. This matches the previous implementation which
   used blob as the fallback for unknown binary types. Use type
   assertion to satisfy the SDK's type constraints.

2. Reuse ReadTextFileArgsSchema.shape in the deprecated read_file tool
   instead of redefining the schema inline.
2025-11-20 20:29:22 +00:00
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
olaservo
c3b26fad30 Fix platform-dependent relative path test in filesystem
The test was expecting forward slashes to always be converted to backslashes, but normalizePath() only does this on Windows (process.platform === 'win32'). On Linux/Unix, forward slashes are preserved.

Improved the fix by:
1. Removing relative path assertion from the "as is" test since it doesn't match intent
2. Adding a dedicated test that validates platform-specific behavior naturally without mocking
3. Using the actual platform instead of unreliable Object.defineProperty mocking

This approach is more reliable and clearly documents expected behavior per platform.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 21:27:13 -07:00
olaservo
bbbc0c6381 Fix TypeScript error in filesystem tests by adding missing afterEach import
The afterEach function was used in the test file but not imported from vitest, causing a build failure. This was introduced in PR #2851.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-28 21:06:25 -07:00
Ola Hungerford
d2eb945c4d Merge pull request #2851 from olaservo/fix-wsl-path-conversion
Resolve filesystem issue where WSL paths are incorrectly converted to Windows format
2025-10-28 18:56:58 -07:00
Ola Hungerford
ed4b36b6d5 Merge branch 'main' into fix-wsl-path-conversion 2025-10-19 11:45:07 -07:00
olaservo
b666e7f246 Migrate sequentialthinking and filesystem servers from Jest to Vitest
- Replace Jest dependencies with Vitest and @vitest/coverage-v8
- Update test scripts to use 'vitest run --coverage'
- Create vitest.config.ts for both servers with node environment and coverage settings
- Update all test files:
  - Change imports from '@jest/globals' to 'vitest'
  - Replace jest.mock() with vi.mock()
  - Replace jest.fn() with vi.fn()
  - Update mock clearing/restoring to use vi methods
- Remove jest.config.cjs files
- All 151 tests passing (24 in sequentialthinking, 127 in filesystem)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-19 11:21:58 -07:00
olaservo
c9b0135aa5 fix: preserve WSL paths and improve path normalization logic 2025-10-12 19:59:22 -07:00
olaservo
f6fbfc4c5e Merge remote-tracking branch 'upstream/main' into add-sequentialthinking-tests-update-sdk 2025-10-12 18:09:41 -07:00
olaservo
f03a4eda56 Merge remote-tracking branch 'upstream/main' 2025-10-12 18:07:29 -07:00
olaservo
072e53322b Add tests for sequential thinking and update typescript sdk versions 2025-10-07 23:01:42 -07:00
多吃点
097fdab463 docs: Fix duplicate directory_tree tool entry in API documentation 2025-09-13 13:00:02 +08:00
Sebastien Rosset (serosset)
b647cb3019 Add documentation for the read_multiple_files action. 2025-08-23 10:51:51 -07:00
Finn Andersen
fd886fac9c Support glob pattern in search_files tool (#745)
Co-authored-by: Adam Jones <adamj+git@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Adam Jones <adamj@anthropic.com>
2025-08-23 07:37:53 +01:00
Enrico Ballardini
d381cf1ffd feat(directory_tree): add excludePatterns support & documentation (#623)
- Update documentation with directory_tree declaration
- Add excludePatterns parameter to DirectoryTreeArgsSchema
- Implement pattern exclusion in buildTree function using minimatch
- Pass excludePatterns through recursive calls
- Support both simple and glob patterns for exclusion
- Maintain consistent behavior with search_files implementation

* Add tests and fix implementation

---------

Co-authored-by: Ola Hungerford <olahungerford@gmail.com>
Co-authored-by: Adam Jones <adamj+git@anthropic.com>
Co-authored-by: Adam Jones <adamj@anthropic.com>
2025-08-23 07:19:01 +01:00
Michael Casazza
46368832ef Windows filesystem MCP enhancements (#543)
* fix: comprehensive Windows path handling improvements

- Add path-utils module for consistent path handling
- Handle Windows paths with spaces via proper quoting
- Support Unix-style Windows paths (/c/path)
- Support WSL paths (/mnt/c/path)
- Add comprehensive test coverage
- Fix path normalization for all path formats

Closes #447

* tested locally and working now

* Add filesystem path utils and tests

* Ensure Windows drive letters are capitalized in normalizePath

* adding test for gh pr comment

* pushing jest and windows testing config

* last commit? fixing comments on PR

* Fix bin and bump sdk

* Remove redundant commonjs version of path-utils and import from ts version

* Remove copying cjs file

* Remove copying run-server

* Remove complex args parsing and do other cleanup

* Add missing tools details to Readme

* Move utility functions from index to lib

* Add more tests and handle very small and very large files edge cases

* Finish refactoring and include original security fix comments

* On Windows, also check for drive root

* Check symlink support on restricted Windows environments

* Fix tests

* Bump SDK and package version

* Clean up

---------

Co-authored-by: olaservo <olahungerford@gmail.com>
Co-authored-by: adam jones <adamj+git@anthropic.com>
2025-08-18 18:23:40 +01:00
Ola Hungerford
7e1d9d9ede fix: clarify list_allowed_directories description to mention subdirectory access (#2571)
The tool description was ambiguous about subdirectory access within allowed directories.
Updated the description to explicitly state that subdirectories are also accessible.

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
2025-08-17 23:32:33 +01:00
claude[bot]
54f9c6968e fix: remove incorrect resources claim from filesystem server README
The filesystem server does not actually implement MCP Resources capability
but the README incorrectly claimed it provides 'file://system' resource interface.

Fixes #399

Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>
2025-08-17 16:38:29 +00:00
Ola Hungerford
1028b32573 Merge pull request #2328 from kunalbabre/main
docs: Update VS Code installation instructions to use mcp.json for issue  #2320
2025-08-07 07:28:32 -07:00
Sampath Vuyyuru
a688cca947 Update src/filesystem/README.md
Fix broken link to Roots
2025-07-26 18:09:30 +00:00
cliffhall
704275818f Replace read_file tool with deprecation notice in description, which is functionally just an alias for read_text_file 2025-07-25 16:01:05 -04:00
cliffhall
471ac89f55 Update SDK version 2025-07-24 14:37:49 -04:00
cliffhall
ba20bd60af Update the way the stream is concatenated
Update the ts sdk
2025-07-18 16:09:56 -04:00
Cliff Hall
2feb7cbaa5 Update src/filesystem/README.md
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-07-18 16:03:22 -04:00
Cliff Hall
d532a5846d Stream media file reads 2025-07-18 14:18:32 -04:00
Cliff Hall
11a064c359 Rename read_file to read_text_file and add read_media_file 2025-07-18 13:42:56 -04:00
Kunal Babre
55a36ad0dd docs: Clean up VS Code installation instructions
- Remove unnecessary explanatory note about JSON format
- JSON examples already demonstrate the correct format clearly
- Streamlines documentation to focus on essential information
- Maintains reference to official VS Code MCP documentation

The removed note was redundant since both configuration methods 
use identical JSON structure shown in the examples.
2025-07-11 22:53:13 -07:00
Kunal Babre
95a72b792f docs: Add reference to official VS Code MCP documentation
- Add link to official VS Code MCP documentation in all server READMEs
- Enhances existing VS Code installation instructions with authoritative reference
- Provides users with comprehensive documentation for advanced configuration
- Complements the existing two-method approach with additional resources

Affects: everything, filesystem, git, memory, sequentialthinking
2025-07-11 22:45:10 -07:00
Kunal Babre
20eb59590e docs: Update VS Code installation instructions to use mcp.json
- Replace outdated 'Preferences: Open Settings (JSON)' instructions
- Add proper guidance for 'MCP: Open User Configuration' command
- Update JSON examples to remove mcp wrapper key
- Clarify user vs workspace configuration methods
- Fixes issue with outdated documentation across all servers

Affects: sequentialthinking, filesystem, memory, everything, git
2025-07-11 21:36:21 -07:00
Nandha Reddy
2c922a93f9 feat(filesystem): add symlink resolution and home directory support to roots protocol
- Add symlink resolution using fs.realpath() for security consistency
- Support home directory expansion (~/) in root URI specifications
- Improve error handling with null checks, detailed error messages, and informative logging
- Change allowedDirectories from constant to variable to support roots protocol directory management
2025-07-02 13:38:22 +10:00
Nandha Reddy
f3891aaf69 Apply suggestions from code review comments on docs and logging
Co-authored-by: Ola Hungerford <olahungerford@gmail.com>
2025-07-02 09:44:16 +10:00
Nandha Reddy
f8dd74576b feat(filesystem): implement MCP roots protocol for dynamic directory management
- Extract roots processing logic from index.ts into testable roots-utils.ts module and add Test suite
- Update README to recommend MCP roots protocol for dynamic directory management
2025-07-02 09:44:16 +10:00
Nandha Reddy
b37da40003 feat(filesystem): implement MCP roots protocol for dynamic directory management
- Add support for dynamic directory updates via MCP roots protocol
- Allow clients to override command-line directories at runtime
- Maintain backwards compatibility with existing command-line args
- Add comprehensive error handling for edge cases
- Update documentation to explain both configuration methods

Fixes #401
2025-07-02 09:43:25 +10:00
Jenn Newton
d00c60df9d Address symlink and path prefix issues with allowed directories 2025-06-30 20:04:46 -04:00
Ola Hungerford
178281230c Update src/filesystem/package.json
Co-authored-by: Cliff Hall <cliff@futurescale.com>
2025-06-20 13:54:04 -07:00
Ola Hungerford
e9c4c9d4ba Handle unc path 2025-06-19 21:29:31 -07:00
olaservo
9dd94fd9a0 Adjust path-utils 2025-06-19 21:18:38 -07:00