
danielpodrazka/editor-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Сервер текстового редактора на основе Python, построенный с помощью FastMCP, который предоставляет инструменты для файловых операций. Этот сервер позволяет читать, редактировать и управлять текстовыми файлами через стандартизированный API.
Обзор
Сервер текстового редактора на основе Python, построенный с помощью FastMCP, который предоставляет мощные инструменты для файловых операций. Этот сервер позволяет читать, редактировать и управлять текстовыми файлами через стандартизированный API с уникальным многоступенчатым подходом, который значительно повышает точность и надежность редактирования кода для LLM и помощников ИИ. - Настройте файл для работы с использованием абсолютных путей - : - Прочитайте целые файлы с номерами строк с использованием skim - Прочитайте конкретные диапазоны строк с префиксированными номерами строк с использованием read - Найдите конкретный текст в файлах с использованием find line - Найдите и извлеките определения функций в файлах Python и JavaScript/JSX с использованием find function - : - Двухэтапный процесс редактирования с дифф-превью - Выберите и перезапишите текст с проверкой ID - Чистый рабочий процесс редактирования с выберите → перезапишите → подтвердите / отмените шаблон - Проверка синтаксиса для Python (.py) и JavaScript / React (.js, ).
Обзор (машинный перевод)
Сервер текстового редактора на основе Python, построенный с помощью FastMCP, который предоставляет мощные инструменты для файловых операций. Этот сервер позволяет читать, редактировать и управлять текстовыми файлами через стандартизированный API с уникальным многоступенчатым подходом, который значительно повышает точность и надежность редактирования кода для LLM и помощников ИИ.
Особенности
** Выбор файла **: Установите файл для работы с использованием абсолютных путей
Читать Операции:
Прочитайте все файлы с номерами строк, используя skim
- Прочитайте конкретные диапазоны линий с префиксированными номерами линий, используя
readНайдите конкретный текст в файлах, используяfind_lineНайти и извлечь определения функций в файлах Python и JavaScript/JSX с помощьюfind_functionРедактировать операции: Двухэтапный процесс редактирования с предварительным просмотром Выберите и перезапишите текст с проверкой ID - Чистый рабочий процесс редактирования с помощью select → overwrite → confirm/cancel pattern Проверка синтаксиса для файлов Python (.py) и JavaScript/React (.js, .jsx) Создание новых файлов с контентом ** Управление файлами**: Создание новых файлов с правильной инициализацией
- Удалить файлы из файловой системы
- Содержание каталогов с
listdir** Тестовая поддержка**:
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
Editor MCP
A Python-based text editor server built with FastMCP that provides powerful tools for file operations. This server enables reading, editing, and managing text files through a standardized API with a unique multi-step approach that significantly improves code editing accuracy and reliability for LLMs and AI assistants.
Features
- File Selection: Set a file to work with using absolute paths
- Read Operations:
- Read entire files with line numbers using
skim - Read specific line ranges with prefixed line numbers using
read - Find specific text within files using
find_line - Find and extract function definitions in Python and JavaScript/JSX files using
find_function
- Read entire files with line numbers using
- Edit Operations:
- Two-step editing process with diff preview
- Select and overwrite text with ID verification
- Clean editing workflow with select → overwrite → confirm/cancel pattern
- Syntax checking for Python (.py) and JavaScript/React (.js, .jsx) files
- Create new files with content
- File Management:
- Create new files with proper initialization
- Delete files from the filesystem
- List directory contents with
listdir
- Testing Support:
- Run Python tests with
run_tests - Set Python paths for proper module resolution
- Run Python tests with
- Safety Features:
- Content ID verification to prevent conflicts
- Line count limits to prevent resource exhaustion
- Syntax checking to maintain code integrity
- Protected paths to restrict access to sensitive files
Security Risks
The editor-mcp includes powerful capabilities that come with certain security considerations:
- Jailbreak Risk: The editor-mcp can potentially be jailbroken when reading a file that has harmful instructions embedded inside. Malicious content in files being edited could contain instructions that manipulate the AI assistant.
- Arbitrary Code Execution: If running tests is enabled, there is a risk of arbitrary code execution through manipulated test files or malicious Python code.
- Data Exposure: Access to file system operations could potentially expose sensitive information if proper path protections aren’t configured.
To mitigate these risks:
- Use the
PROTECTED_PATHSenvironment variable to restrict access to sensitive files and directories. - Disable test running capabilities in production environments unless absolutely necessary.
- Carefully review files before opening them, especially if they come from untrusted sources.
- Consider running the editor in a sandboxed environment with limited permissions.
Key Advantages For LLMs
This text editor’s unique design solves critical problems that typically affect LLM code editing:
Установка
uvx install git+https://github.com/danielpodrazka/mcp-text-editor.gitКонфигурация
{
"mcpServers": {
"text-editor": {
"command": "editor-mcp",
"env": {
"MAX_SELECT_LINES": "100",
"ENABLE_JS_SYNTAX_CHECK": "0",
"FAIL_ON_PYTHON_SYNTAX_ERROR": "1",
"FAIL_ON_JS_SYNTAX_ERROR": "0",
"PROTECTED_PATHS": "*.env,.env*,config*.json,*secret*,/etc/passwd,/home/user/.ssh/id_rsa"
}
}
}
}