Overview
Filesystem MCP Server is a secure Model Context Protocol (MCP) server that provides filesystem operations with controlled access to specified directories.
To use the Filesystem MCP Server, install it using Go, configure the allowed directories via environment variables, and integrate it with your application by specifying the MCP server in your configuration file.
- Directory access controlled via environment variables - File operations within allowed directories only - Thread-safe caching of allowed directories - Proper handling of paths with spaces - Security measures including path traversal prevention and permission validation
- Securely managing file operations in multi-user environments.
- Providing controlled access to sensitive directories in applications.
- Implementing file management features in desktop applications.
Add to your AI client
Use these steps to connect Filesystem MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"filesys-gomcpgo": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesys-gomcpgo"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"filesys-gomcpgo": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesys-gomcpgo"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"filesys-gomcpgo": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesys-gomcpgo"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"filesys-gomcpgo": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesys-gomcpgo"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"filesys-gomcpgo": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesys-gomcpgo"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"filesys-gomcpgo": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesys-gomcpgo"
]
}
}
}FAQ
Is the Filesystem MCP Server secure?
Yes! It restricts all operations to allowed directories and includes security measures to prevent unauthorized access.
How do I configure allowed directories?
You can set allowed directories using the environment variable MCP_ALLOWED_DIRS.
Can I read multiple files at once?
Yes! The server supports reading multiple files simultaneously with the read_multiple_files command.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":1855,"uuid":"8c85e584-62e5-4c93-9ac7-d98396052fee","name":"filesys","title":"Filesystem MCP Server","description":"Enhanced FileSystem MCP server","avatar_url":"https://avatars.githubusercontent.com/u/193576529?v=4","created_at":"2025-03-05T05:41:40.329Z","updated_at":"2025-03-12T10:21:15.457Z","status":"created","author_name":"gomcpgo","author_avatar_url":"https://avatars.githubusercontent.com/u/193576529?v=4","tags":"[]","category":"file-systems","is_featured":false,"sort":1,"url":"https://github.com/gomcpgo/filesys","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"1\",\"license\":\"\",\"language\":\"Go\",\"is_official\":false,\"latest_commit_time\":\"2025-04-09 08:30:42\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]