
tumf/mcp-text-editor
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
tumf/mcp-text-editor — это кандидат в MCP-сервер, импортированный из https://github.com/tumf/mcp-text-editor.
Обзор
tumf/mcp-text-editor — это кандидат в MCP-сервер, импортированный из https://github.com/tumf/mcp-text-editor.
Обзор (машинный перевод)
Сервер Model Context Protocol (MCP), предоставляющий возможности строчного редактирования текстовых файлов через стандартизированный API. Оптимизирован для инструментов LLM с эффективным частичным доступом к файлам для минимизации использования токенов.
Быстрый старт для Claude.app пользователей
Чтобы использовать этот редактор с Claude.app, добавьте следующую конфигурацию в ваш запрос:
Обзор
MCP Text Editor Server разработан для обеспечения безопасных и эффективных операций с текстовыми файлами на основе строк в архитектуре клиент-сервер. Он реализует протокол Model Context Protocol, обеспечивая надёжное редактирование файлов с надежным обнаружением и разрешением конфликтов. Линейный подход делает его идеальным для приложений, требующих синхронизированного доступа к файлам, таких как инструменты совместного редактирования, автоматизированные системы обработки текста или любые сценарии, где нескольким процессам необходимо безопасно изменять текстовые файлы. Возможность частичного доступа к файлам особенно ценна для инструментов на базе LLM, так как помогает снизить потребление токенов за счёт загрузки только необходимых частей файлов.
Ключевые преимущества
- Операции редактирования на основе строк
- Эффективный доступ к частичным файлам с характеристиками диапазона строк
- Оптимизировано для интеграции инструментов LLM
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
MCP Text Editor Server
A Model Context Protocol (MCP) server that provides line-oriented text file editing capabilities through a standardized API. Optimized for LLM tools with efficient partial file access to minimize token usage.
Quick Start for Claude.app Users
To use this editor with Claude.app, add the following configuration to your prompt:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"text-editor": {
"command": "uvx",
"args": [
"mcp-text-editor"
]
}
}
}
Overview
MCP Text Editor Server is designed to facilitate safe and efficient line-based text file operations in a client-server architecture. It implements the Model Context Protocol, ensuring 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. The partial file access capability is particularly valuable for LLM-based tools, as it helps reduce token consumption by loading only the necessary portions of files.
Key Benefits
- Line-based editing operations
- Token-efficient partial file access with line-range specifications
- Optimized for LLM tool integration
- Safe concurrent editing with hash-based validation
- Atomic multi-file operations
- Robust error handling with custom error types
- Comprehensive encoding support (utf-8, shift_jis, latin1, etc.)
Features
- Line-oriented text file editing and reading
- Smart partial file access to minimize token usage in LLM applications
- Get text file contents with line range specification
- Read multiple ranges from multiple files in a single operation
- Line-based patch application with correct handling of line number shifts
- Edit text file contents with conflict detection
- Flexible character encoding support (utf-8, shift_jis, latin1, etc.)
- Support for multiple file operations
- Proper handling of concurrent edits with hash-based validation
- Memory-efficient processing of large files
Requirements
- Python 3.11 or higher
- POSIX-compliant operating system (Linux, macOS, etc.) or Windows
- Sufficient disk space for text file operations
- File system permissions for read/write operations
- Install Python 3.11+
pyenv install 3.11.6
pyenv local 3.11.6
- Install uv (recommended) or pip
curl -LsSf https://astral.sh/uv/install.sh | sh
Установка
uvx mcp-text-editorКонфигурация
{
"mcpServers": {
"text-editor": {
"command": "uvx",
"args": [
"mcp-text-editor"
]
}
}
}