MCP File System Server

by asirulnik

368 downloads Not rated yet MIT license
GitHub

About

# MCP File System Server A simple Model Context Protocol (MCP) server providing file system operations. This server offers a clean API for performing file system operations within a specified project directory, following the MCP protocol design. ## Overview This MCP server enables AI assistants like Claude (via Claude…

Details

License
MIT license

Explore

- list_directory: List all files and directories in the project directory
- read_file: Read the contents of a file
- save_file: Write content to a file atomically
- append_file: Append content to the end of a file
- delete_this_file: Delete a specified file from the filesystem
- edit_file: Make selective edits using advanced pattern matching
- Structured Logging: Comprehensive logging system with both human-readable and JSON formats

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP File System Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository


python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

pip install -e .

python -m src.main --project-dir /path/to/project [--log-level LEVEL] [--log-file PATH]

Alternatively, you can add the current directory to your PYTHONPATH and run the script directly:

set PYTHONPATH=%PYTHONPATH%;.
python .\src\main.py --project-dir /path/to/project [--log-level LEVEL] [--log-file PATH]

1. Locate the Cline MCP configuration file:
- Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
- macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

2. Add the MCP server configuration (create the file if it doesn't exist):

{
  "mcpServers": {
    "filesystem": {
      "command": "C:\\path\\to\\mcp_server_filesystem\\.venv\\Scripts\\python.exe",
      "args": [
        "C:\\path\\to\\mcp_server_filesystem\\src\\main.py",
        "--project-dir",
        "C:\\Users\\YourUsername\\Documents\\Projects\\MyProject",
        "--log-level",
        "INFO"
      ],
      "env": {
        "PYTHONPATH": "C:\\path\\to\\mcp_server_filesystem\\"
      },
      "disabled": false,
      "autoApprove": [
        "list_directory",
        "read_file"
      ]
    }
  }
}

3. Important VSCode/Cline-specific notes:
- Replace ${workspaceFolder} with the actual full path to your project directory
- Example: "C:\\Users\\YourUsername\\Documents\\Projects\\MyProject"
- Replace all C:\\path\\to\\ instances with your actual paths
- Use double backslashes (\\) in paths on Windows, forward slashes (/) on macOS/Linux
- The project directory should be the folder you want Claude to access
- Only add operations to the autoApprove array that you want to be executed without requiring your approval each time
- For better security, consider only auto-approving read-only operations like list_directory and read_file

4. Restart VSCode and test by asking Claude to "List the files in my current project directory"

1. Locate the Claude Desktop configuration file:
- Windows: %APPDATA%\Claude\claude_desktop_config.json
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

2. Add the MCP server configuration (create the file if it doesn't exist):

{
  "mcpServers": {
    "filesystem": {
      "command": "C:\\path\\to\\mcp_server_filesystem\\.venv\\Scripts\\python.exe",
      "args": [                
        "C:\\path\\to\\mcp_server_filesystem\\src\\main.py",
        "--project-dir",
        "C:\\path\\to\\your\\specific\\project",
        "--log-level",
        "INFO"
      ],
      "env": {
        "PYTHONPATH": "C:\\path\\to\\mcp_server_filesystem\\"
      },
      "disabled": false,
      "autoApprove": [
        "list_directory",
        "read_file"
      ]
    }
  }
}

3. Important Claude Desktop-specific notes:
- You must specify an explicit project directory path in --project-dir
- Replace all C:\\path\\to\\ instances with your actual paths
- The project directory should be the folder you want Claude to access
- Only add operations to the autoApprove array that you want to be executed without requiring your approval each time
- For better security, consider only auto-approving read-only operations like list_directory and read_file

4. Restart the Claude Desktop app to apply changes

REM Clone the repository
git clone https://github.com/MarcusJellinghaus/mcp_server_filesystem.git
cd mcp-server-filesystem

REM Create and activate a virtual environment
python -m venv .venv
.venv\Scripts\activate

REM Install dependencies
pip install -e .

REM Install development dependencies
pip install -e ".[dev]"

```bash

Operation

Description

list_directory

Lists files and directories in the project directory

read_file

Reads the contents of a file

save_file

Creates or overwrites files atomically

append_file

Adds content to existing files

delete_this_file

Removes files from the filesystem

edit_file

Makes selective edits using pattern matching

The server exposes the following MCP tools:

| Operation | Description | Example Prompt |
|-----------|-------------|----------------|
| list_directory | Lists files and directories in the project directory | "List all files in the src directory" |
| read_file | Reads the contents of a file | "Show me the contents of main.js" |
| save_file | Creates or overwrites files atomically | "Create a new file called app.js" |
| append_file | Adds content to existing files | "Add a function to utils.js" |
| delete_this_file | Removes files from the filesystem | "Delete the temporary.txt file" |
| edit_file | Makes selective edits using pattern matching | "Fix the bug in the fetch function" |

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp file system server": {
            "mcp_server_filesystem_01": {
                "command": "python",
                "args": [
                    "-m",
                    "venv",
                    "venv"
                ]
            }
        }
    }
}

McpServers

{
    "mcp_server_filesystem_01": {
        "command": "python",
        "args": [
            "-m",
            "venv",
            "venv"
        ]
    }
}

A simple Model Context Protocol (MCP) server providing file system operations. This server offers a clean API for performing file system operations within a specified project directory, following the MCP protocol design.

Overview

This MCP server enables AI assistants like Claude (via Claude Desktop) or other MCP-compatible systems to interact with your local file system. With these capabilities, AI assistants can:

- Read your existing code and project files
- Write new files with generated content
- Update and modify existing files with precision using pattern matching
- Make selective edits to code without rewriting entire files
- Delete files when needed
- Review repositories to provide analysis and recommendations
- Debug and fix issues in your codebase
- Generate complete implementations based on your specifications

All operations are securely contained within your specified project directory, giving you control while enabling powerful AI collaboration on your local files.

By connecting your AI assistant to your filesystem, you can transform your workflow from manual coding to a more intuitive prompting approach - describe what you need in natural language and let the AI generate, modify, and organize code directly in your project files.

Features

- list_directory: List all files and directories in the project directory
- read_file: Read the contents of a file
- save_file: Write content to a file atomically
- append_file: Append content to the end of a file
- delete_this_file: Delete a specified file from the filesystem
- edit_file: Make selective edits using advanced pattern matching
- Structured Logging: Comprehensive logging system with both human-readable and JSON formats

Installation

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.