The Filesystem MCP Server is a Node.js server that implements the Model Context Protocol (MCP) for performing filesystem operations. It provides a robust set of tools for managing files and directories, enabling seamless integration with applications like Claude Desktop.
read_file
: Reads the complete contents of a file with UTF-8 encoding.read_multiple_files
: Reads multiple files simultaneously, continuing even if some reads fail.write_file
: Creates a new file or overwrites an existing one.edit_file
: Makes selective edits using advanced pattern matching and formatting. Supports previewing changes with dry run mode.create_directory
: Creates a new directory or ensures it exists.list_directory
: Lists directory contents with [FILE]
or [DIR]
prefixes.move_file
: Moves or renames files and directories.search_files
: Recursively searches for files/directories using patterns and excludes.get_file_info
: Retrieves detailed metadata for files/directories, including size, creation time, and permissions.list_allowed_directories
: Lists all directories the server is allowed to access.To integrate the Filesystem MCP Server with Claude Desktop, add the following configuration to your claude_desktop_config.json
file:
{
"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"
]
}
}
}
To build the Docker image, run the following command:
docker build -t mcp/filesystem -f src/filesystem/Dockerfile .
The Filesystem MCP Server is licensed under the MIT License. You are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, refer to the LICENSE
file in the project repository.