Filesystem Storage for MCP Servers

Learn how to implement local filesystem storage for Model Context Protocol servers

Install on VS Code using docker

{
  "mcpServers": {
    "filesystem": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
        "--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
        "--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
        "mcp/filesystem",
        "/projects"
      ]
    }
  }
}

Overview

Node.js server implementing Model Context Protocol (MCP) for filesystem operations. The MCP Filesystem Server provides a simple and direct way to store model context data using local filesystem storage. It's part of the Model Context Protocol (MCP) system, offering a reliable way to persist AI context data using the local filesystem.

Features:

  • Read/write files
  • Create/list/delete directories
  • Move files/directories
  • Search files
  • Get file metadata
  • Built-in file integrity checks
  • Automatic cleanup of temporary files

Note: The server will only allow operations within directories specified via args. 1

Tools

Sources

Footnotes

  1. https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem