Back to MCP Catalog

Text Editor MCP Server

File SystemsPython
Line-oriented text file editor optimized for LLM tools
Available Tools

get_text_file_contents

Retrieves the contents of a text file with optional line range specification

edit_text_file_contents

Modifies the contents of a text file with conflict detection

get_multiple_text_file_contents

Retrieves contents from multiple text files in a single operation

edit_multiple_text_file_contents

Modifies multiple text files in a single atomic operation

Text Editor is a Model Context Protocol (MCP) server that provides efficient line-oriented text file editing capabilities. It enables safe and precise text file operations with partial file access to minimize token usage in LLM applications. The server implements robust conflict detection and resolution, making it ideal for collaborative editing tools and automated text processing systems.

Overview

Text Editor is a specialized MCP server designed for efficient text file operations. It provides line-oriented editing capabilities with partial file access, making it particularly valuable for LLM-based tools by reducing token consumption. The server implements the Model Context Protocol to ensure reliable file editing with robust conflict detection and resolution.

Key Features

  • Line-based editing operations
  • Token-efficient partial file access with line-range specifications
  • Safe concurrent editing with hash-based validation
  • Atomic multi-file operations
  • Comprehensive encoding support (utf-8, shift_jis, latin1, etc.)
  • Memory-efficient processing of large files

Installation

Prerequisites

  • Python 3.13 or higher
  • POSIX-compliant operating system (Linux, macOS, etc.) or Windows
  • File system permissions for read/write operations

Installation Methods

Using uvx (Recommended)

The simplest way to install and run Text Editor is via uvx:

uvx mcp-text-editor

Using Smithery

To install Text Editor automatically via Smithery:

npx -y @smithery/cli install mcp-text-editor --client claude

Manual Installation

  1. Install Python 3.13+:
pyenv install 3.13.0
pyenv local 3.13.0
  1. Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Install the package:
uv pip install mcp-text-editor

Docker Installation

Build and run the Docker image:

docker build --network=host -t mcp/text-editor .

Configuration

Claude.app Configuration

To use Text Editor with Claude.app, add the following configuration to your Claude desktop config file:

  1. Open the configuration file:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
  1. Add the Text Editor configuration:
{
  "mcpServers": {
    "text-editor": {
      "command": "uvx",
      "args": [
        "mcp-text-editor"
      ]
    }
  }
}

Docker Configuration

If you're using Docker, configure Claude.app with:

{
  "mcpServers": {
    "text-editor": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount",
        "type=bind,src=/path/on/host,dst=/path/in/container",
        "mcp/text-editor"
      ]
    }
  }
}

Replace /path/on/host and /path/in/container with your actual paths.

Usage

Once configured, Claude can use the Text Editor to perform various file operations. The server provides line-oriented text file editing capabilities through a standardized API.

Example Operations

  • Reading file contents with line range specification
  • Editing text files with conflict detection
  • Reading multiple ranges from multiple files in a single operation
  • Line-based patch application with correct handling of line number shifts

The Text Editor is particularly useful for LLM applications as it helps reduce token consumption by loading only the necessary portions of files.

Related MCPs

Filesystem
File SystemsTypeScript

Access and manipulate files and directories with comprehensive filesystem operations

Box File Access
File SystemsTypeScript

Access, search, and read files from your Box account

Filesystem Access
File SystemsJava

Access and manipulate files on your local filesystem

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.