Official MCP reference server for secure local file operations, restricted to a configurable list of allowed directories.
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem '<dir>'~/.codex/config.toml
[mcp_servers.filesystem]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "<dir>"]
# codex mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem '<dir>'~/.cursor/mcp.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<dir>"
]
}
}
}.vscode/mcp.json
{
"servers": {
"filesystem": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<dir>"
]
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<dir>"
]
}
}
}claude_desktop_config.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<dir>"
]
}
}
}.trae/mcp.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"<dir>"
]
}
}
}