home / mcp / local file management mcp server

Local File Management MCP Server

Provides local file system operations (list, read, write) within a project directory using MCP.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "idoy12-mcp_test": {
      "command": "/path/to/your/venv/bin/python",
      "args": [
        "/path/to/server.py"
      ]
    }
  }
}

You can run a Local File Management MCP Server to perform file system operations—like listing, reading, and creating files—directly within your project directory. It runs locally and can be connected to MCP clients to manage project files efficiently.

How to use

Connect a client to the Local File Management MCP Server to perform common file operations from your development environment. You can list files in the project directory, read the contents of a file, or create new files. All actions are scoped to your project directory, with proper path validation and error handling to keep your filesystem safe.

How to install

Prerequisites and installation steps ensure you have a Python environment ready to run the MCP server locally.

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

```bash
pip install fastmcp
```

```bash
# Or install all project dependencies from a requirements file if you have it
pip install -r requirements.txt

Configuration and usage notes

The server runs from the directory that contains the server script. To change the base directory the server uses for file operations, modify the base path setting in the server script. For example, you can set PROJECT_BASE_PATH to the directory containing the script to ensure all operations happen within your intended project folder.

Example of a local runtime command to start the MCP server from your virtual environment:

# Start the server using the Python interpreter from your virtual environment
/path/to/your/venv/bin/python /path/to/server.py

Examples of connecting clients

Use a client configuration that points to the local server script via Python as shown below. This configuration is suitable for both Claude Desktop and Claude Code extensions when you want to run the MCP server locally.

{
  "type": "stdio",
  "name": "file_mcp",
  "command": "/path/to/your/venv/bin/python",
  "args": ["/path/to/server.py"]
}

Available tools

list_project_files

List files in the project directory, with an optional sub_folder parameter to scope the listing

read_file_content

Read the contents of a specified file by filename

create_new_file

Create a new file with a given filename and content