mcp-text-editor

mcp-text-editor

111

MCP Text Editor Server is a Model Context Protocol server designed for efficient line-oriented text file editing. It supports safe collaborative editing, robust conflict detection, and reduces token consumption in LLM tools. Key features include atomic file operations and comprehensive encoding support.

MCP Text Editor Server

MCP Text Editor Server offers a secure and efficient solution for line-oriented text file operations in a client-server setup via the Model Context Protocol. It ensures reliable and synchronized file editing, ideal for collaborative tools and automated text processing systems. Key features include:

  • Line-based editing
  • Token-efficient access
  • Safe concurrent editing
  • Robust error handling
  • Comprehensive encoding support

Key Benefits

  • Token-efficient partial file access
  • Optimized for LLM integration
  • Atomic multi-file operations

Features

  • Line-based text file editing
  • Memory-efficient processing of large files
  • Support for utf-8, shift_jis, latin1 encodings

Requirements

  • Python 3.11+
  • POSIX-compliant OS or Windows

Installation

  • Install Python 3.13+ and uv
  • Docker support available

Usage

Start server with python -m mcp_text_editor or using Docker.

Security Considerations

  • File path validation
  • Controlled access
  • SHA-256 hash validation

Troubleshooting

  • Resolve permission issues
  • Handle encoding problems

Development

  • Use Ruff, Black, isort, and mypy for code quality
  • Tests with pytest, coverage 90%

License

MIT

Contributing

  • Follow standard Git procedures
  • Maintain code style and type hints