Home / MCP / Filesystem MCP Server
Provides filesystem operations to read, write, move, list, and search files within allowed directories.
Configuration
View docs{
"mcpServers": {
"filesystem_mcp": {
"command": "node",
"args": [
"/path/to/filesystem-server/build/index.js",
"/path/to/allowed/dir1",
"/path/to/allowed/dir2"
]
}
}
}A Model Context Protocol (MCP) server that provides filesystem operations. It lets you read, write, move, list, and search files and directories within allowed paths, making it easy to automate file management from your MCP client while enforcing a strict security boundary.
You interact with the filesystem MCP server through a client that supports MCP operations. You can read files, write or overwrite content, create directories, list directory contents, move files, search recursively, and retrieve metadata. All operations are constrained to the directories you specify when you start the server, ensuring your file access stays within safe boundaries.
Prerequisites: you need Node.js installed on your system. You can verify Node.js and npm by running node -v and npm -v in your terminal.
Step 1: Install dependencies and build the project.
Step 2: Start the server with one or more allowed directories. Supply the full paths to the directories you want the server to access.
{
"mcpServers": {
"filesystem": {
"command": "node",
"args": [
"/path/to/filesystem-server/build/index.js",
"/path/to/allowed/dir1",
"/path/to/allowed/dir2"
],
"disabled": false,
"autoApprove": []
}
}
}The server only allows operations within directories specified via command-line arguments when you start it. Any request outside those paths is rejected to protect your data.
If you need to manage multiple directories, pass them all on the startup command line in the order you prefer. Keep your allowed paths organized to prevent accidental writes outside the intended scope.
Read complete contents of a file (UTF-8) by supplying the path.
Read multiple files concurrently; a failed read does not abort the entire operation.
Create a new file or overwrite an existing one using the provided path and content.
Create a new directory or ensure it exists, including any required parent directories.
List directory contents with a [FILE] or [DIR] prefix for each item.
Move or rename files and directories; the destination must not already exist.
Recursively search for files or directories from a starting path using a case-insensitive pattern.
Return detailed metadata for a path, including size, creation/modification/access times, type, and permissions.
Return all directories the server is permitted to read/write.