



Node.js server implementing the Model Context Protocol (MCP) for filesystem operations, providing tools for reading, writing, editing, and managing files and directories with dynamic access control via Roots.
טוען......
בעמוד זה
Filesystem MCP Server
A Node.js implementation of the Model Context Protocol (MCP) that exposes filesystem capabilities to AI agents through a standardized interface.
File Operations:
read_text_file: Read complete file contents as UTF-8 text, with optional head/tail line selectionread_media_file: Read image/audio files and return base64-encoded data with MIME typeread_multiple_files: Read several files simultaneously; failures don't halt the operationwrite_file: Create or overwrite files (use with caution)edit_file: Make selective edits using pattern matching, with whitespace normalization, indentation preservation, and dry-run modeget_file_info: Retrieve detailed metadata (size, timestamps, permissions, type)Directory Operations:
create_directory: Create a directory and any missing parents; silent if already existslist_directory: List contents with [FILE] or [DIR] prefixeslist_directory_with_sizes: List contents including file sizes, sortable by name or sizemove_file: Move or rename files/directories; fails if destination existsdirectory_tree: Get recursive JSON tree structure of directory contentsSearch & Navigation:
search_files: Recursive glob-style search with include/exclude patternsAccess Control:
list_allowed_directories: Show directories the server is permitted to accessTool Annotations (MCP Hints):
read_text_file, read_media_file, read_multiple_files, list_directory, list_directory_with_sizes, directory_tree, search_files, get_file_info, list_allowed_directoriescreate_directory: idempotent (re‑creating same dir is a no‑op)write_file: destructive (overwrites existing file)edit_file: destructive (re‑applying edits can fail or double‑apply)move_file: destructive (deletes source file)The server supports two methods for specifying allowed directories:
Command‑line Arguments:
mcp-server-filesystem /path/to/dir1 /path/to/dir2
MCP Roots (Recommended):
roots/list and replaces all allowed directoriesroots/list_changed notificationsAll filesystem operations are confined to the allowed directories; use list_allowed_directories to inspect current access.
{
"mcpServers": {
"filesystem": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
"--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
"--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
"mcp/filesystem",
"/projects"
]
}
}
}
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}
{
"mcpServers": {
"filesystem": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}
MCP: Open User Configuration.vscode/mcp.jsonMount directories to /projects; use ro flag for read‑only mounts.
docker build -t mcp/filesystem -f src/filesystem/Dockerfile .
Licensed under the MIT License – free to use, modify, and distribute.
גלו פריטים נוספים הקשורים לזה