# tumf/mcp-text-editor [Health: Active]

**Category:** 📂 File Systems  
**Repository:** https://github.com/tumf/mcp-text-editor  
**GitHub Stars:** 202  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/tumf-mcp-text-editor

## Description
A line-oriented text file editor. Optimized for LLM tools with efficient partial file access to minimize token usage.

## Tools
Capabilities this server exposes over MCP:

- **file_path** — Absolute path to the text file
- **start** — First line to read (1-based)
- **end** — Last line to read (inclusive); `null` reads through end of file
- **encoding** — File encoding for all requested files (default: `utf-8`)

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "mcp-text-editor": {
    "command": "uvx",
    "args": ["mcp-text-editor"]
  }
}
```

## Documentation

## What tumf/mcp-text-editor MCP server does

tumf/mcp-text-editor MCP server gives MCP clients a line-based interface for reading and changing local text files. Reads can target selected portions of one file or several files in a single request, which avoids loading complete large files when only a few sections are relevant. File paths must be absolute, and line numbering starts at 1.

The editor is intended for text-file workflows where an agent needs to inspect content, modify known ranges, and verify that the file has not changed unexpectedly. It supports multiple character encodings, including UTF-8, Shift JIS, and Latin-1, and reports errors for missing files, permissions, invalid ranges, decoding failures, and conflicting edits.

## How it works

Use `get_text_file_contents` to request one or more ranges. The response is keyed by absolute path and includes the selected content, total line count, content size, a hash for the complete file, and a hash for each returned range.

To modify content, call `patch_text_file_contents` with the file hash and the matching hash for every range being replaced. The server applies non-overlapping patches from the bottom of the file upward, so earlier line positions remain usable while later sections change. If either the file or selected range no longer matches, the operation returns an error and indicates that the file should be read again.

The repository also documents `append_text_file_contents`, `insert_text_file_contents`, and `delete_text_file_contents` for operations that add, place, or remove text. Reads and writes should use the same encoding. Hashes are based on SHA-256, and modifications are checked to reduce race conditions between separate processes.

## Setup and configuration

The documented Claude Desktop configuration launches the package with `uvx`:

```json
{
  "mcpServers": {
    "text-editor": {
      "command": "uvx",
      "args": ["mcp-text-editor"]
    }
  }
}
```

The server can also be started with `python -m mcp_text_editor`. Installation instructions use Python 3.13 or newer, along with `uv` or `pip`; an earlier requirements section lists Python 3.11 or newer, so confirm the version expected by the package revision you install. Smithery provides a Claude Desktop installation command as an alternative to manual setup.

The process needs filesystem permissions for the files it accesses. Its path validation and input checks are intended to prevent directory traversal and reject malformed requests, but deployment should still restrict the process to appropriate directories and permissions.

## Tools and capabilities

- Read selected line ranges from multiple files in one call.
- Replace non-overlapping ranges using current file and range hashes.
- Append, insert, or delete text through dedicated operations.
- Specify a shared encoding for requested files and edits.
- Process large files without requiring every line in the response.
- Detect concurrent changes and return structured error details.
- Perform multiple file operations supported by the server’s API.

When a hash mismatch occurs, call the read tool again immediately, inspect the current ranges, and retry with fresh hashes. Smaller ranges can also reduce memory and token use for large files.

_Full upstream README: https://allmcps.com/mcp/tumf-mcp-text-editor/readme_

