Labsco
MCP SERVER

MCP File Edit

by patrickomatik

Read, patch and analyse code files — locally or over SSH — with a project directory that keeps paths short.

Local Filesystem Access
Summary
The code-analysis tools are what separate this from a plain filesystem server.

Asking which function contains a given line, or listing every function with its signature and line span, answers a structural question without the model reading the whole file first. The context-based patch is the one to reach for when it matters: it matches surrounding lines rather than line numbers, so the edit still lands correctly after the file has shifted.

What it is

A Python file-operations server: reading and writing, glob listing, regex search and replace across files, three kinds of precise patching, code structure analysis, git operations, and the same set against a remote host over SSH.

What you get
  • Files — `read_file` with an optional line range, `write_file`, `create_file`, `delete_file`, `move_file`, `copy_file`
  • Directories — `list_files` with glob patterns and depth control, `get_file_info` for metadata
  • Search and change — `search_files` with regex support, `replace_in_files` across many files at once, `patch_file` for line-based, pattern-based or context-based edits
  • Code structure — `list_functions` returns names, signatures, line numbers and docstrings; `get_function_at_line` finds the function containing a line; `get_code_structure` extracts imports, classes and functions; `search_functions` matches functions by name pattern
  • `set_project_directory` and `get_project_directory`, so every later call takes a short relative path
  • SSH mode — connect with a URL or explicit parameters and every file operation runs on the remote machine, plus upload, download and rsync directory sync
  • Git from the same place: status, init, clone, stage, commit, push, pull, log, branches, diff and remotes
Requirements

Install `mcp-file-edit` with uv or pip and point your client at it. Nothing else for local work; SSH mode takes a connection URL or the host, user and key as separate parameters.

Setup effort

One command — uv pip install -e .