MCP Directory

How to add MCP Filesystem Server to Cursor

Secure local filesystem access for MCP clients — read, write, search, and manage files within allowed directories. Paste the config into ~/.cursor/mcp.json and restart Cursor.

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

Cursor 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 Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
  2. 2Paste the MCP Filesystem Server config below into the "mcpServers" object.
  3. 3Fill in placeholder secrets, then save.
  4. 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
  5. 5Ask Cursor to use one of MCP Filesystem Server's tools to confirm it's connected.

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 Cursor

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 + Cursor FAQ

Where is the Cursor config file?

Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the MCP Filesystem Server config there under the "mcpServers" key and restart the client.

Is MCP Filesystem Server safe to use with Cursor?

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