MCP Text Editor logo

MCP Text Editor

by tumf

Edits text files by line range, returning hashes for partial reads and validating changes before applying patches.

Install MCP Text Editor

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "tumf-mcp-text-editor": {
      "command": "uvx",
      "args": [
        "mcp-text-editor"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

tumf/mcp-text-editor MCP server exposes line-oriented text file reads and edits through MCP. It accepts absolute file paths, 1-based line ranges, and an optional encoding, allowing clients to retrieve only the needed portions of one or more files. Editing uses whole-file and range SHA-256 hashes to detect changes made after a read, while specialized append, insert, and delete operations support common modifications. Reach for it when an agent needs token-conscious access to local text files or must avoid overwriting concurrent edits.

Use cases

  • Read only the relevant lines from large source or text files
  • Patch known line ranges without replacing an entire file
  • Detect concurrent edits before writing changes
  • Apply append, insert, and delete operations to local text files

Key features

  • Line-range reads with 1-based positions
  • Multi-file and multi-range retrieval
  • SHA-256 file and range validation
  • Non-overlapping line patches
  • Multiple text encodings
  • Large-file-conscious processing

Tools4

What MCP Text Editor lets your agent do. Expand a tool for its parameters.

Self-reported~51 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

10/11 checks healthy over the last 78d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 11d ago via OSV.dev · mcp-text-editor (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars202Stargazers on the source repository.
Last commit1mo agoMost recent push to the default branch.
Tools exposed4Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Text Editor works

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:

config.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.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Text Editor

tumf/mcp-text-editor is an MCP server that connects AI clients to local text files through line-oriented operations. Its main tools read selected ranges with get_text_file_contents, apply validated changes with patch_text_file_contents, and support append, insert, and delete operations. It uses hashes to detect edits made between reading and writing.

Install it with uvx or run it from a Python environment, then register its command with your MCP client. The documented options use Python 3.13 or newer, `uv`, and either `uvx mcp-text-editor` or `python -m mcp_text_editor`. Smithery also provides a Claude Desktop installation command.

Add an MCP server entry whose command is `uvx` and whose argument is `mcp-text-editor`, or install it through Smithery for Claude Desktop.

Read the target range immediately before editing and pass both the returned whole-file hash and matching range hash to the patch operation. If either hash no longer matches, the server rejects the change; read the file again and retry with fresh hashes.

Yes, request one or more 1-based line ranges and set `end` to `null` when the range should continue through the end of the file. The response includes only the requested content, along with hashes and size information.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Text Editor AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/tumf-mcp-text-editor?style=directory)](https://allmcps.com/mcp/tumf-mcp-text-editor)
HTML Embed
<a href="https://allmcps.com/mcp/tumf-mcp-text-editor"><img src="https://allmcps.com/api/badge/tumf-mcp-text-editor?style=directory" alt="MCP Text Editor on AllMCPs" /></a>