MCP servers / Filesystem
Filesystem MCP server: setup for Claude Code, Claude Desktop and Cursor
The Filesystem server lets your AI read, search, edit and move files, but only inside the folders you name when the server starts. Anything outside those folders is off limits.
Claude Code and Cursor already work with your project files, so this server matters most in Claude Desktop, or when you want to give the AI one specific folder outside your project.
- Runs with
- npx (Node.js)
- Package
- @modelcontextprotocol/server-filesystem on npm
- Needs
- Node.js (for npx) and at least one folder to allow.
- Tools
- 14 (10 read-only, 4 can change things)
- Source
- modelcontextprotocol/servers
- Last checked
- 2026-09-20 (server reported version 0.2.0)
Config for Filesystem
Generated by the same code as the free builder, so it matches what you get there. Pick your client, then copy.
Replace /path/to/your/project with the folder the AI may access.
Claude Code
Save as .mcp.json in your project root. Claude Code asks you to approve it the first time.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/your/project"
]
}
}
}
Or add it from a terminal instead (single quotes work in bash, zsh and PowerShell; more on this command):
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem /path/to/your/project
Claude Desktop
Merge into claude_desktop_config.json (Settings → Developer → Edit Config), then fully quit and restart Claude Desktop.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/your/project"
]
}
}
}
Cursor
Save as .cursor/mcp.json in your project, or ~/.cursor/mcp.json for all projects.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/your/project"
]
}
}
}
What it can do
These are all 14 tools the server reported when we started it and asked on 2026-09-20. The labels come from the hints each tool declares about itself.
read_fileread-only
Read the complete contents of a file as text.read_text_fileread-only
Read the complete contents of a file from the file system as text.read_media_fileread-only
Read a file and return it as a base64-encoded content block with its MIME type.read_multiple_filesread-only
Read the contents of multiple files simultaneously.write_filecan change things
Create a new file or completely overwrite an existing file with new content.edit_filecan change things
Make line-based edits to a text file.create_directorycan change things
Create a new directory or ensure a directory exists.list_directoryread-only
Get a detailed listing of all files and directories in a specified path.list_directory_with_sizesread-only
Get a detailed listing of all files and directories in a specified path, including sizes.directory_treeread-only
Get a recursive tree view of files and directories as a JSON structure.move_filecan change things
Move or rename files and directories.search_filesread-only
Recursively search for files and directories matching a pattern.get_file_inforead-only
Retrieve detailed metadata about a file or directory.list_allowed_directoriesread-only
Returns the list of directories that this server is allowed to access.
Watch out for
- Replace
/path/to/your/projectwith a real folder. The README says the server needs at least one allowed folder to work. - It has no tool that deletes files. But
write_filecreates a file or completely overwrites an existing one, andmove_filerenames things, so a wrong path can still cost you work. Keep the folder in git. - Give it the smallest folder that does the job. Never your whole drive or your home folder.
- Seeing "Access denied - path outside allowed directories"? The file is outside the folders you named. See the fix.
Variations
Allow more than one folder
Add each extra folder as another argument at the end. Every folder is fully reachable, so add only the ones you need.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/your/project",
"/path/to/another/folder"
]
}
}
}
The same in Claude Code, Claude Desktop and Cursor.
Try asking
- “List the folders you are allowed to access.”
- “Find every file under src that contains a TODO comment and group them by folder.”
- “Read package.json and tell me which dependencies look unused.”
Related servers
- Git: Check status, diffs and history, and make commits and branches in a local repository.
- Memory: A simple knowledge graph the AI can remember things in.
Building a full setup? Combine this with other servers in the config builder. Trouble connecting? See fixing connection errors.