跳到主要内容Skip to main content
← MCP

Filesystem MCP ServerFilesystem MCP Server

Model Context Protocol
文件Files 本地Local 只读Read-only 读写Read and write verified lifecycle: active 核验Checked 2026-10-23

MCP 官方 reference server 里的文件操作实现。它是「白名单目录」式访问:必须显式声明允许目录,不允许静默访问全盘。

The file-operation implementation among MCP's official reference servers, requiring allowed directories to be declared explicitly, with no silent whole-disk access.

适合与不适合When to use it, when not to

让 Agent 在明确指定的目录内读写文本与媒体文件。需要目录边界清晰、 且不需要删除操作时。

不适合需要删除操作、需要跨目录聚合, 或需要任意路径访问的场景——本 server 的设计目标就是收紧这个边界。

Scenarios where an agent must read or write within explicitly declared directories.

Not a fit for open-ended exploration of the filesystem — allowed directories must be declared, there is no silent whole-disk access.

中文生态China availability 国产 / 国内可直接用 / 备案状态 · 快照domestic / direct access / CAC filing · snapshot 2026-10-20

出品属地Origin
国外出品foreign-made 国外主体(网信办公示名单未见对应备案主体)。foreign entity (no matching filing entity in the CAC registry).
国内使用Direct access
大陆可直连direct OK 官网仓库在 GitHub,大陆直连波动(同日实测 200/000 混合);npm / PyPI 安装源实测稳定可达。Hosted on GitHub — direct reachability from mainland fluctuates (200/000 mixed on the same day); npm / PyPI install routes measured stable.
备案状态CAC filing
未见于备案名单not in filing list:未见于网信办公示名单(2026-10-20 检索 13 批附件,https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm);该产品未面向大陆公众提供服务,备案不适用。not in the CAC public registry (13 batch attachments searched 2026-10-20, https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm); the product does not serve the mainland public, so filing does not apply.

备案信息以网信办《生成式人工智能服务已备案信息》公示名单为准(按批次滚动更新,本站只抄编号不解读);「大陆可直连」是本站从大陆网络直连实测的结果,不是厂商承诺。GitHub 类站点当日实测有波动,口径写在依据里。Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.

固定坐标系Fixed coordinate system

11 个维度dimensions, 与同分区其他对象逐项可比each comparable item by item against others in the same section.

模型与开放条件Model & openness

本身不调用模型,是被客户端调用的接口实现。

依赖 @modelcontextprotocol/sdk(npm 2026.8.31 实测 ^1.30.0); 协议版本在 initialize 握手时由 SDK 与客户端协商,不绑定单一版本。

It calls no model itself; it is an interface implementation called by clients. It depends on @modelcontextprotocol/sdk (npm measured 2026.8.31: ^1.30.0); the protocol version is negotiated between SDK and client at the initialize handshake, not pinned to a single version.

运行位置Where it runs

本地 Node.js 子进程,通过 stdio 与客户端通信。 生命周期绑定客户端进程,客户端退出即停止。

A local Node.js child process communicating with the client over stdio. Its lifecycle is bound to the client process — it stops when the client exits.

本地文件Local files

核心能力。默认不支持无限制访问: 必须通过命令行参数指定允许目录,或客户端支持 Roots 协议动态下发。 若无参数启动且客户端不支持 roots,server 在初始化阶段直接报错。

The core capability. Unrestricted access is not the default: allowed directories must be given via command-line arguments, or delivered dynamically if the client supports the Roots protocol. If started with no arguments and the client does not support roots, the server errors out directly at initialization.

关机后的任务Tasks after shutdown

不支持。本地 stdio 进程随客户端生死, 无独立守护或云端执行形态。

Not supported. A local stdio process lives and dies with the client; there is no standalone daemon or cloud-execution form.

工具与扩展Tools & extensions

提供 11 个工具:read_text_file、read_media_file、read_multiple_files、

write_file、edit_file、create_directory、list_directory、

list_directory_with_sizes、move_file、search_files、directory_tree。

输出为结构化内容,可直接消费。

It provides 11 tools: read_text_file, read_media_file, read_multiple_files,

write_file, edit_file, create_directory, list_directory,

list_directory_with_sizes, move_file, search_files, directory_tree. Output is structured content, ready for direct consumption.

上下文与记忆Context & memory

无状态。每次调用独立,不保留会话记忆。 list_allowed_directories 可查询当前生效目录。

Stateless. Each call is independent; no session memory is kept. list_allowed_directories can query the currently effective directories.

权限与限制Permissions & limits

无独立审批机制,权限边界完全由允许目录决定。 全部文件操作限制在允许目录内,越界会被拒绝。

注意:提供 write_file / edit_file / move_file / create_directory, 属可写但无删除工具的组合。

No separate approval mechanism; the permission boundary is defined entirely by the allowed directories. All file operations are confined to the allowed directories; anything outside is rejected.

Note: it provides write_file / edit_file / move_file / create_directory — a combination that is writable but has no delete tool.

适合什么任务Best for

让 Agent 安全读写指定目录内的文本与媒体文件。 不适合需要删除操作或需要跨目录聚合的场景。

Lets an Agent safely read and write text and media files inside specified directories. Not a fit for scenarios needing delete operations or cross-directory aggregation.

传输方式Transport

仅 stdio。本地 Node.js 进程,通过标准输入输出通信。

官方 README(2026-10-08 全文核验)只给两种本地启动方式。 即 npx 与 Docker。它没有远程传输的官方配置。 目录控制走命令行参数或 MCP Roots(可动态更新)。

stdio only. A local Node.js process communicating over standard input/output. The official README (full-text verified 2026-10-08) gives only two local launch methods: npx and Docker. There is no official configuration for a remote transport. Directory control goes through command-line arguments or MCP Roots (dynamically updatable).

认证机制Authentication

无独立认证层。stdio 形态继承启动它的客户端用户的全部文件权限。 权限边界靠目录白名单实现,不靠认证机制。

No separate authentication layer. In stdio form it inherits all file permissions of the client user that launches it. The permission boundary is not an auth mechanism but a directory allowlist.

权限范围Permission scope

默认范围窄且强制显式:必须通过命令行参数指定允许目录, 或客户端支持 Roots 协议动态下发。 无参数且客户端不支持 roots 时,server 初始化即报错。

不提供删除工具;提供写入、编辑、移动、建目录。 可用 list_allowed_directories 查询当前生效目录。

The default scope is narrow and explicitly forced: allowed directories must be given via command-line arguments, or delivered dynamically if the client supports the Roots protocol. With no arguments and no client roots support, the server errors out at initialization.

No delete tool is provided; write, edit, move and create-directory are. list_allowed_directories can query the currently effective directories.

头号误解Top misconception

  • 以为官方仓库的 server 可以直接上生产,README 明确声明仅供参考实现Assuming the official repo's server is production-ready — the README states it is a reference implementation only
  • 不传目录参数就启动,会在初始化阶段报错而不是静默访问全盘Starting it without a directory argument — it errors at initialisation rather than silently touching the whole disk
  • 以为没给 write 类工具就不能改文件,write_file / edit_file 确实可写Assuming that withholding write tools prevents file changes — write_file / edit_file do write

未知项清单Known unknowns

  • 最低协议版本要求(仓库未声明)
  • 是否支持 Streamable HTTP(仓库未声明)
  • 输出结构的具体 schema(需读源码或实测)
  • 各工具在路径不存在时的错误信息质量
  • Minimum protocol version requirement (not declared in the repo)
  • Whether Streamable HTTP is supported (not declared in the repo)
  • The concrete schema of output structures (requires reading source or measuring)
  • The quality of error messages from each tool when a path does not exist

证据来源Evidence sources

判断可回到以下一手源复核。本站核验日Every judgement can be rechecked against the primary sources below. Verified on 2026-10-23,内容更新日content updated on 2026-10-08。

类型Type名称Name链接Link
changelogMCP · Servers Releases(2026.8.31 / 2026.8.18 / 2026.7.10)MCP · Servers Releases (2026.8.31 / 2026.8.18 / 2026.7.10)https://github.com/modelcontextprotocol/servers/releases
changelogMCP · Filesystem 目录变更历史MCP · Filesystem directory change historyhttps://github.com/modelcontextprotocol/servers/commits/main/src/filesystem
docsMCP · Filesystem ServerMCP · Filesystem Serverhttps://github.com/modelcontextprotocol/servers/tree/main/src/filesystem
repoMCP · Servers 仓库 README(含生产环境免责声明)MCP · Servers repo README (with production-use disclaimer)https://github.com/modelcontextprotocol/servers
docsMCP · 规范MCP · specificationhttps://modelcontextprotocol.io/specification

实测记录Measured runs

本档未在真实客户端逐项跑通;工具清单与权限来自官方 README。

This site has not completed measured runs. The test protocol is at protocols/mcp/_protocol.md.

变更记录说明Change-log notes

本对象无独立 changelog 页。变更记录看 MCP servers 仓库的 releases 页。目录级改动看该目录的 commit 历史:

日期类型内容
2026-09-03fix声明 zod 运行时依赖
2026-08-30fix拒绝 POSIX 下的 Windows 路径
2026-08-28fixcreate_directory 不创建父目录

仓库整体 releases:2026.8.31 / 2026.8.18 / 2026.7.10。

注意 08-30 那个修复。它说明 filesystem server 在不同平台路径语义上出过问题。这是实测时值得关注的点。

This object has no standalone changelog page. Change records are on the MCP servers repo's releases page. Directory-level changes are in that directory's commit history:

DateTypeContent
2026-09-03fixDeclare the zod runtime dependency
2026-08-30fixReject Windows paths under POSIX
2026-08-28fixcreate_directory does not create parent directories

Repo-wide releases: 2026.8.31 / 2026.8.18 / 2026.7.10.

Note the 08-30 fix. It shows the filesystem server had path-semantics issues across platforms — a point worth watching during measurement.

官方声明:reference server 不适合生产环境⚠ Production-use disclaimer (applies to all official reference servers)

MCP servers 仓库 README 原文:

The servers in this repository are intended as reference implementations to demonstrate MCP features and SDK usage. They are meant to serve as educational examples for developers building their own MCP servers, not as production-ready solutions. Developers should evaluate their own security requirements and implement appropriate safeguards based on their specific threat model and use case.

翻译:本仓库的 server 是参考实现,用于演示 MCP 特性与 SDK 用法。 它面向正在构建自己 MCP server 的开发者,不是生产就绪方案。 使用者需自行评估安全需求并按自身威胁模型实现防护。

注意:这句话适用于本分区所有官方 reference server, 每个条目的正文都应保留这一提示。

The MCP servers repo README, original wording:

The servers in this repository are intended as reference implementations to demonstrate MCP features and SDK usage. They are meant to serve as educational examples for developers building their own MCP servers, not as production-ready solutions. Developers should evaluate their own security requirements and implement appropriate safeguards based on their specific threat model and use case.
Note: this statement applies to every official reference server in this section;

each entry's body should keep this reminder.

权限设计实测记录Permission-design test notes

这是本 server 最有价值的设计细节。

场景行为
启动时传目录参数以参数为允许目录
启动时不传参数 + 客户端支持 Roots客户端 roots 完全替换服务端目录
启动时不传参数 + 客户端不支持 Roots初始化阶段报错
运行时客户端 roots 变更通过 roots/list_changed 通知更新,无需重启

"无参数 + 不支持 roots = 启动失败"这个设计值得肯定—— 它把一个潜在的权限失控(无限制文件访问)变成了显式的失败。

This is the most valuable design detail of this server.

ScenarioBehaviour
Directory arguments passed at launchThe arguments become the allowed directories
No arguments + client supports RootsClient roots fully replace server-side directories
No arguments + client lacks RootsError at initialization
Client roots change at runtimeUpdated via roots/list_changed notification, no restart needed

The "no arguments + no roots support = startup failure" design deserves credit — it turns a potential permission escape (unrestricted file access) into an explicit failure.

工具清单Tool inventory

类别工具
读read_text_file read_media_file read_multiple_files
写write_file edit_file
目录create_directory list_directory list_directory_with_sizes move_file directory_tree
检索search_files

注意:没有删除工具。这是有意的权限收敛设计。

CategoryTools
Readread_text_file read_media_file read_multiple_files
Writewrite_file edit_file
Directorycreate_directory list_directory list_directory_with_sizes move_file directory_tree
Searchsearch_files

Note: there is no delete tool. This is a deliberate permission-narrowing design.

相关条目Related entries

本页由This page is generated from the ai-handbook 数据层生成(CC BY 4.0)。data layer (CC BY 4.0). 方法论与坐标系定义见仓库内For the methodology and coordinate definitions, see METHODOLOGY.md.