Node.js server implementing Model Context Protocol
Filesystem MCP Server

Node.js server implementing Model Context Protocol (MCP) for filesystem operations.
# Filesystem MCP Server Node.js server implementing Model Context Protocol (MCP) for filesystem operations. Published on npm as [`@modelcontextprotocol/server-filesystem`](https://www.npmjs.com/package/@modelcontextprotocol/server-filesystem). ## Features - Read/write files - Create/list/delete directories - Move files/directories - Search files - Get file metadata - Dynamic directory access control via [Roots](https://modelcontextprotocol.io/docs/learn/client-concepts#roots) ## Directory Access Control The server uses a flexible directory access control system. Directories can be specified via command-line arguments or dynamically via [Roots](https://modelcontextprotocol.io/docs/learn/client-concepts#roots).
Overview
Node.js server implementing Model Context Protocol (MCP) for filesystem operations.
What you get
- Read/write files
- Create/list/delete directories
- Move files/directories
- Search files
- Get file metadata
- Dynamic directory access control via Roots
Manual install (npx, ZIP)
mkdir -p ~/.claude/agents && curl -sL https://raw.githubusercontent.com/modelcontextprotocol/servers/f46d9578190b476b3501923ea8977d899e8db2cb/src/filesystem/README.md \
-o ~/.claude/agents/README.mdNew-Item -ItemType Directory -Force "$HOME\.claude\agents" | Out-Null; Invoke-WebRequest "https://raw.githubusercontent.com/modelcontextprotocol/servers/f46d9578190b476b3501923ea8977d899e8db2cb/src/filesystem/README.md" -OutFile "$HOME\.claude\agents\README.md"Connects with Agent Alley MCP · agentalley.io/mcp
Files included
README.md14.7 KB
Read the files here
modelcontextprotocol/
Show the full text366 lines
Filesystem MCP Server
Node.js server implementing Model Context Protocol (MCP) for filesystem operations.
Published on npm as @modelcontextprotocol/server-filesystem.
Features
- Read/write files
- Create/list/delete directories
- Move files/directories
- Search files
- Get file metadata
- Dynamic directory access control via Roots
Directory Access Control
The server uses a flexible directory access control system. Directories can be specified via command-line arguments or dynamically via Roots.
Method 1: Command-line Arguments
Specify Allowed directories when starting the server:
mcp-server-filesystem /path/to/dir1 /path/to/dir2
Method 2: MCP Roots (Recommended)
MCP clients that support Roots can dynamically update the Allowed directories.
Roots notified by Client to Server, completely replace any server-side Allowed directories when provided.
Important: If server starts without command-line arguments AND client doesn't support roots protocol (or provides empty roots), the server will throw an error during initialization.
This is the recommended method, as this enables runtime directory updates via roots/list_changed notifications without server restart, providing a more flexible and modern integration experience.
How It Works
The server's directory access control follows this flow:
Server Startup
- Server starts with directories from command-line arguments (if provided)
- If no arguments provided, server starts with empty allowed directories
Client Connection & Initialization
- Client connects and sends
initializerequest with capabilities - Server checks if client supports roots protocol (
capabilities.roots)
- Client connects and sends
Roots Protocol Handling (if client supports roots)
- On initialization: Server requests roots from client via
roots/list - Client responds with its configured roots
- Server replaces ALL allowed directories with client's roots
- On runtime updates: Client can send
notifications/roots/list_changed - Server requests updated roots and replaces allowed directories again
- On initialization: Server requests roots from client via
Fallback Behavior (if client doesn't support roots)
- Server continues using command-line directories only
- No dynamic updates possible
Access Control
- All filesystem operations are restricted to allowed directories
- Use
list_allowed_directoriestool to see current directories - Server requires at least ONE allowed directory to operate
Note: The server will only allow operations within directories specified either via args or via Roots.
API
Tools
read_text_file
- Read complete contents of a file as text
- Inputs:
path(string)head(number, optional): First N linestail(number, optional): Last N lines
- Always treats the file as UTF-8 text regardless of extension
- Cannot specify both
headandtailsimultaneously
read_media_file
- Read a file and return it as a base64-encoded content block with its MIME type
- Inputs:
path(string)
- Streams the file and returns base64 data with the corresponding MIME type. Image and
audio files are returned as
image/audiocontent; any other file type is returned as an embeddedresource(a valid MCP content block for arbitrary binary data)
read_multiple_files
- Read multiple files simultaneously
- Input:
paths(string[]) - Failed reads won't stop the entire operation
write_file
- Create new file or overwrite existing (exercise caution with this)
- Inputs:
path(string): File locationcontent(string): File content
edit_file
- Make selective edits using advanced pattern matching and formatting
- Features:
- Line-based and multi-line content matching
- Whitespace normalization with indentation preservation
- Multiple simultaneous edits with correct positioning
- Indentation style detection and preservation
- Git-style diff output with context
- Preview changes with dry run mode
- Inputs:
path(string): File to editedits(array): List of edit operationsoldText(string): Text to search for (can be substring)newText(string): Text to replace with
dryRun(boolean): Preview changes without applying (default: false)
- Returns detailed diff and match information for dry runs, otherwise applies changes
- Best Practice: Always use dryRun first to preview changes before applying them
create_directory
- Create new directory or ensure it exists
- Input:
path(string) - Creates parent directories if needed
- Succeeds silently if directory exists
list_directory
- List directory contents with [FILE] or [DIR] prefixes
- Input:
path(string)
list_directory_with_sizes
- List directory contents with [FILE] or [DIR] prefixes, including file sizes
- Inputs:
path(string): Directory path to listsortBy(string, optional): Sort entries by "name" or "size" (default: "name")
- Returns detailed listing with file sizes and summary statistics
- Shows total files, directories, and combined size
move_file
- Move or rename files and directories
- Inputs:
source(string)destination(string)
- Fails if destination exists
search_files
- Recursively search for files/directories that match or do not match patterns
- Inputs:
path(string): Starting directorypattern(string): Search patternexcludePatterns(string[]): Exclude any patterns.
- Glob-style pattern matching
- Returns full paths to matches
directory_tree
- Get recursive JSON tree structure of directory contents
- Inputs:
path(string): Starting directoryexcludePatterns(string[]): Exclude any patterns. Glob formats are supported.
- Returns:
- JSON array where each entry contains:
name(string): File/directory nametype('file'|'directory'): Entry typechildren(array): Present only for directories- Empty array for empty directories
- Omitted for files
- JSON array where each entry contains:
- Output is formatted with 2-space indentation for readability
get_file_info
- Get detailed file/directory metadata
- Input:
path(string) - Returns:
- Size
- Creation time
- Modified time
- Access time
- Type (file/directory)
- Permissions
list_allowed_directories
- List all directories the server is allowed to access
- No input required
- Returns:
- Directories that this server can read/write from
Tool annotations (MCP hints)
This server sets MCP ToolAnnotations on each tool so clients can:
- Distinguish read‑only tools from write‑capable tools.
- Understand which write operations are idempotent (safe to retry with the same arguments).
- Highlight operations that may be destructive (overwriting or heavily mutating data).
- Signal that a tool does not reach an open or external world (every filesystem tool sets
openWorldHint: false).
The mapping for filesystem tools is:
| Tool | readOnlyHint | idempotentHint | destructiveHint | Notes |
|---|---|---|---|---|
read_text_file |
true |
– | – | Pure read |
read_media_file |
true |
– | – | Pure read |
read_multiple_files |
true |
– | – | Pure read |
list_directory |
true |
– | – | Pure read |
list_directory_with_sizes |
true |
– | – | Pure read |
directory_tree |
true |
– | – | Pure read |
search_files |
true |
– | – | Pure read |
get_file_info |
true |
– | – | Pure read |
list_allowed_directories |
true |
– | – | Pure read |
create_directory |
false |
true |
false |
Re‑creating the same dir is a no‑op |
write_file |
false |
true |
true |
Overwrites existing files |
edit_file |
false |
false |
true |
Re‑applying edits can fail or double‑apply |
move_file |
false |
false |
true |
Deletes source file |
Note:
idempotentHintanddestructiveHintare meaningful only whenreadOnlyHintisfalse, as defined by the MCP spec. Every tool also setsopenWorldHint: false— this server only accesses the local filesystem within its allowed directories, never an open or external world.
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
Note: you can provide sandboxed directories to the server by mounting them to /projects. Adding the ro flag will make the directory readonly by the server.
Docker
Note: all directories must be mounted to /projects by default.
{
"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"
]
}
}
}
NPX
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}
On Windows, use cmd /c to launch npx:
{
"mcpServers": {
"filesystem": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/username/Desktop",
"/path/to/other/allowed/dir"
]
}
}
}
Usage with VS Code
For quick installation, click the installation buttons below...
For manual installation, you can configure the MCP server using one of these methods:
Method 1: User Configuration (Recommended)
Add the configuration to your user-level MCP configuration file. Open the Command Palette (Ctrl + Shift + P) and run MCP: Open User Configuration. This will open your user mcp.json file where you can add the server configuration.
Method 2: Workspace Configuration
Alternatively, you can add the configuration to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.
For more details about MCP configuration in VS Code, see the official VS Code MCP documentation.
You can provide sandboxed directories to the server by mounting them to /projects. Adding the ro flag will make the directory readonly by the server.
Docker
Note: all directories must be mounted to /projects by default.
{
"servers": {
"filesystem": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount", "type=bind,src=${workspaceFolder},dst=/projects/workspace",
"mcp/filesystem",
"/projects"
]
}
}
}
NPX
{
"servers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"${workspaceFolder}"
]
}
}
}
On Windows, use:
{
"servers": {
"filesystem": {
"command": "cmd",
"args": [
"/c",
"npx",
"-y",
"@modelcontextprotocol/server-filesystem",
"${workspaceFolder}"
]
}
}
}
Build
Docker build:
docker build -t mcp/filesystem -f src/filesystem/Dockerfile .
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
| 1 | # Filesystem MCP Server |
| 2 | |
| 3 | Node.js server implementing Model Context Protocol (MCP) for filesystem operations. |
| 4 | |
| 5 | Published on npm as [`@modelcontextprotocol/server-filesystem`]. |
| 6 | |
| 7 | ## Features |
| 8 | |
| 9 | Read/write files |
| 10 | Create/list/delete directories |
| 11 | Move files/directories |
| 12 | Search files |
| 13 | Get file metadata |
| 14 | Dynamic directory access control via [Roots] |
| 15 | |
| 16 | ## Directory Access Control |
| 17 | |
| 18 | The server uses a flexible directory access control system. Directories can be specified via command-line arguments or dynamically via [Roots]. |
| 19 | |
| 20 | ### Method 1: Command-line Arguments |
| 21 | Specify Allowed directories when starting the server: |
| 22 | |
| 23 | mcp-server-filesystem /path/to/dir1 /path/to/dir2 |
| 24 | |
| 25 | |
| 26 | ### Method 2: MCP Roots (Recommended) |
| 27 | MCP clients that support [Roots] can dynamically update the Allowed directories. |
| 28 | |
| 29 | Roots notified by Client to Server, completely replace any server-side Allowed directories when provided. |
| 30 | |
| 31 | **Important**: If server starts without command-line arguments AND client doesn't support roots protocol (or provides empty roots), the server will throw an error during initialization. |
| 32 | |
| 33 | This is the recommended method, as this enables runtime directory updates via `roots/list_changed` notifications without server restart, providing a more flexible and modern integration experience. |
| 34 | |
| 35 | ### How It Works |
| 36 | |
| 37 | The server's directory access control follows this flow: |
| 38 | |
| 39 | **Server Startup** |
| 40 | Server starts with directories from command-line arguments (if provided) |
| 41 | If no arguments provided, server starts with empty allowed directories |
| 42 | |
| 43 | **Client Connection & Initialization** |
| 44 | Client connects and sends `initialize` request with capabilities |
| 45 | Server checks if client supports roots protocol (`capabilities.roots`) |
| 46 | |
| 47 | **Roots Protocol Handling** (if client supports roots) |
| 48 | **On initialization**: Server requests roots from client via `roots/list` |
| 49 | Client responds with its configured roots |
| 50 | Server replaces ALL allowed directories with client's roots |
| 51 | **On runtime updates**: Client can send `notifications/roots/list_changed` |
| 52 | Server requests updated roots and replaces allowed directories again |
| 53 | |
| 54 | **Fallback Behavior** (if client doesn't support roots) |
| 55 | Server continues using command-line directories only |
| 56 | No dynamic updates possible |
| 57 | |
| 58 | **Access Control** |
| 59 | All filesystem operations are restricted to allowed directories |
| 60 | Use `list_allowed_directories` tool to see current directories |
| 61 | Server requires at least ONE allowed directory to operate |
| 62 | |
| 63 | **Note**: The server will only allow operations within directories specified either via `args` or via Roots. |
| 64 | |
| 65 | |
| 66 | |
| 67 | ## API |
| 68 | |
| 69 | ### Tools |
| 70 | |
| 71 | **read_text_file** |
| 72 | Read complete contents of a file as text |
| 73 | Inputs: |
| 74 | `path` (string) |
| 75 | `head` (number, optional): First N lines |
| 76 | `tail` (number, optional): Last N lines |
| 77 | Always treats the file as UTF-8 text regardless of extension |
| 78 | Cannot specify both `head` and `tail` simultaneously |
| 79 | |
| 80 | **read_media_file** |
| 81 | Read a file and return it as a base64-encoded content block with its MIME type |
| 82 | Inputs: |
| 83 | `path` (string) |
| 84 | Streams the file and returns base64 data with the corresponding MIME type. Image and |
| 85 | audio files are returned as `image`/`audio` content; any other file type is returned as |
| 86 | an embedded `resource` (a valid MCP content block for arbitrary binary data) |
| 87 | |
| 88 | **read_multiple_files** |
| 89 | Read multiple files simultaneously |
| 90 | Input: `paths` (string[]) |
| 91 | Failed reads won't stop the entire operation |
| 92 | |
| 93 | **write_file** |
| 94 | Create new file or overwrite existing (exercise caution with this) |
| 95 | Inputs: |
| 96 | `path` (string): File location |
| 97 | `content` (string): File content |
| 98 | |
| 99 | **edit_file** |
| 100 | Make selective edits using advanced pattern matching and formatting |
| 101 | Features: |
| 102 | Line-based and multi-line content matching |
| 103 | Whitespace normalization with indentation preservation |
| 104 | Multiple simultaneous edits with correct positioning |
| 105 | Indentation style detection and preservation |
| 106 | Git-style diff output with context |
| 107 | Preview changes with dry run mode |
| 108 | Inputs: |
| 109 | `path` (string): File to edit |
| 110 | `edits` (array): List of edit operations |
| 111 | `oldText` (string): Text to search for (can be substring) |
| 112 | `newText` (string): Text to replace with |
| 113 | `dryRun` (boolean): Preview changes without applying (default: false) |
| 114 | Returns detailed diff and match information for dry runs, otherwise applies changes |
| 115 | Best Practice: Always use dryRun first to preview changes before applying them |
| 116 | |
| 117 | **create_directory** |
| 118 | Create new directory or ensure it exists |
| 119 | Input: `path` (string) |
| 120 | Creates parent directories if needed |
| 121 | Succeeds silently if directory exists |
| 122 | |
| 123 | **list_directory** |
| 124 | List directory contents with [FILE] or [DIR] prefixes |
| 125 | Input: `path` (string) |
| 126 | |
| 127 | **list_directory_with_sizes** |
| 128 | List directory contents with [FILE] or [DIR] prefixes, including file sizes |
| 129 | Inputs: |
| 130 | `path` (string): Directory path to list |
| 131 | `sortBy` (string, optional): Sort entries by "name" or "size" (default: "name") |
| 132 | Returns detailed listing with file sizes and summary statistics |
| 133 | Shows total files, directories, and combined size |
| 134 | |
| 135 | **move_file** |
| 136 | Move or rename files and directories |
| 137 | Inputs: |
| 138 | `source` (string) |
| 139 | `destination` (string) |
| 140 | Fails if destination exists |
| 141 | |
| 142 | **search_files** |
| 143 | Recursively search for files/directories that match or do not match patterns |
| 144 | Inputs: |
| 145 | `path` (string): Starting directory |
| 146 | `pattern` (string): Search pattern |
| 147 | `excludePatterns` (string[]): Exclude any patterns. |
| 148 | Glob-style pattern matching |
| 149 | Returns full paths to matches |
| 150 | |
| 151 | **directory_tree** |
| 152 | Get recursive JSON tree structure of directory contents |
| 153 | Inputs: |
| 154 | `path` (string): Starting directory |
| 155 | `excludePatterns` (string[]): Exclude any patterns. Glob formats are supported. |
| 156 | Returns: |
| 157 | JSON array where each entry contains: |
| 158 | `name` (string): File/directory name |
| 159 | `type` ('file'|'directory'): Entry type |
| 160 | `children` (array): Present only for directories |
| 161 | Empty array for empty directories |
| 162 | Omitted for files |
| 163 | Output is formatted with 2-space indentation for readability |
| 164 | |
| 165 | **get_file_info** |
| 166 | Get detailed file/directory metadata |
| 167 | Input: `path` (string) |
| 168 | Returns: |
| 169 | Size |
| 170 | Creation time |
| 171 | Modified time |
| 172 | Access time |
| 173 | Type (file/directory) |
| 174 | Permissions |
| 175 | |
| 176 | **list_allowed_directories** |
| 177 | List all directories the server is allowed to access |
| 178 | No input required |
| 179 | Returns: |
| 180 | Directories that this server can read/write from |
| 181 | |
| 182 | ### Tool annotations (MCP hints) |
| 183 | |
| 184 | This server sets [MCP ToolAnnotations] |
| 185 | on each tool so clients can: |
| 186 | |
| 187 | Distinguish **read‑only** tools from write‑capable tools. |
| 188 | Understand which write operations are **idempotent** (safe to retry with the same arguments). |
| 189 | Highlight operations that may be **destructive** (overwriting or heavily mutating data). |
| 190 | Signal that a tool does **not** reach an open or external world (every filesystem tool sets `openWorldHint: false`). |
| 191 | |
| 192 | The mapping for filesystem tools is: |
| 193 | |
| 194 | | Tool | readOnlyHint | idempotentHint | destructiveHint | Notes | |
| 195 | |-----------------------------|--------------|----------------|-----------------|--------------------------------------------------| |
| 196 | | `read_text_file` | `true` | – | – | Pure read | |
| 197 | | `read_media_file` | `true` | – | – | Pure read | |
| 198 | | `read_multiple_files` | `true` | – | – | Pure read | |
| 199 | | `list_directory` | `true` | – | – | Pure read | |
| 200 | | `list_directory_with_sizes` | `true` | – | – | Pure read | |
| 201 | | `directory_tree` | `true` | – | – | Pure read | |
| 202 | | `search_files` | `true` | – | – | Pure read | |
| 203 | | `get_file_info` | `true` | – | – | Pure read | |
| 204 | | `list_allowed_directories` | `true` | – | – | Pure read | |
| 205 | | `create_directory` | `false` | `true` | `false` | Re‑creating the same dir is a no‑op | |
| 206 | | `write_file` | `false` | `true` | `true` | Overwrites existing files | |
| 207 | | `edit_file` | `false` | `false` | `true` | Re‑applying edits can fail or double‑apply | |
| 208 | | `move_file` | `false` | `false` | `true` | Deletes source file | |
| 209 | |
| 210 | > Note: `idempotentHint` and `destructiveHint` are meaningful only when `readOnlyHint` is `false`, as defined by the MCP spec. Every tool also sets `openWorldHint: false` — this server only accesses the local filesystem within its allowed directories, never an open or external world. |
| 211 | |
| 212 | ## Usage with Claude Desktop |
| 213 | Add this to your `claude_desktop_config.json`: |
| 214 | |
| 215 | Note: you can provide sandboxed directories to the server by mounting them to `/projects`. Adding the `ro` flag will make the directory readonly by the server. |
| 216 | |
| 217 | ### Docker |
| 218 | Note: all directories must be mounted to `/projects` by default. |
| 219 | |
| 220 | |
| 221 | { |
| 222 | "mcpServers": { |
| 223 | "filesystem": { |
| 224 | "command": "docker", |
| 225 | "args": [ |
| 226 | "run", |
| 227 | "-i", |
| 228 | "--rm", |
| 229 | "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop", |
| 230 | "--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro", |
| 231 | "--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt", |
| 232 | "mcp/filesystem", |
| 233 | "/projects" |
| 234 | ] |
| 235 | } |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | |
| 240 | ### NPX |
| 241 | |
| 242 | |
| 243 | { |
| 244 | "mcpServers": { |
| 245 | "filesystem": { |
| 246 | "command": "npx", |
| 247 | "args": [ |
| 248 | "-y", |
| 249 | "@modelcontextprotocol/server-filesystem", |
| 250 | "/Users/username/Desktop", |
| 251 | "/path/to/other/allowed/dir" |
| 252 | ] |
| 253 | } |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | |
| 258 | On Windows, use `cmd /c` to launch `npx`: |
| 259 | |
| 260 | |
| 261 | { |
| 262 | "mcpServers": { |
| 263 | "filesystem": { |
| 264 | "command": "cmd", |
| 265 | "args": [ |
| 266 | "/c", |
| 267 | "npx", |
| 268 | "-y", |
| 269 | "@modelcontextprotocol/server-filesystem", |
| 270 | "/Users/username/Desktop", |
| 271 | "/path/to/other/allowed/dir" |
| 272 | ] |
| 273 | } |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | |
| 278 | ## Usage with VS Code |
| 279 | |
| 280 | For quick installation, click the installation buttons below... |
| 281 | |
| 282 | [![Install with NPX in VS Code]](https://insiders.vscode.dev/redirect/mcp/install?name=filesystem&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-filesystem%22%2C%22%24%7BworkspaceFolder%7D%22%5D%7D) [![Install with NPX in VS Code Insiders]](https://insiders.vscode.dev/redirect/mcp/install?name=filesystem&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40modelcontextprotocol%2Fserver-filesystem%22%2C%22%24%7BworkspaceFolder%7D%22%5D%7D&quality=insiders) |
| 283 | |
| 284 | [![Install with Docker in VS Code]](https://insiders.vscode.dev/redirect/mcp/install?name=filesystem&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fprojects%2Fworkspace%22%2C%22mcp%2Ffilesystem%22%2C%22%2Fprojects%22%5D%7D) [![Install with Docker in VS Code Insiders]](https://insiders.vscode.dev/redirect/mcp/install?name=filesystem&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22-i%22%2C%22--rm%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fprojects%2Fworkspace%22%2C%22mcp%2Ffilesystem%22%2C%22%2Fprojects%22%5D%7D&quality=insiders) |
| 285 | |
| 286 | For manual installation, you can configure the MCP server using one of these methods: |
| 287 | |
| 288 | **Method 1: User Configuration (Recommended)** |
| 289 | Add the configuration to your user-level MCP configuration file. Open the Command Palette (`Ctrl + Shift + P`) and run `MCP: Open User Configuration`. This will open your user `mcp.json` file where you can add the server configuration. |
| 290 | |
| 291 | **Method 2: Workspace Configuration** |
| 292 | Alternatively, you can add the configuration to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others. |
| 293 | |
| 294 | > For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation]. |
| 295 | |
| 296 | You can provide sandboxed directories to the server by mounting them to `/projects`. Adding the `ro` flag will make the directory readonly by the server. |
| 297 | |
| 298 | ### Docker |
| 299 | Note: all directories must be mounted to `/projects` by default. |
| 300 | |
| 301 | |
| 302 | { |
| 303 | "servers": { |
| 304 | "filesystem": { |
| 305 | "command": "docker", |
| 306 | "args": [ |
| 307 | "run", |
| 308 | "-i", |
| 309 | "--rm", |
| 310 | "--mount", "type=bind,src=${workspaceFolder},dst=/projects/workspace", |
| 311 | "mcp/filesystem", |
| 312 | "/projects" |
| 313 | ] |
| 314 | } |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | |
| 319 | ### NPX |
| 320 | |
| 321 | |
| 322 | { |
| 323 | "servers": { |
| 324 | "filesystem": { |
| 325 | "command": "npx", |
| 326 | "args": [ |
| 327 | "-y", |
| 328 | "@modelcontextprotocol/server-filesystem", |
| 329 | "${workspaceFolder}" |
| 330 | ] |
| 331 | } |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | |
| 336 | On Windows, use: |
| 337 | |
| 338 | |
| 339 | { |
| 340 | "servers": { |
| 341 | "filesystem": { |
| 342 | "command": "cmd", |
| 343 | "args": [ |
| 344 | "/c", |
| 345 | "npx", |
| 346 | "-y", |
| 347 | "@modelcontextprotocol/server-filesystem", |
| 348 | "${workspaceFolder}" |
| 349 | ] |
| 350 | } |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | |
| 355 | ## Build |
| 356 | |
| 357 | Docker build: |
| 358 | |
| 359 | |
| 360 | docker build -t mcp/filesystem -f src/filesystem/Dockerfile . |
| 361 | |
| 362 | |
| 363 | ## License |
| 364 | |
| 365 | This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository. |
| 366 |
Details
- Updated
- Sep 3, 2026
- License
- MIT
- Stars on the repo
- ★ 90,538
- Checked
- Source
- modelcontextprotocol/servers ↗
- Creator
- modelcontextprotocol · 7 listings
Similar MCP servers
See all →
SkillTests in real browsers via Chrome DevTools MCPBrowser testing with devtools
MCPThis MCP server attempts to exercise all the featuresEverything MCP Server
MCPA Model Context Protocol server that provides web contentFetch MCP Server
SkillAbout libraries, frameworks, API referencesContext7 MCP
SkillUses Chrome DevTools via MCP for efficient debugging
MCPLets your AI drive a real Chrome with DevTools: performanceChrome devtools MCPMore from modelcontextprotocol
MCPThis MCP server attempts to exercise all the featuresEverything MCP Server
MCPA Model Context Protocol server that provides web contentFetch MCP Server
MCPA basic implementation of persistent memory using a localKnowledge Graph Memory Server
MCPA Model Context Protocol server for Git repositorymcp-server-git: A git MCP server
MCPAn MCP server implementation that provides a toolSequential Thinking MCP Server
MCPA Model Context Protocol server that provides timeTime MCP Server