src_filesystem

src_filesystem

by modelcontextprotocol
A Node.js server implementing Model Context Protocol (MCP) for filesystem operations like read/write, directory management, and file search.

Filesystem MCP Server

Overview

The Filesystem MCP Server is a Node.js server that implements the Model Context Protocol (MCP) for performing filesystem operations. It provides a robust set of tools for managing files and directories, enabling seamless integration with applications like Claude Desktop.

Features

  • Read/Write Files: Read complete contents of files or write new content.
  • Directory Management: Create, list, and delete directories.
  • File/Directory Movement: Move or rename files and directories.
  • File Search: Recursively search for files/directories using patterns.
  • Metadata Retrieval: Get detailed metadata for files and directories.

Tools

File Operations

  • read_file: Reads the complete contents of a file with UTF-8 encoding.
  • read_multiple_files: Reads multiple files simultaneously, continuing even if some reads fail.
  • write_file: Creates a new file or overwrites an existing one.
  • edit_file: Makes selective edits using advanced pattern matching and formatting. Supports previewing changes with dry run mode.

Directory Operations

  • create_directory: Creates a new directory or ensures it exists.
  • list_directory: Lists directory contents with [FILE] or [DIR] prefixes.
  • move_file: Moves or renames files and directories.

Search and Metadata

  • search_files: Recursively searches for files/directories using patterns and excludes.
  • get_file_info: Retrieves detailed metadata for files/directories, including size, creation time, and permissions.
  • list_allowed_directories: Lists all directories the server is allowed to access.

Configuration

Usage with Claude Desktop

To integrate the Filesystem MCP Server with Claude Desktop, add the following configuration to your claude_desktop_config.json file:

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"
      ]
    }
  }
}

NPX

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/username/Desktop",
        "/path/to/other/allowed/dir"
      ]
    }
  }
}

Build

To build the Docker image, run the following command:

docker build -t mcp/filesystem -f src/filesystem/Dockerfile .

License

The Filesystem MCP Server is licensed under the MIT License. You are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, refer to the LICENSE file in the project repository.

Features & Capabilities

Categories
mcp_server model_context_protocol nodejs filesystem api_integration docker search claude

Implementation Details

Stats

0 Views
27 GitHub Stars

Repository Info

modelcontextprotocol Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300