MCP Text Editor Server

MCP Text Editor Server

PythonLlmTextEditingApiMcpModelContextProtocolJavascriptGoRubyRDeveloper

About This 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.

Server Information

šŸ“‹ Overview:

This webpage is the GitHub repository for a project named "mcp-text-editor" by user tumf. It is a Model Context Protocol (MCP) server designed to facilitate line-based text file operations, optimized for Language Learning Model (LLM) tools with efficient partial file access to minimize token usage. The repository is public and users are able to browse the source code, view issues, pull requests, and contribute to the project.


⭐ Key Points:
  • The project provides a Model Context Protocol (MCP) server for line-oriented text file editing.

  • It is optimized for LLM tools, focusing on efficient partial file access and minimizing token usage.

  • The project features safe concurrent editing with hash-based validation.

  • It provides atomic multi-file operations and robust error handling.

  • The text editor has character encoding support, including UTF-8, Shift_JIS, and Latin1.


  • šŸ” Main Findings:
  • The project implements two primary tools: `gettextfilecontents` (for retrieving file content with range specification) and `patchtextfilecontents` (for applying changes with conflict detection).

  • The server is set up to prevent directory traversal attacks and ensures sanitized user inputs.

  • The code uses Python type hints and is formatted with Black and Ruff.

  • The test coverage for the project is reported to be 90%.

  • The repository contains 11 items including workflow, source, test, and configuration files.


  • šŸ“Š Details:
  • Installation: Requires Python 3.11+ and a POSIX-compliant OS or Windows. Installation through `uvx` and `smithery` is recommended.

  • Configuration: Includes configuration instructions for Claude.app users.

  • Contributing: Outlines the steps for contributing, including forking the repository, creating feature branches, running tests, and submitting pull requests.

  • Structure: Includes the main Python implementation files, tests, and configuration.


šŸŽÆ Conclusion:
The "mcp-text-editor" repository hosts a Model Context Protocol server for text file editing, emphasizing efficiency and safety for LLM tools. The project is open for contributions and provides detailed documentation for setup, usage, and troubleshooting.

Server Features

Line-oriented text file editing and reading

Line-oriented text file editing and reading

Smart partial file access

Smart partial file access to minimize token usage in LLM applications

Get text file contents

Get text file contents with line range specification

Read multiple ranges

Read multiple ranges from multiple files in a single operation

Line-based patch application

Line-based patch application with correct handling of line number shifts

Edit text file contents

Edit text file contents with conflict detection

Flexible character encoding

Flexible character encoding support (utf-8, shift_jis, latin1, etc.)

Support for multiple files

Support for multiple file operations

Handling concurrent edits

Proper handling of concurrent edits with hash-based validation

Memory-efficient processing

Memory-efficient processing of large files

Provider Information

Tumf logo

Tumf

cloud Provider

Visit Provider Website

Quick Actions

Visit Website

MCP Configuration

Available Tools

get_text_file_contentspatch_text_file_contents