Line-range edits are the right primitive for an agent — they keep a change small enough to review and cheap enough to retry — but they are also easy to get wrong by one line. Automatic backups plus `get_file_diff` mean a bad edit is recoverable rather than a restore from version control. Treat `run_command` with the caution any shell deserves: the filter reduces the blast radius, it does not remove it.
A Python MCP server for working on a local machine: reading and writing files, editing them by line number, searching across a tree with regex and context lines, running commands, and validating or formatting code. Every modification is backed up first and recorded in an edit history.
- Line-level editing rather than whole-file rewrites — `edit_file_lines`, `insert_lines` and `delete_lines` change only the range you name, and `get_file_lines` reads one back
- Project-wide search and replace — `search_adv` takes include and exclude patterns, file-type groups, case and whole-word flags, regex, and context lines; `replace_adv` does the same with a `dry_run` and a backup switch
- Finding by name or content — `search_files_by_name`, `search_in_files`, `find_files` and `get_search_stats` for the size and type distribution of a tree
- Basic file operations with metadata — `list_files`, `read_file`, `write_file`, `get_file_info`
- An undo trail: `get_edit_history` lists what changed, `get_file_diff` compares a file against its backup
- System and code helpers — `run_command` under safety restrictions, `get_system_info`, `get_running_processes`, `validate_syntax` and `format_code` through Black or Prettier
Python, with an install script that creates a virtual environment and installs dependencies; the package is `mcp-local`, version 1.0.0, and the console entry point is `mcp-local`. The client launches the run script or the module directly. Path validation blocks directory traversal, file size limits are configurable, and dangerous commands are filtered out of `run_command`.
