|
2 | 2 |
|
3 | 3 | [](https://codecov.io/gh/tumf/mcp-text-editor)
|
4 | 4 |
|
5 |
| -A Model Context Protocol (MCP) server that provides text file editing capabilities through a standardized API. |
| 5 | +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. |
| 6 | + |
| 7 | +## Quick Start for Claude.app Users |
| 8 | + |
| 9 | +To use this editor with Claude.app, add the following configuration to your prompt: |
| 10 | + |
| 11 | +```shell |
| 12 | +code ~/Library/Application\ Support/Claude/claude_desktop_config.json |
| 13 | +``` |
| 14 | + |
| 15 | +```json |
| 16 | +{ |
| 17 | + "mcpServers": { |
| 18 | + |
| 19 | + "text-editor": { |
| 20 | + "command": "uvx", |
| 21 | + "args": [ |
| 22 | + "mcp-text-editor" |
| 23 | + ] |
| 24 | + }, |
| 25 | + } |
| 26 | +} |
| 27 | +``` |
6 | 28 |
|
7 | 29 | ## Overview
|
8 | 30 |
|
9 |
| -MCP Text Editor Server is designed to facilitate safe and efficient text file operations in a client-server architecture. It implements the Model Context Protocol, ensuring reliable file editing with robust conflict detection and resolution. This 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. |
| 31 | +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. |
10 | 32 |
|
11 | 33 | ### Key Benefits
|
12 | 34 |
|
| 35 | +- Line-based editing operations |
| 36 | +- Token-efficient partial file access with line-range specifications |
| 37 | +- Optimized for LLM tool integration |
13 | 38 | - Safe concurrent editing with hash-based validation
|
14 |
| -- Efficient partial file access with line-range specifications |
15 | 39 | - Atomic multi-file operations
|
16 | 40 | - Robust error handling and recovery mechanisms
|
17 | 41 |
|
18 |
| - |
19 | 42 | ## Features
|
20 | 43 |
|
| 44 | +- Line-oriented text file editing and reading |
| 45 | +- Smart partial file access to minimize token usage in LLM applications |
21 | 46 | - Get text file contents with line range specification
|
22 | 47 | - Read multiple ranges from multiple files in a single operation
|
| 48 | +- Line-based patch application with correct handling of line number shifts |
23 | 49 | - Edit text file contents with conflict detection
|
24 | 50 | - Support for multiple file operations
|
25 | 51 | - Proper handling of concurrent edits with hash-based validation
|
26 |
| -- Line-based patch application with correct handling of line number shifts |
27 |
| -- Robust error handling and validation |
28 | 52 | - Memory-efficient processing of large files
|
29 | 53 |
|
30 |
| - |
31 | 54 | ## Requirements
|
32 | 55 |
|
33 | 56 | - Python 3.11 or higher
|
34 | 57 | - POSIX-compliant operating system (Linux, macOS, etc.) or Windows
|
35 | 58 | - Sufficient disk space for text file operations
|
36 | 59 | - File system permissions for read/write operations
|
37 | 60 |
|
38 |
| - |
39 | 61 | 1. Install Python 3.11+
|
40 | 62 |
|
41 | 63 | ```bash
|
|
0 commit comments