Back to MCP Servers

@modelcontextprotocol/server-filesystem

OFFICIAL

Reference 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
Official documentation