Filesystem MCP Server

Official

Read, search and edit files inside allowed directories with the Model Context Protocol reference Filesystem server.

Local serverstdioTypeScriptMIT★ 63.0k

What is the Filesystem MCP Server?

The reference Filesystem MCP server provides file operations within configured access directories. It can help an assistant inspect a project, locate relevant files and make requested edits using the documented filesystem tools.

Choose a directory with a clear purpose

The startup arguments specify the directories the server may access; compatible clients can also provide MCP Roots. Start with the project folder needed for the task. Ask for paths and excerpts when investigating a setting, and inspect the resulting diff when requesting an edit.

Distinguish the reference implementation

The npm package is @modelcontextprotocol/server-filesystem. Several community projects have similar names but different packages and controls. This reference server includes write operations; do not assume that a file-access connection is read-only because the first request is a search. Consult its tool reference before choosing the allowed directories.

Setup and tool documentation. Explore related MCP servers.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
read_text_fileRead a file as text.
list_directoryList directory contents.
search_filesSearch for paths within the allowed directories.
edit_fileApply documented text edits to a file.
list_allowed_directoriesInspect the directories currently allowed.

How to install the Filesystem MCP Server

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/project"
      ]
    }
  }
}

Replace /path/to/project. This reference implementation exposes write tools as well as read tools.

Configuration

Node.js with npx. Replace the example directory with the specific folder you want the server to access.

Example prompts to try

  • “Find the API base URL setting inside the allowed project folder and show its path and value.”

Frequently asked questions

Pass allowed directories as startup arguments, or use client-provided MCP Roots where supported.