MCP Directory

How to add MCP Filesystem Server to Windsurf

Secure local filesystem access for MCP clients — read, write, search, and manage files within allowed directories. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.

Last updated June 14, 2026 · 654 · stdio · no auth

Windsurf config for MCP Filesystem Server

go install github.com/mark3labs/mcp-filesystem-server@latest
{
  "mcpServers": {
    "mcp-filesystem-server": {
      "command": "mcp-filesystem-server",
      "args": [
        "/path/to/allowed/directory",
        "/another/allowed/directory"
      ]
    }
  }
}

Setup steps

  1. 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
  2. 2Paste the MCP Filesystem Server config below.
  3. 3Fill in placeholder secrets, then save.
  4. 4Click Refresh in the MCP panel.
  5. 5MCP Filesystem Server's tools become available to Cascade.

Before you start

  • Go (for `go install`) or Docker (to run the container image)
  • One or more local directories to expose, passed as command arguments

What MCP Filesystem Server can do in Windsurf

read_file

Read the complete contents of a file from the file system. Parameters: path (required).

read_multiple_files

Read the contents of multiple files in a single operation. Parameters: paths (required, list of file paths).

write_file

Create a new file or overwrite an existing file with new content. Parameters: path (required), content (required).

copy_file

Copy files and directories. Parameters: source (required), destination (required).

move_file

Move or rename files and directories. Parameters: source (required), destination (required).

delete_file

Delete a file or directory from the file system. Parameters: path (required), recursive (optional, default false).

modify_file

Update a file by finding and replacing text using string matching or regex. Parameters: path (required), find (required), replace (required), all_occurrences (optional, default true), regex (optional, default false).

list_directory

Get a detailed listing of all files and directories in a specified path. Parameters: path (required).

Security

Access is restricted to the directories passed as command arguments. The server performs path validation to prevent directory-traversal attacks and resolves symlinks with security checks. Use the list_allowed_directories tool to see which directories are accessible. When using Docker, mount a host volume only if you intend changes inside the container to reflect on the host filesystem.

MCP Filesystem Server + Windsurf FAQ

Where is the Windsurf config file?

Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the MCP Filesystem Server config there under the "mcpServers" key and restart the client.

Is MCP Filesystem Server safe to use with Windsurf?

Access is restricted to the directories passed as command arguments. The server performs path validation to prevent directory-traversal attacks and resolves symlinks with security checks. Use the list_allowed_directories tool to see which directories are accessible. When using Docker, mount a host volume only if you intend changes inside the container to reflect on the host filesystem.

How is filesystem access restricted?

The server only accesses the directories you pass as command arguments at startup. It validates paths to prevent directory-traversal attacks and resolves symlinks with security checks. The list_allowed_directories tool returns the directories currently accessible.

What transport does it use?

It runs as a standalone stdio server, launched via the `mcp-filesystem-server` command (or `docker run`) with allowed directories as arguments.

Can I use it inside a Go program instead of as a standalone server?

Yes. Import github.com/mark3labs/mcp-filesystem-server/filesystemserver, create a server with NewFilesystemServer(allowedDirs), and call Serve().

View repo Full MCP Filesystem Server page