tumf/mcp-text-editor
Free面向行的文本文件编辑器。针对 LLM 工具优化,通过高效的部分文件访问最小化 Token 使用。
About tumf/mcp-text-editor
MCP Text Editor Server is a Model Context Protocol (MCP) server that provides line-oriented text file editing capabilities through a standardized API. Designed to facilitate safe and efficient line-based text file operations in a client-server architecture, it implements the Model Context Protocol to ensure reliable file editing with robust conflict detection and resolution. The line-oriented approach makes it ideal for applications requiring synchronized file access, such as collaborative editing tools, automated text processing systems, or any scenario where multiple processes need to modify text files safely. Token-efficient partial file access with line-range specifications minimizes token consumption in LLM-based tools. Features include hash-based validation for safe concurrent editing, atomic multi-file operations, comprehensive encoding support (utf-8, shift_jis, latin1, etc.), and memory-efficient processing of large files.
Key Features
Pros & Cons
- Token-efficient partial file access reduces LLM token consumption
- Safe concurrent editing with hash-based conflict detection
- Atomic multi-file operations ensure consistency
- Comprehensive encoding support for international text files
- Memory-efficient, suitable for large files
- Robust error handling with custom error types
- Requires Python 3.13+ and MCP client setup
- Line-oriented approach may not suit all editing workflows (e.g., binary files)