Skip to content

Commit 087bf4d

Browse files
committed
Merge branch 'develop'
2 parents aca2fb4 + 5eb41ba commit 087bf4d

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

README.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,62 @@
22

33
[![codecov](https://codecov.io/gh/tumf/mcp-text-editor/graph/badge.svg?token=52D51U0ZUR)](https://codecov.io/gh/tumf/mcp-text-editor)
44

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+
```
628

729
## Overview
830

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.
1032

1133
### Key Benefits
1234

35+
- Line-based editing operations
36+
- Token-efficient partial file access with line-range specifications
37+
- Optimized for LLM tool integration
1338
- Safe concurrent editing with hash-based validation
14-
- Efficient partial file access with line-range specifications
1539
- Atomic multi-file operations
1640
- Robust error handling and recovery mechanisms
1741

18-
1942
## Features
2043

44+
- Line-oriented text file editing and reading
45+
- Smart partial file access to minimize token usage in LLM applications
2146
- Get text file contents with line range specification
2247
- Read multiple ranges from multiple files in a single operation
48+
- Line-based patch application with correct handling of line number shifts
2349
- Edit text file contents with conflict detection
2450
- Support for multiple file operations
2551
- 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
2852
- Memory-efficient processing of large files
2953

30-
3154
## Requirements
3255

3356
- Python 3.11 or higher
3457
- POSIX-compliant operating system (Linux, macOS, etc.) or Windows
3558
- Sufficient disk space for text file operations
3659
- File system permissions for read/write operations
3760

38-
3961
1. Install Python 3.11+
4062

4163
```bash

src/mcp_text_editor/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from mcp.types import TextContent, Tool
1212

1313
from .text_editor import TextEditor
14+
from .version import __version__
1415

1516
# Configure logging
1617
logging.basicConfig(level=logging.INFO)
@@ -273,7 +274,7 @@ async def call_tool(name: str, arguments: Any) -> Sequence[TextContent]:
273274

274275
async def main() -> None:
275276
"""Main entry point for the MCP text editor server."""
276-
logger.info("Starting MCP text editor server")
277+
logger.info(f"Starting MCP text editor server v{__version__}")
277278
try:
278279
from mcp.server.stdio import stdio_server
279280

0 commit comments

Comments
 (0)