MCP Configs2026年3月29日·1 分钟阅读

Filesystem MCP Server — File Operations for AI

Official MCP server for safe filesystem operations. Read, write, search, and manage files and directories with configurable access controls. Essential for any AI coding workflow.

TO
TokRepo精选 · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

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

介绍

The Filesystem MCP Server gives AI tools safe, controlled access to your local files. Read file contents, create new files, edit existing ones, search by name or content, and manage directories — all with configurable path restrictions.

Best for: Code generation, file management, project scaffolding, content creation Works with: Claude Code, Cursor, Gemini CLI


Available Tools

Tool Description
read_file Read complete file contents
write_file Create or overwrite files
edit_file Make line-based edits with diffs
list_directory List files and subdirectories
search_files Regex search across file contents
get_file_info Get file metadata (size, dates)
create_directory Create new directories
move_file Move or rename files

Security

  • Only allows access within explicitly specified directories
  • Prevents path traversal attacks (no ../ escapes)
  • Read-only mode available via configuration

🙏

来源与感谢

Created by Anthropic. Licensed under MIT. modelcontextprotocol/servers — Official MCP reference servers.

相关资产