# fedit [Health: Active]

**Category:** 📂 File Systems  
**Repository:** https://github.com/amalexico/fedit  
**GitHub Stars:** 12  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/fedit

## Description
Go-based MCP server for surgical file editing: anchored insert, delete, replace, move, copy.

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/amalexico/fedit), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
go install github.com/amalexico/fedit@latest
```

## Documentation

## What fedit MCP server does

fedit MCP server brings fedit's surgical file-editing model to MCP-based agents. It is designed for changes where the target should be explicit: a line range, a matching line, a pair of content anchors, or a named occurrence. The supported editing model includes inserting before or after a match, replacing selected content, deleting content, moving and copying blocks, and writing new data.

The underlying fedit program is a zero-dependency Go command-line tool. It works with paths supplied by the caller and avoids modifying files that were not explicitly named. Mutations can be verified after they are applied, helping an automation workflow detect an unsuccessful change rather than continuing silently.

## How it works

Operations can target absolute or relative line positions, matching text, or structural boundaries. A search can first locate matching lines and provide occurrence information for a later targeted edit. Occurrence selection supports choosing a particular match, including the last one, which is useful when the same marker appears repeatedly in a configuration file.

For larger inputs, streaming mode processes data line by line. It supports `find` and `replaceall`, including literal and regular-expression replacement, without loading the complete file into memory. Streaming writes use a temporary file followed by a rename, preserving the original if processing is interrupted. The streaming path supports lines up to a 10 MB buffer.

The `map` operation displays file structure for 21 supported languages. `fields` extracts a selected column from delimited data and always streams its output; tab is the default delimiter, with alternatives such as commas or colons available through configuration.

## Setup and configuration

Install the standalone binary with Go:

```bash
go install github.com/amalexico/fedit@latest
```

Alternatively, download a binary from the project's GitHub Releases and place it on `PATH`. A basic installation check is:

```bash
fedit -file /etc/hostname -op show
```

The command-line interface uses `-file` to identify the input, `-op` to select an operation, and operation-specific flags such as `-line`, `-end`, `-match`, `-text`, and `-v`. Multiple files can be supplied as a comma-separated list or glob, and a destination can be used for cross-file copy, move, and replace operations.

## Tools and capabilities

- Display complete files or selected line ranges.
- Find lines containing a substring and use match occurrences as edit targets.
- Insert content before or after line or content anchors.
- Replace or delete line ranges and anchored sections.
- Move and copy blocks, including cross-file operations.
- Perform global literal or regular-expression replacements.
- Write literal text, raw backslashes, file contents, or hex-encoded input.
- Extract delimited columns for shell pipelines.
- Map the structure of supported programming-language files.
- Verify mutations and report replacement verification status.

## Limitations and notes

Streaming mode is limited to `find` and `replaceall`; `move`, `copy`, and `map` require the full file structure in memory. Lines shorter than the requested field number are skipped during field extraction. The raw writer treats sequences such as `\\n` as literal backslash and `n` characters rather than expanding them into newlines. Interactive line entry is available through the CLI's `writelines` operation, while MCP workflows are better suited to supplying explicit content and anchors.

_Full upstream README: https://allmcps.com/mcp/fedit/readme_

