Back to MCP ServersOfficial documentation
@modelcontextprotocol/server-filesystem
OFFICIALReference filesystem access for agents. Read, write, list, move, and search files within explicitly allowed directories.
Category: Core · Works with: Claude Code, Grok Build, Claude Desktop, Cursor, VS Code, Codex CLI, Gemini CLI
What it does
Gives the agent the ability to explore and modify the local filesystem, sandboxed to the directories you pass on the command line.
Install
npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/dir
Setup Instructions
claude Code
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem ~/projects
grok Build
Grok Build is MCP-native and reuses your existing servers. Add this one in Grok Build's MCP settings with the same command: npx -y @modelcontextprotocol/server-filesystem ~/projects
claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"]
}
}
}cursor
Settings → MCP → Add new MCP server: Command: npx Args: -y @modelcontextprotocol/server-filesystem /Users/you/code
Compatible Agents
Claude CodeGrok BuildClaude DesktopCursorVS CodeCodex CLIGemini CLI
Related MCP Servers
GitHub MCP Server
GitHub's official MCP server. Manage issues, PRs, branches, workflows, and code scanning — or just let the agent read your repos.
mcp-server-git
Reference Git server. Status, diff, log, branch, commit, and search — structured Git operations for repos the agent works in.
Supabase MCP
Supabase's official server. Query the database, apply migrations, manage config, fetch logs, and generate TypeScript types from your agent.