MCP Catalogs
首页

filesystem

官方

by modelcontextprotocol·85,748·综合分 77

功能丰富的文件系统操作 MCP 服务器,具有动态目录访问控制功能。

file-systemdeveloper-toolsproductivity
10,713
Forks
459
活跃 Issue
本月
最近提交
2 天前
收录于

概述

文件系统 MCP 服务器提供了全面的文件和目录读写操作工具,包括只读和写入功能,以及详细的元数据信息。该服务器最突出的特点是它复杂的目录访问控制系统,既支持命令行配置,也支持通过 MCP Roots 协议进行动态更新,这允许在不重启服务器的情况下灵活调整运行时配置。服务器遵循安全最佳实践,将所有操作限制在明确允许的目录范围内。

试试问 AI

装完之后,这里有 6 个你可以让 AI 做的事:

:使 AI 模型能够读取和写入项目文件进行开发
:允许 Claude 或其他 MCP 客户端浏览和分析代码库
:为内容生成提供对特定目录的安全沙盒访问
:如何限制仅访问特定目录?
:文件系统服务器可以与 Claude Desktop 一起使用吗?
:如果没有指定目录会发生什么?

什么时候选它

当您需要全面的文件系统操作和动态目录访问控制时,特别是当与需要安全、有范围地访问多个目录的 AI 代理一起工作时,选择这个服务器。

什么时候不要选它

如果您需要超越目录级访问控制的细粒度文件权限,或者您正在处理极其敏感的系统,需要额外的安全层超出 MCP 的基本访问模型,请避免使用。

此 server 暴露的工具

从 README 抽取出 12 个工具
  • read_text_file

    Read complete contents of a file as text

  • read_media_file

    Read an image or audio file and return base64 data

  • write_file

    Create new file or overwrite existing file

  • edit_file

    Make selective edits to a file using pattern matching

  • create_directory

    Create new directory or ensure it exists

  • list_directory

    List directory contents with [FILE] or [DIR] prefixes

  • search_files

    Recursively search for files/directories that match patterns

  • get_file_info

    Get detailed file/directory metadata

  • move_file

    Move or rename files and directories

  • directory_tree

    Get recursive JSON tree structure of directory contents

  • list_allowed_directories

    List all directories the server is allowed to access

  • list_directory_with_sizes

    List directory contents with file sizes

可对比工具

shell-mcpsqlite-mcpgithub-mcp

安装

安装

使用 NPX

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/allowed/directory"
      ]
    }
  }
}

使用 Docker

{
  "mcpServers": {
    "filesystem": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount", "type=bind,src=/path/to/allowed/dir,dst=/projects/allowed/dir",
        "mcp/filesystem",
        "/projects"
      ]
    }
  }
}

VS Code 扩展

点击 README 中的安装按钮直接在 VS Code 中安装。

FAQ

如何限制仅访问特定目录?
您可以在启动服务器时通过命令行参数指定允许访问的目录,或使用 MCP Roots 协议进行动态目录访问控制。服务器仅允许在指定的目录内进行操作。
文件系统服务器可以与 Claude Desktop 一起使用吗?
可以,README 中为 Claude Desktop 提供了具体的配置示例,包括 NPX 和 Docker 部署选项。
如果没有指定目录会发生什么?
如果服务器在没有命令行参数的情况下启动,且客户端不支持 roots 协议(或提供了空的 roots),服务器在初始化时会抛出错误,因为它至少需要一个允许的目录才能运行。

Hacker News 讨论

开发者社区最近的相关讨论。

filesystem 对比

GitHub →

最后更新于 · 由 README + GitHub 公开数据自动生成。