
Filesystem
@modelcontextprotocol
关于 Filesystem
Model Context Protocol Servers
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"filesystem": {
"command": "docker",
"args": [
"build",
"-t",
"mcp/filesystem",
"-f",
"src/filesystem/Dockerfile",
"."
]
}
}
}工具
13Read complete contents of a file as text
Read a file and return it as a base64-encoded content block with its MIME type
Read multiple files simultaneously
Create new file or overwrite existing (exercise caution with this)
Make selective edits using advanced pattern matching and formatting
Create new directory or ensure it exists
List directory contents with [FILE] or [DIR] prefixes
List directory contents with [FILE] or [DIR] prefixes, including file sizes
Move or rename files and directories
Recursively search for files/directories that match or do not match patterns
Get recursive JSON tree structure of directory contents
Get detailed file/directory metadata
List all directories the server is allowed to access
概览
What is Filesystem?
Filesystem is a Node.js server that implements the Model Context Protocol (MCP) for filesystem operations. It enables AI assistants to read, write, and manage files and directories on the local machine within configurable sandboxed directories. Published as @modelcontextprotocol/server-filesystem, it is intended for developers who want to give MCP clients controlled filesystem access.
How to use Filesystem?
Install via npm or run using npx or Docker. Specify allowed directories as command-line arguments when starting the server. Alternatively, use MCP Roots for dynamic directory updates without restarting the server. Example for Claude Desktop or VS Code uses JSON configuration with npx -y @modelcontextprotocol/server-filesystem followed by allowed directory paths.
Key features of Filesystem
- Read and write text and media files
- Create, list, and delete directories
- Move or rename files and directories
- Search files recursively using glob patterns
- Get detailed file metadata and directory trees
- Dynamic directory access control via MCP Roots
Use cases of Filesystem
- Editing source code files in a project directory
- Organizing files by creating and moving directories
- Reading image or audio files for AI processing
- Searching for files matching specific patterns
- Previewing file edits with dry-run mode before applying changes
FAQ from Filesystem
How does directory access control work?
Directories can be specified at startup via command-line arguments or dynamically via MCP Roots. Roots completely replace any server-side allowed directories when provided. If neither is available, the server throws an error.
What happens if no directories are specified?
If the server starts without command-line arguments and the client does not support the roots protocol (or provides empty roots), the server will throw an error during initialization. At least one allowed directory is required to operate.
Can I preview edits before applying them?
Yes, the edit_file tool supports a dryRun parameter. When set to true, it returns a diff of changes without modifying the file. The README recommends always using dryRun first.
What runtime and dependencies are required?
The server is a Node.js application published on npm. It requires Node.js to run and has no external runtime dependencies beyond standard npm packages.
Where do files and data actually live?
All operations are restricted to the allowed directories specified by the user. The server never accesses the internet or external systems; it only works on the local filesystem within those sandboxed paths.
文件与存储 分类下的更多 MCP 服务器
PDF Reader MCP Server (@sylphlab/pdf-reader-mcp)
sylphlab📄 The PDF intelligence layer for AI agents — Agent Document Twin, evidence-first extraction, visual crops, OCR provenance, trust reports, and benchmark-gated releases. MCP server for Claude, Cursor, VS Code, and any MCP client.
PDF Reader MCP Server (@shtse8/pdf-reader-mcp)
shtse8📄 The PDF intelligence layer for AI agents — Agent Document Twin, evidence-first extraction, visual crops, OCR provenance, trust reports, and benchmark-gated releases. MCP server for Claude, Cursor, VS Code, and any MCP client.
MCP File System Server
MarcusJellinghausMCP Workspace Server: A secure Model Context Protocol server providing file, git, and GitHub tools for AI assistants within a sandboxed project directory.
Google Drive MCP Server
hxie-pallasA google drive mcp servers based on Python
Filesystem MCP Server
cyanheadsA Model Context Protocol (MCP) server for platform-agnostic file capabilities, including advanced search/replace and directory tree traversal
评论