microsoft

filesystem MCP Server

Community microsoft
Updated

Cross platform file system server

filesystem MCP Server

Cross platform file system server

This is a Model Context Protocol (MCP) server project.

Setup and Installation

Simply run:

make

To create the virtual environment and install dependencies.

Running the Server

Use the VSCode launch configuration, or run manually:

The server requires specifying at least one allowed directory (for security reasons).

For stdio transport, specify directories using the --allowed_directories argument:

uv run -m mcp_server_filesystem.start --allowed_directories /path1 /path2 /path3

For SSE transport, you can start the server without specifying directories:

uv run -m mcp_server_filesystem.start --transport sse --port 6060

Setting Allowed Directories

The server uses "allowed directories" for security purposes. There are two ways to configure them:

  1. Command line arguments: Using --allowed_directories parameter (required for stdio transport)
  2. Root configuration: For SSE transport, the server can use the roots defined by the client

When using the root configuration approach, the MCP client sets the accessible directories through the session's list_roots() mechanism so each allowed directory must be set in the client's root configuration.

Tools Available

read_file

Reads the contents of a specific file.

write_file

Writes content to a specified file path. Creates the file if it does not exist.

list_directory

Lists all files and subdirectories within a specified directory.

create_directory

Creates a new directory or ensures an existing one remains accessible.

edit_file

Edits the contents of a text file with specified replacements. Supports a dry run mode to preview changes without applying them.

search_files

Recursively searches for files matching a pattern across subdirectories.

get_file_info

Retrieves and displays detailed metadata about a specified file or directory.

read_multiple_files

Reads the content of multiple files simultaneously and returns their contents in a dictionary. Files not accessible are marked with error messages.

move_file

Moves or renames a file or directory from a source path to a target destination.

list_allowed_directories

Returns a list of directories that the server is permitted to access.

Client Configuration

To use this MCP server in your setup, consider the following configuration:

Stdio

{
  "mcpServers": {
    "mcp-server-filesystem": {
      "command": "uv",
      "args": ["run", "-m", "mcp_server_filesystem.start", "--allowed_directories", "/path1", "/path2"]
    }
  }
}

SSE

{
  "mcpServers": {
    "mcp-server-filesystem": {
      "command": "http://127.0.0.1:6060/sse",
      "args": ["/path1", "/path2"]
    }
  }
}

The args will be automatically joined with commas and added as a query parameter named 'args'.

Direct URL Configuration

If you prefer, you can also configure the URL directly with the args parameter already included:

{
  "mcpServers": {
    "mcp-server-filesystem": {
      "command": "http://127.0.0.1:6060/sse?args=/path1,/path2,/path3",
      "args": []
    }
  }
}

This approach is more verbose but might be preferable in some configurations.

MCP Server · Populars

MCP Server · New

    w1ckedxt

    Cynical Sally

    Brutally honest senior-engineer code reviews for Claude Code, Cursor & Windsurf - and your terminal. Scores, evidence-backed issues, usable fixes.

    Community w1ckedxt
    Minidoracat

    MCP Feedback Enhanced

    Enhanced MCP server for interactive user feedback and command execution in AI-assisted development, featuring dual interface support (Web UI and Desktop Application) with intelligent environment detection and cross-platform compatibility.

    Community Minidoracat
    caidish

    InstrMCP: Instrumentation Control MCP Server

    AI's quantum device physics laboratory's instrumentation control

    Community caidish
    ahmedeltaher

    Azan-MCP

    Azan + Prayer Time + MCP + AI Agents + Islamic + Salah + A lightweight MCP library to calculate prayer times and trigger Azan with a single tool call. If you’re building an AI agent or prayer application, there’s no need to deal with astronomical calculations, timezones, or edge cases again.

    Community ahmedeltaher
    Agent-Pattern-Labs

    Geometra

    The Browser for the Singularity! No browser. Just computed geometry going straight to pixels. MCP replacement for Playwright too!

    Community Agent-Pattern-Labs