Feedback

Filesystem MCP — by j0hanz

@j0hanz Claim

Basic information

Runtime
TypeScript
Version
1.0.9
Category
License
MIT
Transports
stdio
Author
j0hanz
Submitted by
Community
Quality
20
Stars
32

About Filesystem MCP Server

Read-only MCP server for secure filesystem exploration, searching, and analysis

Filesystem MCP is a MCP server in the Developer Tools category listed in the AddMCP.net directory, published by j0hanz. It exposes 13 tools, including create, delete, diff, edit and more. Supported transport: stdio. Runtime: TypeScript. License: MIT. The repository has 32 GitHub stars. Source code is hosted on github.com. Related topics: ai-agents, claude, cursor, developer-tools, diff.

Setup

{
    "mcpServers": {
        "filesystem": {
            "command": "npx",
            "args": [
                "-y",
                "@j0hanz/filesystem-mcp@latest"
            ]
        }
    }
}

Filesystem MCP — by j0hanz config

Add this server to your MCP-compatible client using the configuration below.

{
    "mcpServers": {
        "filesystem": {
            "command": "npx",
            "args": [
                "-y",
                "@j0hanz/filesystem-mcp@latest"
            ]
        }
    }
}

Filesystem MCP — by j0hanz tools

  • create — Write whole text files: create new ones, overwrite, or append. Missing parent directories are created. edit or patch changes part of an existing file.
    files:array*
  • delete — Permanently delete files, directories, or symlinks, like rm or rm -r. Paths are exact; globs are not expanded.
    paths:array*, recursive:boolean, ignoreIfNotExists:boolean
  • diff — Compare two text files and return a unified diff from a to b, like diff -u.
    a:string*, b:string*, context:integer
  • edit — Edit text files in place by replacing exact oldText with newText, like str_replace. Each oldText must match exactly once, and a file is written only if all its edits match. replace_text replaces every occurrence across files.
    path:string, edits:array, files:array, dryRun:boolean, ignoreWhitespace:boolean
  • list — List a directory's files and subdirectories as a tree of names, like ls or tree. stat returns sizes and dates.
    path:string, maxDepth:integer, maxEntries:integer, includeHidden:boolean, includeIgnored:boolean, cursor:string
  • move — Move, rename, or copy files and directories, like mv or cp -r. Each destination is the full new path, not a folder to move into; missing parent directories are created.
    moves:array*, copy:boolean, overwrite:boolean
  • patch — Apply a single-file unified diff to one existing text file, like git apply. Nothing is written unless every hunk applies in file order with exactly matching context; hunks are found by their context, so start line numbers may be off.
    path:string*, diff:string*, dryRun:boolean
  • read — Read text files, like cat: whole, or one slice via head, tail, or startLine/endLine. Images and audio return as media; other binary files are rejected.
    includeHash:boolean, head:integer, tail:integer, startLine:integer, endLine:integer, path:string, paths:array
  • replace_text — Find and replace every occurrence of literal text or an RE2 regex, like sed -i, in one file or all files under a directory, optionally filtered by glob. The pattern runs over the whole file: it can span lines, and ^ and $ anchor to file start and end. edit replaces one unique exact match.
    path:string, pattern:string, searchPattern:string*, replacement:string*, isRegex:boolean, includeHidden:boolean, includeIgnored:boolean, caseSensitive:boolean, wholeWord:boolean, dryRun:boolean, returnDiff:boolean, maxResults:integer, …
  • list_roots — List the directories this server can access, as absolute paths, including any the user granted during this session. Other tools can ask the user to grant access to a path outside them.
    (no parameters)
  • search_text — Search file contents for literal text or an RE2 regex, like grep; returns matching lines with line numbers and paths relative to the searched directory. Patterns match within one line. find_files matches file names.
    path:string, pattern:string, searchPattern:string*, isRegex:boolean, includeHidden:boolean, includeIgnored:boolean, caseSensitive:boolean, maxResults:integer, context:integer, maxDepth:integer, cursor:string
  • find_files — Find files by name or glob pattern; returns file paths relative to the searched directory. A pattern without / matches file names at any depth. search_text searches contents.
    path:string, pattern:string*, maxResults:integer, includeIgnored:boolean, includeHidden:boolean, sortBy:string, maxDepth:integer, cursor:string
  • stat — Get metadata without reading contents, like ls -ld: type, size (a directory reports its own entry, not its contents), tokenEstimate, timestamps, permissions, MIME type guessed from the extension, and symlink target. Also checks whether paths exist.
    path:string, paths:array

Overview

What is Filesystem MCP?

What is it?

Filesystem MCP is a Model Context Protocol server that lets AI assistants read and write files within explicitly allowed directories. Sensitive file patterns (.env, .pem, id_rsa*) are blocked by default. It exposes filesystem tools, resources, and prompts over stdio or Streamable HTTP.

How to use it?

Run it with npx: npx -y @j0hanz/filesystem-mcp /path/to/allowed/dir (Node.js 24+). Pass allowed directories as arguments, use --allow-cwd for the current directory, or let the client supply roots. Add --read-only to remove every write tool, or --port 3000 to serve Streamable HTTP instead of stdio. A Docker image is published at ghcr.io/j0hanz/filesystem-mcp.

Key features:

Path guarding: every path is validated against allowed roots; .env, .pem and id_rsa* are denied by default Read and write tools: navigate, inspect, read, create, edit, move, delete RE2 regex search: linear-time matching, so no pattern can hang the server Unified diffs: compare two files with diff, apply changes with patch Bulk search-and-replace across files matching a glob Batch operations: most tools accept path, paths[] or files[] File subscriptions: resources push change notifications when watched files update Dual transport: stdio by default, Streamable HTTP with --port and optional API key --read-only mode removes every mutating tool

Use cases:

Giving coding agents safe read and write access to a project directory Searching large codebases with regex that cannot hang the server Reviewing and applying changes as unified diffs Refactoring text across many files with glob-scoped replace Serving a shared workspace to remote clients over authenticated HTTP

FAQ:

Q: Can it write files?

A: Yes. create, edit, move, delete, replace_text and patch write inside allowed roots. Start with --read-only to remove all of them.

Q: How are directories allowed?

A: Pass them as arguments, set FS_ALLOWED_DIRS, use --allow-cwd, or let the MCP client supply roots. --root-boundary limits which roots can be added.

Q: Which files are blocked?

A: .env, .pem, id_rsa* and similar patterns are denied by default. Add patterns with --deny, or exempt one with --allow.

Q: What transport does it use?

A: stdio by default. --port <n> starts Streamable HTTP, and --api-key requires a key on every request.

Q: What does it require?

A: Node.js 24 or later. Docker is optional (ghcr.io/j0hanz/filesystem-mcp).

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬