This project is a Node.js server implementing the Model Context Protocol (MCP) for secure filesystem operations.
Read complete contents of a file as text with optional head/tail line filtering, treating files as UTF-8 text regardless of extension.
Read an image or audio file and return base64 data with the corresponding MIME type by streaming the file content.
Read multiple files simultaneously with fault tolerance, where failed reads won't stop the entire operation.
Create new file or overwrite existing file with specified content at the given path location.
Make selective edits using advanced pattern matching and formatting with features like whitespace normalization, indentation preservation, and git-style diff output.
Create new directory or ensure it exists, creating parent directories if needed and succeeding silently if directory already exists.
List directory contents with [FILE] or [DIR] prefixes to distinguish between files and directories.
Move or rename files and directories from source to destination, failing if destination already exists.
Recursively search for files and directories using pattern matching with support for exclude patterns and case-insensitive matching.
Get detailed file or directory metadata including size, creation time, modified time, access time, type, and permissions.
List all directories that the server is allowed to access for read/write operations based on current access control settings.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}