Skip to content

Test local filesystem MCP servers for path-traversal containment and search speed

Compare filesystem and code-editing MCP servers on symlink escape prevention, ripgrep integration, and partial-file edit reliability.

Copy the prompt and paste it into the AI assistant you already use.

Key criteria for evaluating filesystem MCP servers

  1. 01

    Verify canonical realpath containment checks

    Naive prefix string checks fail on symlinks or case-insensitive drives; audit realpath verification on every read and write.

  2. 02

    Ensure .gitignore and node_modules exclusion

    Recursive directory tools that traverse build artifacts or .git objects freeze agents and leak environment files.

  3. 03

    Compare line-numbered ranged reads

    Agents edit far more accurately when file read tools return explicit line numbers and byte-capped slices.

  4. 04

    Check atomic write and diff preview support

    Top servers support dry-run unified diff previews and atomic temp-file writes to prevent half-written source files.

How it works in practice

Security & editing test

Test 4 filesystem MCP servers on 50 multi-hunk file edits + 12 symlink escape vectors pointing to ~/.ssh.

Audit & benchmark table

fs-sandbox-mcp v2.1: 0/12 escapes allowed, 97% clean multi-hunk edits, respects .gitignore. legacy-fs-mcp v0.6: 2/12 symlink escapes succeeded, 79% clean edits, scans node_modules.

Canonical symlink resolution and .gitignore-aware search are non-negotiable before granting local workspace access.

Questions and answers

How can a filesystem MCP server leak files outside an allowed directory?

If a server validates paths before resolving symbolic links—or mishandles parent directory creation—an agent or malicious repo symlink can read ~/.aws or ~/.ssh.

Why does .gitignore support matter for speed benchmarks?

Without .gitignore filtering, a single search tool call across node_modules or .venv can stall for 20+ seconds and overflow output limits.

Do benchmarks test Windows path separators as well as POSIX?

Yes, path normalization and drive-letter traversal checks run across Linux, macOS, and Windows path conventions.