
Filesystem Context
io.github.j0hanz由 GitHub 帳號 j0hanz 發布v1.0.9更新於 Oct 24, 2026
🔍 Read-only MCP server for secure filesystem exploration, searching, and analysis
概覽
一個在本機執行的 MCP 伺服器,讓 AI 助理在你明確允許的資料夾內進行受限的讀取、搜尋、比對與編輯。
- 可以做什麼
- Filesystem Context 在你的電腦上執行,提供 13 個檔案工具:以樹狀列出資料夾、依名稱或 glob 尋找檔案、用字面文字或 RE2 正規表達式像 grep 一樣搜尋檔案內容、用 stat 取得大小與 token 估算、整份或依行範圍讀取一或多個檔案、比對兩個檔案的 unified diff,以及建立、編輯、套用 patch、跨檔案取代文字、移動、複製與刪除檔案。搜尋與列目錄預設會略過隱藏檔案、.gitignore 中的檔案與相依套件目錄。--read-only 參數會移除所有寫入類工具。
- 適用情境
- 適合讓助理在特定專案或文件資料夾內工作:尋找 TODO、跨檔案重新命名符號、比對設定檔、讀取日誌尾端或整理檔案。當你希望檔案存取僅限於選定的目錄,並希望寫入可先預覽或被禁止時,它很合適。
- 執行需求
- 需要 Node.js 24 或更新版本,透過 npx 或全域安裝 npm 套件 @j0hanz/filesystem-context-mcp 執行;也支援 Docker。必須把一個或多個允許的資料夾路徑當作參數傳入。預設使用 stdio,也可用 --port 啟用 Streamable HTTP。未宣告帳號、API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Filesystem Context,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Filesystem MCP
Let your AI assistant work with your files, safely.
Read, search, edit, and patch files in the folders you choose.
Secret files stay hidden, and risky changes wait for your OK.
[npm version] [CI] [License: MIT] [GitHub stars] [HOL Trust] [Filesystem MCP security badge] [Filesystem MCP status badge]
[Install in VS Code] [Install in VS Code Insiders] [Install in Visual Studio] [Install in Cursor] [Install in Claude Desktop]
[filesystem-mcp MCP server – quality and maintenance score on Glama]
What is this?
Model Context Protocol (MCP) is how AI apps such as Claude, GitHub Copilot in VS Code, and Cursor connect to tools. Filesystem MCP is an MCP server: a small program that runs on your computer and gives the AI 14 tools for working with files. You choose which folders it can use, and everything outside them is off limits.
Once it is connected, you can ask things like:
- "Find every TODO in this repo and group them by file."
- "Rename
getUsertofetchUserin all.tsfiles. Show me the diff first." - "What changed between
config.dev.jsonandconfig.prod.json?" - "Read the last 50 lines of
server.logand explain the error." - "Move the old screenshots into
archive/2025/."
Why Filesystem MCP?
- It is safe by default. The AI can use only the folders you allow, and
.envfiles, private keys, and cloud credentials are blocked. The server asks you before the AI deletes a non-empty folder, opens a folder you did not allow, or writes over a file withcreateormove. Onlycreateand copies can skip that question, by passingoverwrite: true. Edits made withedit,patch, andreplace_textapply without asking, but the AI can show you the diff first withdryRun. If the AI should never change anything,--read-onlyremoves every tool that writes. - Search and editing are made for code. The AI can search inside files like
grep, with a regex engine (RE2) that cannot hang, and by default the server skips.gitignored files and folders likenode_modules. Edits are exact-match replacements that return an error when the text does not match, and you can preview them as a diff first. - It saves the AI's context. The AI can read many files in one call or only the lines it needs, and it can check a file's size and token estimate before reading it.
- It works with any MCP client, over stdio or HTTP, on macOS, Linux, and Windows. You can install it with npx, Docker, or a one-click Claude Desktop extension, or build your own client on it.
- It is private. It runs on your machine, has no telemetry, and makes no network calls.
Compared with the reference server
How this server differs from the official
@modelcontextprotocol/server-filesystem,
checked against its README on 2026-11-02:
Quick start
[!NOTE] You need Node.js 24 or later. Check with
node --version.
- Add the server to your AI app. Pick yours below.
- Replace
/path/to/projectwith the folder the AI may use. You can list several folders. - Restart the app and ask: "Which folders can you access?"
[!TIP] VS Code currently shares the folders you have open with the server, so the one-click VS Code install works without a path. In other apps, or over HTTP, put the folder in
args. If the AI says it has no folders, that is the fix.
VS Code
Click Install in VS Code above, or add this to .vscode/mcp.json:
Or from a terminal:
Cursor
Click Install in Cursor above, then add your folder to args. Or add this
to .cursor/mcp.json in your project, or ~/.cursor/mcp.json for all
projects:
Claude Desktop
For a one-click install, download
filesystem-mcp.mcpb,
open it with Claude Desktop, and pick the folders to allow. Claude Desktop's
built-in Node.js runs it. The extension's settings also let you turn on
read-only mode and block more files.
To set it up by hand, add this to claude_desktop_config.json
(Settings → Developer → Edit Config):
Claude Code
Or install the plugin, which points the server at your current project:
Visual Studio
Add this to .vs\mcp.json in your solution folder, or %USERPROFILE%\.mcp.json
for all solutions:
GitHub Copilot CLI and Antigravity CLI (plugin)
The filesystem-mcp plugin sets the server up for your current project:
Docker
The container can only see the folders you mount. This setup blocks writes
twice, with the :ro mount and with the --read-only flag.
Drop :ro and --read-only to let the AI make changes. VS Code and Visual
Studio use "servers" instead of "mcpServers". See
Running in Docker for more.
Other MCP clients
Windsurf, Cline, and most other clients use the same mcpServers JSON as
Claude Desktop above. In any client, the server is:
- command:
npx - args:
-y,@j0hanz/filesystem-mcp@latest, then one or more folders
You can also install it globally and run filesystem-mcp /path/to/project:
Tools
✎ changes files. --read-only removes these tools. To refuse changes under
one folder while the rest stay writable, pass --read-only-root <dir>
(repeatable, or FS_READ_ONLY_DIRS): those tools still exist, but a call
that writes, moves, or deletes under the folder fails with
Read-only root: ..., while listing, searching, and reading keep working.
Search and listing tools skip hidden files, .gitignored files, and folders
like node_modules, dist, and .git unless the AI asks for them.
Configuration
Most people only need the folder argument. These options cover the common cases:
Flags go in args after the package name, for example
["-y", "@j0hanz/filesystem-mcp@latest", "--read-only", "/path/to/project"].
The full configuration reference covers every flag and environment variable, the complete secret-file list, limits, HTTP setup with API keys, Docker, and troubleshooting.
Security
If you find a vulnerability, please report it privately. SECURITY.md explains how.
Build your own client
You can also call Filesystem MCP from your own code: an agent, an editor plugin, a web app, a CI job, or a script. The same rules apply as for an AI app, so your code cannot reach outside the allowed folders or read secret files.
The basics:
- Where the data is. The text block is written for a model. The same data
as JSON is in
_metafor tools that write their own text (list,search_text,edit, ...) and instructuredContentforstat,create, andlist_roots.readis the exception: the file's text is only in the text block, and_metaholds metadata about it. - Paths. A relative path resolves against the server's working directory when that is inside a root, and against the root otherwise. With several roots, it must exist under exactly one of them. Absolute paths are never ambiguous. Search results are printed relative to the root, so a result can be passed straight back. A name that differs from the one on disk only in Unicode form (NFC or NFD) or in its space characters (U+00A0, U+202F) finds that entry.
- Confirmations. Overwrites, recursive deletes, and paths outside the
roots are questions for the user. Declare the
elicitationcapability and answer them in a handler, or, on the 2026-07-28 protocol, take them as data (input_required) and answer later. - Protocol versions. The server speaks the 2025 protocol and 2026-07-28, over stdio and Streamable HTTP. Over HTTP, 2025-era clients get no confirmations or change notifications.
- Resources. Read and subscribe to any file as
filesystem-mcp://file/{+path};internal://instructionsand theget-helpprompt hold the server's guide for models.
The client guide has the details, tested with the
TypeScript and Python SDKs, and examples/ has six runnable
clients:
Privacy policy
Filesystem MCP runs entirely on your machine. This policy covers the npm
package, the Docker image, and the .mcpb desktop extension.
- Data collection: none. The server has no telemetry, analytics, or crash reporting, and makes no outbound network requests.
- Use and storage: the server reads and writes files only inside the folders you allow, and only when your MCP client calls a tool. Tool results go to that client and nowhere else. Short-lived result caches and the undo history (saved file contents) live in memory and disappear when the server exits.
- Third-party sharing: none by this server. Your MCP client may send tool results to its model provider under that client's own privacy policy.
- Retention: the server keeps nothing after the process exits. Diagnostic logs go to stderr on your machine; your MCP client may save them in its own log files.
- Contact: open an issue at https://github.com/j0hanz/filesystem-mcp/issues, or report security problems privately through GitHub Security Advisories.
Contributing
Bug reports, ideas, and pull requests are welcome. Start with CONTRIBUTING.md. It covers setup, running the server from source, and the checks a pull request needs.
If Filesystem MCP is useful to you, a star on GitHub helps other people find it.
License
來源:README.md,提交 de5eef7
工具
0版本歷史
1- v1.0.9最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分

