Get the FREE Ultimate OpenClaw Setup Guide →

mcp-file-edit

A simple MCP server for file system operations, ideal for vide-coding type activities.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio patrickomatik-mcp-file-edit uv run mcp run /path/to/mcp-file-edit/server.py

How to use

mcp-file-edit provides a comprehensive set of file system operations via the MCP protocol. It supports reading, writing, creating, deleting, moving, and copying files, as well as directory listing and recursive operations. The server also includes powerful search and replace capabilities using regex patterns, and a patching workflow that supports line-based, pattern-based, and context-based modifications. For code projects, it offers code analysis utilities to extract functions, classes, and overall structure, which can help with quick introspection and documentation generation. Safety features such as path traversal protection and project boundary enforcement help prevent accidental changes outside the working directory, and backups with dry-run and atomic operations help ensure modifications are safe. SSH transfer support and git integration extend its usefulness for remote work and versioned projects.

To use the tools, configure Claude Desktop (or your MCP client) to point to the file-edit server. Typical usage involves setting a project directory to establish a base path, then invoking operations like read_file, write_file, list_files, search_files, and patch_file. The toolset also exposes high-level helpers such as set_project_directory to switch between local and remote workspaces, and list_functions or get_code_structure for code analysis tasks. Remember to enable dry-run mode if you want to preview changes before applying them.

How to install

Prerequisites:

  • Python 3.8+ installed on the host machine
  • Git installed
  • uv (Python package runner) installed or access to a Python environment

Option A: Install via uv (recommended)

  1. Clone the repository: git clone https://github.com/patrickomatik/mcp-file-edit.git
  2. Install in editable mode using uv: cd mcp-file-edit uv pip install -e .

Option B: Install via pip

  1. Clone the repository: git clone https://github.com/patrickomatik/mcp-file-edit.git
  2. Install in editable mode using pip: cd mcp-file-edit pip install -e .

Option C: Run directly from source (for development)

  1. Ensure dependencies are installed: uv pip install -e .
  2. Run the server script as needed via the MCP client configuration (see mcp_config example).

Additional notes

Notes and tips:

  • The recommended deployment uses uv to run the Python-based MCP server. The example mcp_config uses the path to your server.py; adjust /path/to/mcp-file-edit/server.py to your actual location.
  • If you plan to access the server remotely, consider enabling SSH-based project directories and using ssh:// style paths as described in the SSH support section of the README.
  • When applying patches or performing destructive operations, enable backup and dry-run modes to minimize risk.
  • Ensure your working directory is properly sandboxed to avoid accidental modifications outside the intended project tree.
  • For large codebases, consider enabling depth controls in search operations to improve performance and avoid excessive scanning.

Related MCP Servers

Sponsor this space

Reach thousands of developers