MCP.so
Sign In

MCP Filesystem Server

@mark3labs

About MCP Filesystem Server

Go server implementing Model Context Protocol (MCP) for filesystem operations.

Basic information

Category

Files & Storage

License

MIT

Runtime

go

Transports

stdio

Publisher

mark3labs

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "mcp-filesystem-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/mark3labs/mcp-filesystem-server:latest",
        "/path/to/allowed/directory"
      ]
    }
  }
}

Tools

No tools detected

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is MCP Filesystem Server?

MCP Filesystem Server provides secure access to the local filesystem through the Model Context Protocol (MCP). It is intended for applications that support MCP and need controlled file read, write, search, and directory operations.

How to use MCP Filesystem Server?

Install via go install github.com/mark3labs/mcp-filesystem-server@latest. Start the server by specifying one or more allowed directories as arguments, for example mcp-filesystem-server /path/to/allowed/directory. It can also be used as a Go library or run in Docker. Integrate with MCP-compatible apps by adding the server to the mcpServers configuration.

Key features of MCP Filesystem Server

  • Secure access to specified directories only
  • Path validation to prevent directory traversal attacks
  • Symlink resolution with security checks
  • MIME type detection for files
  • Support for text, binary, and image files
  • Size limits for inline content and base64 encoding

Use cases of MCP Filesystem Server

  • Read file contents for analysis or summarization by an LLM
  • Write generated content to local files
  • Search for files by name or text within a directory tree
  • Manage directory structures (create, list, copy, move, delete)
  • Retrieve detailed metadata about files and directories

FAQ from MCP Filesystem Server

What directories can the server access?

The server only accesses directories that are explicitly passed as arguments at startup. The list_allowed_directories tool returns this list.

How does the server ensure security?

It performs path validation to prevent directory traversal attacks and symlink resolution with security checks, ensuring operations stay within allowed directories.

Can I run the server in Docker?

Yes. A Docker image is available at ghcr.io/mark3labs/mcp-filesystem-server:latest. You can mount host volumes to allow the container to modify files on the host.

What file types does the server support?

It supports text, binary, and image files. MIME type detection is included.

Are there any size limits?

Yes, the server enforces size limits for inline content and base64 encoding, though the exact limits are not specified in the README.

Comments

More Files & Storage MCP servers