filesystem

filesystem

A filesystem MCP server that preserves file inode and metadata when writing or editing files, operating within allowed directories.

Category
访问服务器

README

Filesystem MCP Server

A narrowly maintained downstream variant of the Model Context Protocol filesystem server that preserves the existing file inode and filesystem metadata when write_file or edit_file changes an existing file.

This is a community-maintained integration. It is not affiliated with, endorsed by, or officially maintained by the Model Context Protocol project.

Why this variant exists

The upstream 2026.7.10 filesystem server replaces an existing file through a temporary-file rename. That is rename-atomic, but it replaces the inode and can therefore break file-bind consumers or discard inode-associated metadata.

This variant keeps upstream behavior except for existing-file replacement. It opens the existing file with O_NOFOLLOW, truncates it and writes the new content through the same file handle. As a result, file identity, hard links, mode and other inode-associated metadata remain attached to the same inode.

The tradeoff is explicit: an interrupted in-place write can leave partial content after truncation. This variant therefore favors inode and metadata preservation over rename atomicity for existing files. New-file creation keeps the upstream exclusive-create behavior.

See UPSTREAM.md for the exact baseline, tracked upstream fix and update procedure.

Requirements

  • Node.js 22 is the maintained build and CI baseline.
  • At least one allowed directory must be supplied by command line or by an MCP client that provides Roots.
  • The server only operates within its configured allowed-directory boundary.

Install and build

npm ci --ignore-scripts
npm run build

Run the built STDIO server with one or more allowed directories:

node dist/index.js /allowed/root [/another/root]

Example MCP client configuration after building the repository:

{
  "mcpServers": {
    "filesystem": {
      "command": "node",
      "args": [
        "/path/to/mcp-server-filesystem/dist/index.js",
        "/path/to/allowed/root"
      ]
    }
  }
}

Pin production consumption to an immutable reviewed release rather than a mutable branch checkout.

MCP surface

The server intentionally retains the upstream filesystem tool surface. It does not add deployment-specific administration tools.

Capability Tools
Read read_file (deprecated), read_text_file, read_media_file, read_multiple_files, list_directory, list_directory_with_sizes, directory_tree, search_files, get_file_info, list_allowed_directories
Write write_file, edit_file, create_directory, move_file

See docs/tools.md for the complete 14-tool reference, including access and destructive classifications, important inputs and mutation semantics.

Security model

The allowed-directory boundary and MCP Roots handling remain the primary filesystem authorization boundary inherited from upstream. Paths are validated against that boundary and symlink targets outside it are rejected.

For existing-file writes, O_NOFOLLOW prevents the downstream in-place writer from following a symlink opened at the target path. This preserves the intended symlink-race protection while avoiding inode replacement.

The server does not provide authentication or authorization beyond its filesystem boundary. Restrict which directories are exposed and which MCP clients can invoke mutating tools according to the deployment environment.

Deliberate exclusions

This repository deliberately does not include:

  • extra filesystem tools beyond the upstream surface;
  • deployment-specific checkout paths, revision guards or environment configuration;
  • an independent identity or authorization layer;
  • automatic upstream source merges;
  • npm publication automation.

Deployment policy belongs to the consuming environment, not to this reusable product repository.

Compatibility

The maintained downstream baseline is exactly @modelcontextprotocol/server-filesystem@2026.7.10 from upstream commit 9a96ea6e5913736f92b88345bf51caeaaa8e719f plus the narrow existing-file write patch described above.

Newer upstream releases are not considered supported until they have been reviewed and adopted through the process in UPSTREAM.md.

Development

Run the complete repository verification locally with:

npm ci --ignore-scripts
npm run verify
npm pack --ignore-scripts --dry-run

CI uses the same install, test and build contract. A weekly upstream check reports when the upstream repository publishes a release different from the baseline in upstream.json. Dependabot refreshes locked npm dependencies within the declared compatibility ranges and tracks GitHub Actions revisions; changes to declared major-version boundaries remain explicit compatibility work.

Accepted version tags can create a GitHub Release containing the packed npm artifact and SHA256SUMS. Creating the first version tag remains an explicit release decision.

Security reports are handled according to SECURITY.md.

License

This downstream variant is distributed under the upstream MIT license. See LICENSE. The Model Context Protocol project retains ownership of its upstream project and governance; this repository is an independently maintained downstream variant.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选