@abhishekmcp/files
v0.2.0
Published
MCP server for the local filesystem — read, search, edit, copy, archive, and safely manage files within sandboxed roots, from any MCP client.
Maintainers
Readme
@abhishekmcp/files
A robust, sandboxed filesystem MCP server. Gives any MCP client (Claude Desktop, Claude Code, Cursor, …) safe, capable access to files within directories you allow — read, search, edit, organize, archive — with a security-first design. Pure JavaScript, no native dependencies, no API keys.
Features
Read & navigate
read_file— read text with optionalhead/tailor a 1-based line window (pagination + truncation flag)read_media— read images/audio/binary as base64 (returned as an image/audio block when possible)read_multiple— batch-read several filesstat— metadata (type, size, timestamps, mode); does not follow a final symlinklist_dir— directory listing with type + size, sortable, paginatedtree— recursive directory tree (depth-capped)changed_since— files modified after a timestamp (poll-based change detection)list_roots— the allowed sandbox roots
Search
find_files— glob search (**/*.ts), excludesnode_modules/.gitby defaultsearch_content— content grep (substring or regex) with context lines; skips binaries
Integrity
file_hash— sha256/sha1/md5 checksumfind_duplicates— duplicate files by size then sha256list_archive— list a.zip's contents without extracting
Edit & write (token-efficient)
write_file— create/overwrite (atomic; no-clobber unlessoverwrite)edit_file— replace a uniqueoldTextwithnewText(refuses ambiguous matches);dryRunshows a unified diffedit_lines— replace a line range, optionally guarded by a content hash (expectedHash) to reject stale edits
Organize
create_dir,move,copy(recursive)delete— soft-delete to trash (recoverable),list_trash,restore,empty_trashzip/unzip— archives (zip-slip protected)
Every destructive tool supports dryRun to preview before committing.
Configuration
| Variable | Required | Effect |
|----------|----------|--------|
| FS_ROOTS | yes | Allowed root directories, comma-separated. The server refuses to start without it. |
| FS_READONLY | no | 1/true registers only read tools (safe sharing). |
| FS_ALLOW_SECRETS | no | 1/true disables the secret denylist (see below). |
| FS_AUDIT_LOG | no | Path to append a JSON-lines audit record of every mutation. |
| FS_OP_TIMEOUT_MS | no | Per-operation timeout (default 30000). |
| FS_MAX_CONCURRENCY | no | Max concurrent tool executions (default 8). |
Secret protection
By default the server blocks reads of, and hides from discovery, files that commonly hold secrets:
.env, *.pem, *.key, id_rsa*, .ssh/**, .aws/**, .npmrc, credentials, and more. Add your
own patterns in a per-root .mcpignore (gitignore syntax). Set FS_ALLOW_SECRETS=1 to disable.
Production hardening
Every mutation is timestamped to FS_AUDIT_LOG (if set) and stderr. All ops run under a concurrency
limit + per-op timeout. Reads stream (head reads and hashing never load whole files), and edits
preserve line endings (a CRLF file stays CRLF) and BOMs. The server ships with a committed
node:test suite (unit tests for the sandbox + integration/security tests) run in CI.
Security
The whole design is sandbox-first:
- Every path is confined to
FS_ROOTS, checked both lexically and viarealpath— a symlink inside a root that points outside is rejected (on reads and writes). - Writes/edits/deletes refuse to act through a symlink; writes are atomic (temp + rename).
unzipis zip-slip protected (entries can't escape the destination).- Size limits on reads, depth/result caps on tree/search/copy, control-char/
..rejection. - Deletes are soft (moved to
.mcp-trash) and restorable.
Usage
Claude Code — plugin
/plugin marketplace add Abhishekkumar2021/mcp-suite
/plugin install filesClaude Code — manual
claude mcp add files --env FS_ROOTS=$HOME/projects -- npx -y @abhishekmcp/filesClaude Desktop
{
"mcpServers": {
"files": {
"command": "npx",
"args": ["-y", "@abhishekmcp/files"],
"env": { "FS_ROOTS": "/absolute/path/to/allow" }
}
}
}License
MIT
