filesystem-mcp
Filesystem MCP Server
Secure filesystem MCP server for reading, writing, searching, diffing, and patching files.
Table of Contents
MCP Surface — Tools · Resources · Prompts
Configuration — HTTP & Auth · File Size Limits · Access Control · Output & Inline Limits · Tasks · Logging & Diagnostics · Performance
Related MCP server: mcp-llm
Overview
A secure, production-ready Model Context Protocol server that gives AI assistants controlled access to the local filesystem. All operations are sandboxed to explicitly allowed directories with path traversal prevention, sensitive file blocking, and optional Bearer token authentication.
Supports stdio (default) and Node Streamable HTTP transport. HTTP sessions are implemented with isolated per-session server state. The HTTP transport is stateful by default and currently non-resumable; it does not persist an event store for Last-Event-ID replay.
Key Features
18 filesystem tools — read, write, search, diff, patch, hash, and bulk operations with structured output schemas
Security-first — path validation, symlink escape prevention, sensitive file denylist, localhost-only CORS, Host header validation for loopback HTTP binds, optional API key auth
Dual transport — stdio for local use, Node Streamable HTTP for networked/multi-session deployments
Structured output — all tools return typed
outputSchema/structuredContentfor reliable LLM parsingSelf-documenting — 6 built-in resources (
internal://instructions,internal://tool-catalog, etc.) and 4 built-in prompts (get-help,compare-files,analyze-path,get-tool-help)
Requirements
Node.js >= 24
Quick Start
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Docker
docker run -i --rm -v /path/to/project:/workspace:ro ghcr.io/j0hanz/filesystem-mcp /workspaceOr using Docker Compose:
services:
filesystem-mcp:
build: .
stdin_open: true
volumes:
- ./:/projects/workspace:ro
command: ['/projects/workspace']CLI Usage
filesystem-mcp [options] [allowedDirs...]
Arguments:
allowedDirs Directories the server can access
Options:
--allow-cwd Allow the current working directory as an additional root
--port <number> Enable HTTP transport on the given port
-v, --version Display server version
-h, --help Display help
Examples:
$ npx @j0hanz/filesystem-mcp@latest /path/to/project
$ npx @j0hanz/filesystem-mcp@latest --allow-cwd
$ npx @j0hanz/filesystem-mcp@latest --port 3000 /path/to/projectClient Configuration
Add to .vscode/mcp.json:
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Or install via CLI:
code --add-mcp '{"name":"filesystem","command":"npx","args":["-y","@j0hanz/filesystem-mcp@latest"]}'Add to .vscode/mcp.json:
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Or install via CLI:
code-insiders --add-mcp '{"name":"filesystem","command":"npx","args":["-y","@j0hanz/filesystem-mcp@latest"]}'Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Add to <SOLUTIONDIR>.mcp.json or %USERPROFILE%\.mcp.json:
{
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Add to ~/.config/goose/config.yaml:
extensions:
filesystem:
name: Filesystem MCP
cmd: npx
args:
- -y
- '@j0hanz/filesystem-mcp@latest'
enabled: true
type: stdio{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Add to claude_desktop_config.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}claude mcp add filesystem-mcp -- npx -y @j0hanz/filesystem-mcp@latestOr add a project-scoped .mcp.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}amp mcp add filesystem-mcp -- npx -y @j0hanz/filesystem-mcp@latestOr add to settings.json:
{
"amp.mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Add to cline_mcp_settings.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}codex mcp add filesystem -- npx -y @j0hanz/filesystem-mcp@latestOr add to ~/.codex/config.toml (or .codex/config.toml in a trusted project):
[mcp_servers.filesystem]
command = "npx"
args = ["-y", "@j0hanz/filesystem-mcp@latest"]Add this JSON in your repository's GitHub Copilot coding agent MCP configuration:
{
"mcpServers": {
"filesystem": {
"type": "local",
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"],
"tools": ["*"]
}
}
}{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Add to .kiro/settings/mcp.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Add to ~/.gemini/settings.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Add to ~/.config/zed/settings.json:
{
"context_servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"],
"env": {}
}
}
}Add to VS Code settings.json under augment.advanced:
{
"augment.advanced": {
"mcpServers": [
{
"id": "filesystem",
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
]
}
}{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@j0hanz/filesystem-mcp@latest"]
}
}
}Use Cases
Explore and Understand a Codebase
Discover project structure and navigate unfamiliar repositories. Start with roots to see allowed directories, use tree for an overview, find to locate files by pattern, and read or read_many to inspect contents.
Relevant tools: roots, ls, find, tree, read, read_many, stat
Search Across Files
Locate specific code patterns, function definitions, or configuration values across a project. Use grep for content search with regex support and find for file name matching.
Edit and Refactor Code
Make precise, targeted edits to source files. Use edit for surgical replacements with dry-run preview, or search_and_replace for bulk changes across multiple files matching a glob pattern.
Relevant tools: edit, search_and_replace, write
Diff and Patch Workflow
Compare file versions and apply patches. Generate a unified diff with diff_files, preview with apply_patch(dryRun: true), then apply. Supports both single-file and multi-file patches (best-effort per file with per-file results[]).
Relevant tools: diff_files, apply_patch
File Management
Create directories, move/rename files, delete files, and verify file integrity via SHA-256 hashing.
Relevant tools: mkdir, mv, rm, calculate_hash, write
Architecture
[MCP Client]
|
| Transport: stdio (default) or Node Streamable HTTP (--port)
v
[MCP Server: filesystem-mcp]
| Entry: src/index.ts -> src/server/bootstrap.ts
|
+-- initialize / initialized
|
+-- tools/call ──────────────────────────────────────────
| +-- [roots] — List allowed workspace roots
| +-- [ls] — List directory contents
| +-- [find] — Find files by glob
| +-- [tree] — Render directory tree
| +-- [read] — Read file contents
| +-- [read_many] — Read multiple files
| +-- [stat] — Get file metadata
| +-- [stat_many] — Get multiple file metadata
| +-- [grep] — Search file contents
| +-- [mkdir] — Create directory
| +-- [write] — Write file
| +-- [edit] — Edit file (string replacements)
| +-- [mv] — Move/rename file
| +-- [rm] — Delete file
| +-- [calculate_hash] — SHA-256 hash
| +-- [diff_files] — Unified diff
| +-- [apply_patch] — Apply unified patch
| +-- [search_and_replace]— Bulk search & replace
|
+-- resources/read ──────────────────────────────────────
| +-- internal://instructions
| +-- internal://tool-catalog
| +-- internal://workflows
| +-- internal://tool-info/{name}
| +-- filesystem-mcp://result/{id}
| +-- filesystem-mcp://metrics
|
+-- prompts/get ─────────────────────────────────────────
| +-- get-help (optional topic argument)
| +-- compare-files (original, modified)
| +-- analyze-path (path)
| +-- get-tool-help (name)
|
+-- Capabilities: logging, resources, tools, prompts, completions, tasksRequest Lifecycle
[Client] -- initialize {protocolVersion, capabilities} --> [Server]
[Server] -- {protocolVersion, capabilities, serverInfo} --> [Client]
[Client] -- notifications/initialized --> [Server]
[Client] -- tools/call {name, arguments} --> [Server]
[Server] -- validate(inputSchema) --> [Handler]
[Handler] -- {content: [{type, text}], structuredContent?, isError?} --> [Client]MCP Surface
Tools
roots · ls · find · tree · read · read_many · stat · stat_many · grep · mkdir · write · edit · mv · rm · calculate_hash · diff_files · apply_patch · search_and_replace
roots
List allowed workspace roots. Call first — all other tools are scoped to these directories.
No parameters.
ls
List immediate directory contents: name, path, type, size, modified date.
Parameter | Type | Required | Description |
| string | no | Base directory (default: root) |
| boolean | no | Include dotfiles. Default: |
| boolean | no | Include ignored items (node_modules, .git). Default: |
| integer | no | Max recursion depth (1-50) when pattern is provided |
| integer | no | Max entries before truncation. Default: 20000, Max: 20000 |
| enum | no |
|
| string | no | Relative glob filter (e.g. |
| boolean | no | Resolve symlink targets. Default: |
| string | no | Pagination cursor from a previous response |
find
Find files by glob pattern. Returns matching files with metadata.
Parameter | Type | Required | Description |
| string | no | Base directory (default: root) |
| string | yes | Relative glob pattern (e.g. |
| integer | no | Max results (1-10000). Default: 100 |
| boolean | no | Include ignored items. Default: |
| boolean | no | Include dotfiles. Default: |
| enum | no |
|
| integer | no | Max directory depth (0-100) |
| string | no | Pagination cursor |
tree
Render a directory tree with bounded recursion. Returns ASCII tree + structured JSON.
Parameter | Type | Required | Description |
| string | no | Base directory (default: root) |
| integer | no | Depth (0 = root node only). Default: 5, Max: 50 |
| integer | no | Max entries. Default: 1000, Max: 20000 |
| boolean | no | Include dotfiles. Default: |
| boolean | no | Include ignored items. Default: |
| boolean | no | Include file sizes in tree entries. Default: |
read
Read text file contents. Use head/tail to preview first/last N lines of large files.
Parameter | Type | Required | Description |
| string | yes | Absolute path to file |
| integer | no | Read first N lines (1-100000) |
| integer | no | Read last N lines (1-100000) |
| integer | no | Start line (1-based, inclusive) |
| integer | no | End line (1-based, inclusive). Requires |
| boolean | no | Include SHA-256 hash of full file content. Default: |
read_many
Read multiple text files in one request.
Parameter | Type | Required | Description |
| string[] | yes | Files to read (1-100 paths) |
| integer | no | Read first N lines of each file |
| integer | no | Read last N lines of each file |
| integer | no | Start line (1-based) per file |
| integer | no | End line (1-based) per file |
stat
Get file/directory metadata: size, modified, permissions, mime, tokenEstimate.
Parameter | Type | Required | Description |
| string | yes | Absolute path to file or directory |
stat_many
Get metadata for multiple files/directories in one request.
Parameter | Type | Required | Description |
| string[] | yes | File/directory paths (1-100) |
grep
Search file contents (grep-like). Returns matching lines with optional context.
Parameter | Type | Required | Description |
| string | no | Base directory (default: root) |
| string | yes | Search text or RE2 regex when |
| boolean | no | Treat pattern as RE2 regex. Default: |
| boolean | no | Case-sensitive matching. Default: |
| boolean | no | Match whole words only. Default: |
| integer | no | Lines of context before/after (0-50). Default: 0 |
| integer | no | Max match rows (0-10000). Default: 500 |
| string | no | Relative glob for candidate files (e.g. |
| boolean | no | Include dotfiles. Default: |
| boolean | no | Include ignored items. Default: |
mkdir
Create a new directory (recursive). Idempotent.
Parameter | Type | Required | Description |
| string | no | Absolute path to directory to create |
| string[] | no | Multiple directories to create. Either |
write
Write content to a file, overwriting all existing content. Creates parent directories if needed.
Parameter | Type | Required | Description |
| string | yes | Absolute path to file |
| string | yes | Content to write |
edit
Apply sequential literal string replacements (first occurrence per edit). Use dryRun to preview.
Parameter | Type | Required | Description |
| string | yes | Absolute path to file |
| array | yes | List of non-empty |
| boolean | no | Preview edits without writing. Default: |
| boolean | no | Treat whitespace sequences as equivalent. Default: |
mv
Move or rename a file or directory.
Parameter | Type | Required | Description |
| string | no | Single path to move (deprecated: use |
| string[] | no | Paths to move. Either |
| string | yes | Destination path |
rm
Permanently delete a file or directory. Irreversible.
Parameter | Type | Required | Description |
| string | yes | Absolute path to file or directory |
| boolean | no | Delete non-empty directories. Default: |
| boolean | no | No error if missing. Default: |
calculate_hash
Calculate SHA-256 hash of a file or directory.
Parameter | Type | Required | Description |
| string | yes | Absolute path to file or directory |
diff_files
Generate a unified diff between two files. Output feeds directly into apply_patch.
Parameter | Type | Required | Description |
| string | yes | Path to original file |
| string | yes | Path to modified file |
| integer | no | Lines of context in diff output |
| boolean | no | Ignore leading/trailing whitespace. Default: |
| boolean | no | Strip trailing carriage returns. Default: |
apply_patch
Apply a unified diff patch to one or more files. Single-file: throws on failure. Multi-file: best-effort per file with results[]. Workflow: diff_files -> apply_patch(dryRun) -> apply_patch.
Parameter | Type | Required | Description |
| string | yes | Path to file (single) or base directory (multi-file patch) |
| string | yes | Unified diff with |
| integer | no | Max fuzzy mismatches per hunk (0-20) |
| boolean | no | Auto-convert line endings. Default: |
| boolean | no | Validate without writing. Default: |
search_and_replace
Bulk search-and-replace across files matching a glob. Replaces all occurrences per file. Always dryRun: true first.
Parameter | Type | Required | Description |
| string | no | Base directory (default: root) |
| string | no | Relative glob pattern (e.g. |
| string | yes | Text to search. RE2 regex when |
| string | yes | Replacement text. Supports |
| boolean | no | Treat as RE2 regex. Default: |
| boolean | no | Preview matches with diff. Default: |
| boolean | no | Include dotfiles. Default: |
| boolean | no | Include ignored items. Default: |
| boolean | no | Return diff even when not dry-run. Default: |
| integer | no | Max files to process before stopping (1-10000) |
| boolean | no | Case-sensitive matching. Default: |
Resources
Resource | URI | MIME Type | Description |
Instructions |
| text/markdown | Comprehensive usage rules and guidelines |
Tool Catalog |
| text/markdown | Tool selection guide and data flow map |
Workflows |
| text/markdown | Standard operating procedures for exploration, search, edit, patch |
Tool Info |
| text/markdown | Per-tool contract details, nuances, gotchas |
Result Cache |
| text/plain | Ephemeral cached tool output (large results externalized here) |
Metrics |
| application/json | Live per-tool call/error/avgDurationMs snapshot |
Prompts
Prompt | Arguments | Description |
|
| Return usage instructions. Optionally filter by section heading prefix |
|
| Generate a workflow for comparing two files using |
|
| Generate a workflow for analyzing a file or directory |
|
| Return a prompt with the authoritative contract for a specific tool |
MCP Capabilities
Capability | Status | Evidence |
| confirmed |
|
| confirmed |
|
| confirmed |
|
| confirmed |
|
| confirmed |
|
| confirmed |
|
Tool Annotations
Annotation | Tools | Value |
|
| Read-only, idempotent, non-destructive |
|
| Destructive writes, not idempotent |
|
| Idempotent write, non-destructive |
Structured Output
All 18 tools define outputSchema (Zod -> JSON Schema) and return structuredContent alongside text content. Set FS_CONTEXT_STRIP_STRUCTURED=true to strip output schemas from tool definitions (reduces token usage for LLMs that don't use structured output).
Configuration
HTTP & Auth
Variable | Default | Description |
| (none) | Bearer token required when binding HTTP to a non-loopback host |
|
| Max concurrent HTTP sessions (1-10,000) |
|
| HTTP server bind address |
|
| Max HTTP request body size (1 KB - 256 MB) |
File Size Limits
Variable | Default | Description |
|
| Max file size for text read operations (1 MB - 100 MB) |
|
| Max file size for content search/grep (100 KB - 10 MB) |
|
| Max cumulative size for |
|
| Search operation timeout in ms (100 - 60,000) |
Access Control
Variable | Default | Description |
|
| Allow reading sensitive files (.env, .key, credentials, tokens) |
| (none) | CSV/newline-separated glob patterns to block (in addition to built-in denylist) |
| (none) | CSV/newline-separated glob patterns to permit (overrides denylist) |
Output & Inline Limits
Variable | Default | Description |
|
| Max inline result chars before externalizing to |
|
| Max inline search matches before truncation |
|
| Strip |
Tasks
Variable | Default | Description |
|
| Max task TTL before auto-eviction (1 s - 24 hr) |
|
| Max simultaneous task executions (1-10,000) |
Logging & Diagnostics
Variable | Default | Description |
|
| MCP log level: debug, info, notice, warning, error, critical, alert, emergency |
|
| Enable diagnostic logging |
|
| Enable detailed diagnostic output |
|
| Log tool errors to stderr |
|
| Debug logging for search worker pool |
Performance
Variable | Default | Description |
| CPU cores (≤ 8) | Concurrent search worker threads (1-16) |
|
| Cursor TTL for |
HTTP Endpoints
When started with --port <number>, the server exposes a single MCP endpoint:
Method | Path | Purpose |
|
| Initialize session or send requests (Streamable HTTP) |
|
| HTTP streaming session endpoint |
|
| Terminate a session |
Required headers:
mcp-protocol-version— use the negotiated MCP protocol version on post-initialize HTTP requestsmcp-session-id— required forGET/DELETE(returned byPOSTon initialize)
Authentication: Requests to non-loopback HTTP binds require FILESYSTEM_MCP_API_KEY; clients must then send Authorization: Bearer <key>. Loopback-only binds may omit auth for local use. Uses SHA-256 timing-safe comparison.
CORS: Only localhost origins allowed (127.0.0.1, ::1, localhost).
Host validation: Loopback HTTP binds validate the Host header (localhost, 127.0.0.1, [::1]) to reduce DNS rebinding risk. Non-loopback binds still require FILESYSTEM_MCP_API_KEY.
Security
Control | Status | Evidence |
Path sandboxing | confirmed |
|
Traversal prevention | confirmed |
|
Symlink escape prevention | confirmed |
|
Sensitive file denylist | confirmed |
|
Origin validation | confirmed |
|
Bearer auth | confirmed |
|
Input validation | confirmed |
|
Request body limit | confirmed |
|
Remote bind guard | confirmed |
|
Development
dev—tsc --watch --preserveWatchOutput— Watch mode TypeScript compilationdev:run—node --env-file=.env --watch dist/index.js— Run server with auto-reloadstart—node dist/index.js— Run production serverbuild—node scripts/tasks.mjs build— Clean buildtest—node scripts/tasks.mjs test— Build + run all teststest:fast—node --test --import tsx/esm src/__tests__/**/*.test.ts node-tests/**/*.test.ts— Run tests without buildlint—eslint .— Lint sourcetype-check—node scripts/tasks.mjs type-check— Type-check src + testsformat—prettier --write .— Format codeinspector—npm run build && npx -y @modelcontextprotocol/inspector node dist/index.js ${workspaceFolder}— Launch MCP Inspector
Build and Release
CI:
.github/workflows/release.yml— runs lint, type-check, test, build before tagging/publishing.Docker: Multi-stage build with
node:24-alpine. Builder compiles TypeScript + native modules (re2); release stage runs as non-rootmcpuser.npm:
npm run prepublishOnlyruns lint + type-check + build.
Troubleshooting
"No allowed directories" — Pass at least one directory argument or use
--allow-cwd.Sensitive file blocked — Files matching the denylist (
.env*,.git, SSH keys) are blocked by design. Checksrc/lib/constants.tsfor the full list.Large result externalized — When tool output exceeds inline limits, it's cached as a resource at
filesystem-mcp://result/{id}. Read the resource URI to get the full content.Stdio: logs on stdout — Keep logs on stderr only. The server uses
console.errorfor diagnostics.HTTP 413 — Request body exceeds
FS_CONTEXT_MAX_REQUEST_BYTES. Increase the limit or reduce payload size.HTTP 401 —
FILESYSTEM_MCP_API_KEYis set but the request is missing or has an incorrectAuthorization: Bearerheader.
Credits
Dependency | Description |
MCP server SDK package | |
MCP client SDK package | |
Node transport package for MCP runtime | |
CLI argument parsing | |
Unified diff generation and patch application | |
| |
Safe RE2 regex engine (no ReDoS) | |
Schema validation and JSON Schema generation |
License
MIT License. See LICENSE for details.
Available Tools
14 toolscreateCreate FilesADestructive
Write whole text files (new, overwrite, or append) and create empty directories, with missing parents. Use when you have full content or need folders. Do not use it for partial edits; use edit, replace_text, or patch instead, and move to copy or rename. Whole-file writes are atomic (temp file, then rename); appends are not. An existing file is replaced only with overwrite: true or after one user confirmation for the batch; nothing is written before the answer. Declined entries fail with CANCELLED; skipped ones land in skipped. Entries fail alone; the call errors only when all fail. Returns files (path, size, lineCount, mimeType, kind, resourceUri, created, modified), directories, failures, skipped, and an undo id for undo (30 min), or undoUnavailable.
Inputs: files, directories.
deleteDelete PathsADestructive
Delete files, directories, and symlinks. Use when a path should no longer exist. Do not use it to rename or relocate; use move instead, and undo to restore. A symlink is removed, never its target. A non-empty directory needs recursive: true; without it, that path fails INVALID_INPUT. With it, the user must confirm. Nothing is deleted until every prompt is answered. A client that cannot prompt fails the whole call INVALID_INPUT. Deleting a folder that holds protected files cannot be undone. Other failures hit only their own path: ACCESS_DENIED for a root, read-only, or outside path; CANCELLED when refused or changed; INVALID_INPUT for a nested pair. Returns per-path { deleted } or { error } (a skipped prompt gives deleted: false), a summary, and an undo id valid 30 minutes, or undoUnavailable with the reason.
Inputs: paths (required), recursive, ignoreIfNotExists.
diffDiffARead-onlyIdempotent
Compare two text files and return a unified diff from a to b. Use when you need line differences between two files on disk. Do not use it to find text across files; use search_text instead. To preview your own pending change, use the dryRun option of the write tools. Binary and non-UTF-8 files fail. A file over the size limit fails with TOO_LARGE. So does a diff not done within 1 s, or a full diff queue; retry once, then read matching line ranges. Returns ---/+++ headers (basenames) and @@ hunks; identical files give headers only.
Inputs: a (required), b (required), context.
editEdit FilesADestructive
Replace exact, unique text snippets in up to 5 existing text files. Use when you know the exact text to change. Do not use it for every match of a pattern; use replace_text instead. To apply a unified diff, use patch; for a new file or a whole rewrite, use create. Each file is all or nothing: an unmatched or ambiguous oldText writes nothing to that file, and other files still run; dryRun reports unmatched text instead of failing. An oldText with no exact match is retried ignoring indentation and spacing and applied only if that matches once; the summary says so. Missing, binary, non-UTF-8, and over-size-cap (default 10 MiB) files fail. Returns one summary line per file (+added -removed, NO MATCH, or FAILED); a dry run or returnDiff appends unified diffs. With undo enabled, live runs add an undo id for undo, valid 30 minutes.
Inputs: path, edits, files, dryRun, +2 more.
find_filesFind FilesARead-onlyIdempotent
Find files whose name or path matches a glob under a directory. Use when you know a name or path pattern but not the location. Do not use it for file contents; use search_text instead. To browse a folder, use list. Matches files; type: "directory" or "any" also matches directories. Skips hidden entries, .gitignore matches, and build folders unless includeHidden or includeIgnored. Scanning stops at 10,000 matches (stoppedReason maxResults) or the time limit (FS_TOOL_TIMEOUT_MS, default 5 s; stoppedReason timeout) and still returns what it found. path must be an existing directory; a file path is rejected. maxResults sizes a page, not the scan; page on with nextCursor. Returns root, results[{ path }], totalMatches, and filesScanned. When set, it adds nextCursor, stoppedReason, skippedInaccessible, excludedDirs (total and first 5), and resourceUri (all kept matches). Paths are relative to root when unambiguous, otherwise absolute.
Inputs: pattern (required), path, type, cursor, +6 more.
listListARead-onlyIdempotent
List a directory inside the roots as a name tree, walking up to maxDepth levels. Use when you need to see what a folder holds. Do not use it to find files by name or glob; use find_files instead, read or search_text for contents, stat for one path. Skips hidden entries, .gitignore matches, and build and tool folders unless includeHidden or includeIgnored is set, naming the ignore-rule folders it hid. At most 20,000 entries are kept. A timeout returns a partial result with stoppedReason. Errors: NOT_DIRECTORY for a file, ACCESS_DENIED outside the roots. Returns tree text, entries[{name, relativePath, type, size?}], totals, unexpandedDirectories, and skippedInaccessible. A cut result adds nextCursor (about 5 min) and resourceUri (about 60 s).
Inputs: path, cursor, sortBy, exclude, +5 more.
list_rootsWorkspace RootsARead-onlyIdempotent
List roots this server can access and its read-only directories. Use for allowed paths or after ACCESS_DENIED. Do not use it to browse; use list, find_files, or stat instead. Accepted grants add roots; call again after one. Outside paths prompt a grant only on elicitation clients, never for home, system paths, or anything outside FS_ROOT_BOUNDARY. Returns absolute { roots, readOnlyDirs (writes, moves, deletes refused), hint? when roots is empty }.
Inputs: no named parameters.
moveMove or Copy FilesADestructive
Move, rename, or copy files and directories inside the roots. Use when you need to rename, relocate, or duplicate (copy: true). Do not use to change contents (edit, patch) or remove paths (delete). Missing parents are created. An existing destination asks to confirm; declining cancels the call, skipping drops that pair. Only copies can bypass the prompt (overwrite: true). A directory move never merges into a non-empty directory; a copy merges. Pairs that share a destination or overlap another pair fail; run dependent moves separately. Returns a summary line per pair and failure, plus moves[{ from, to }], failures?, skipped?, and an undo id for undo (30 minutes) or undoUnavailable. The call is an error only if every pair failed.
Inputs: moves (required), copy, overwrite.
patchPatchADestructive
Apply a single-file unified diff to one existing UTF-8 text file. Use when you hold a unified diff. Do not use it for one exact snippet; use edit instead. For pattern matches use replace_text; for new files, create. All or nothing: if any hunk mismatches its context, nothing is written; INVALID_INPUT usually names it. Header line numbers may be off. A diff of context lines only writes nothing and records no undo. File lines x diff lines over 10,000,000 fails with TOO_LARGE. Returns path, linesAdded, linesRemoved, size, lineCount, mimeType, kind, modified, resourceUri when linkable, and an undo id for undo (30 minutes) or undoUnavailable; dryRun adds the resulting diff.
Inputs: diff (required), path (required), dryRun.
readRead FileARead-onlyIdempotent
Read one file or up to 1000, whole or as a line slice. Use when you know the path. Do not use it to check size or existence; use stat instead. To locate content, use search_text, find_files, or list. Only whole reads return images and audio as media; other binary files fail with BINARY_FILE unless binary: true. Pick one slice (head, tail, or startLine/endLine); it applies to every batch file. Past the size limit: a single-path whole read returns its first 2000 lines (up to 256 KiB) with continuation args; a head or range is truncated; a batch file fails TOO_LARGE. UTF-16 text with a byte-order mark is returned decoded, with encoding set; past the size limit it fails TOO_LARGE in every mode. Non-UTF-8 text is returned with U+FFFD and lossy: true. A batch shares a 512 KiB budget: an overflowing file is skipped and later files still read. isError means every path failed. Returns text plus per-path results[]: an error, or linesRead, hasMoreLines, continuation args, modified, optional contentHash. Full reads add totalLines; a tail gets no continuation.
Inputs: head, path, tail, paths, +5 more.
replace_textSearch and ReplaceADestructive
Replace every match of literal text or an RE2 regex in one file or across a directory tree. Use when the same change must land at every occurrence. Do not use it for one unique snippet; use edit instead, patch for a unified diff, or search_text to only find matches. A live run rewrites each file as the scan reaches it; one failed file does not stop the others. Reaching maxMatches (default 100), maxFiles, or the deadline stops the run; files already rewritten stay changed. Returns changed paths, failures, skip counts, stoppedReason, and an undo id (live runs, when undo is enabled) for undo, valid 30 minutes. isError is set when every file failed or the request is invalid (bad regex, path outside roots).
Inputs: replacement (required), searchPattern (required), path, dryRun, +11 more.
search_textSearch ContentARead-onlyIdempotent
Search file contents under the roots for literal text or an RE2 regex. Use when you need the files and lines that contain some text. Do not use it to find files by name; use find_files instead. A regex may span lines; the hit is on its first line. Skips hidden entries, .gitignore matches, and build folders unless includeHidden or includeIgnored. Lines over 1000 chars are clipped around the match. Stops early at 10000 matching lines or the timeout, setting stoppedReason. Returns root, file:line: text rows (a named file prints its path once), matches with column and context, totals, and skip counts. A multi-page or stopped first page also returns nextCursor, valid about 5 min after its last page, and resourceUri, valid about 60 s.
Inputs: searchPattern (required), path, cursor, context, +8 more.
statGet File InfoARead-onlyIdempotent
Get metadata for files or directories. Use when you need to check existence, size, or read cost. Do not use for contents; use read instead, list for directory entries, or find_files to find by name. Pass path or paths (up to 1000). Paths settle independently (missing gives NOT_FOUND); the call errors only if all fail. Symlinks report their own metadata, not the target's. path gives one result; paths gives one per path, in input order. Returns per-path values or errors ({ code, message }), plus summary { total, succeeded, failed }. Values hold name, path, type, size or entryCount (directories), tokenEstimate (files, bytes/4), lineCount (text files up to 256 KiB, in calls of up to 20 paths), timestamps, permissions (POSIX) or readOnly (Windows), isHidden (dot prefix), hardLinks (a file with other names; a write changes them all), mimeType, symlinkTarget.
Inputs: path, paths.
undoUndoADestructive
Revert create, edit, replace_text, patch, move, or delete calls by undo id or the newest N calls. Use when a change made by this server must be reverted. Do not use for outside changes or expired ids; rewrite those with edit or create. Preview with dryRun, which lists ids. A path changed since that call is skipped while the rest revert; it stays under its id for a retry. The in-memory journal keeps up to 64 calls for 30 minutes, fewer when FS_MAX_UNDO_BYTES fills. No redo. Unknown ids fail NOT_FOUND. Returns steps[] of {id, tool, results[]}, each path restored or with an error code. A long list is cut (failures kept), marked truncated with totalResults. Errors only if every path fails.
Inputs: id, steps, dryRun.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool targets a distinct filesystem operation, and descriptions explicitly resolve overlap with 'Do not use X; use Y' guidance (e.g. edit vs replace_text vs patch, find_files vs list vs search_text). An agent can reliably select the right tool for a given task.
All names are snake_case and action-oriented, but the set mixes bare verbs (read, create, delete, move) with verb_noun compounds (find_files, search_text, list_roots). The pattern is mostly predictable and readable, with only minor convention deviation.
Fourteen tools is well within the ideal range for a filesystem server. Each tool covers a meaningful, non-redundant operation, from discovery and reading to mutation and undo.
The surface covers full lifecycle operations: discovery (find_files, list, search_text), inspection (read, stat, diff), creation and mutation (create, edit, replace_text, patch, move), deletion, and reversible changes via undo. It also includes root discovery, making the set feel complete for typical filesystem work.
Maintenance
Related MCP Connectors
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
An MCP server that provides agents access to the KeldynAI platform
Related MCP Servers
- FlicenseAqualityBmaintenanceNode.js server implementing Model Context Protocol (MCP) for filesystem operations.70141,143,812 npm92,301-
- AlicenseBqualityDmaintenanceAn MCP server that provides LLMs access to other LLMs436 npm83MIT
- -licenseNot gradedqualityNot gradedmaintenanceA Filesystem MCP server that allows an LLM to read and list files from a specified directory on your local machine through the Model Context Protocol.2-
- FlicenseNot gradedqualityDmaintenanceMCP server providing filesystem operations, shell execution, and web search capabilities.17 PyPI-