CCM
/MCP
SkillsMCPMarketplacesDigestToolsAdvertise

This week in Claude

Every Monday: Claude Code, Agent SDK, MCP, and the Anthropic platform moves worth your time.

Skills by Category
Frontend DevelopmentBackend & APIsTesting & QASecurityDevOps & CI/CDGit & Pull RequestsDocumentationCode Review & QualityAI & Agent BuildingSkill Development
MCP Servers by Category
Sales & MarketingWeb & Browser AutomationDatabasesAI & LLM ToolsCloud & InfrastructureCommunication & MessagingDeveloper ToolsDesign & CreativeDocuments & KnowledgeSearch & Web Crawling
Marketplaces by Category
AI Agents & OrchestrationLLM IntegrationDevelopment ToolsFrontend & UIBackend & APIsDatabasesTesting & Code QualityDevOps & CloudSecurity & ComplianceGit & Version Control

Claude Code Marketplaces

Discover Claude Code plugins, extensions, and tools. Automatically updated directory of Anthropic Claude AI marketplaces with development tools, productivity plugins, and integrations.

Resources

  • Browse Skills
  • Browse MCP Servers
  • Browse Marketplaces
  • Skill index
  • MCP index
  • Marketplace index
  • Plugins Reference

Community

  • About
  • Tools
  • Feedback
  • Privacy Policy
  • Advertise

Built for the Claude Code community with Claude Code by mertbuilds.com

Independent project, not affiliated with Anthropic
tumf avatar

MCP Text Editor Server

tumf/mcp-text-editor
188
Summary

MCP Text Editor Server provides line-oriented text file editing capabilities through a standardized API, optimized for LLM applications with efficient partial file access to minimize token consumption. It delivers tools for reading and editing text files with line-range specifications, conflict detection through hash-based validation, support for multiple character encodings, and atomic multi-file operations. This server solves the problem of safe, token-efficient file manipulation in LLM-based tools and collaborative editing scenarios by enabling synchronized access to specific portions of files without loading entire documents.

CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
ego lite browserego lite browser
ego lite browser
Fastest browser for AI agents to run web automation tasks, always free.
Download Free life-time →
Give your AI the whole web as clean markdownGive your AI the whole web as clean markdown
Give your AI the whole web as clean markdown
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →
inference shell
inference shell
create and run specialised agents in minutes
build now →
CodeHealth MCP ServerCodeHealth MCP Server
CodeHealth MCP Server
Protect your code quality, stop the AI slop.
Try For Free →
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
ego lite browserego lite browser
ego lite browser
Fastest browser for AI agents to run web automation tasks, always free.
Download Free life-time →
Give your AI the whole web as clean markdownGive your AI the whole web as clean markdown
Give your AI the whole web as clean markdown
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →
inference shell
inference shell
create and run specialised agents in minutes
build now →
CodeHealth MCP ServerCodeHealth MCP Server
CodeHealth MCP Server
Protect your code quality, stop the AI slop.
Try For Free →

MCP Text Editor Server

codecov smithery badge Glama MCP 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.

Quick Start for Claude.app Users

To use this editor with Claude.app, add the following configuration to your prompt:

code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "text-editor": {
      "command": "uvx",
      "args": [
        "mcp-text-editor"
      ]
    }
  }
}

Overview

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.

Key Benefits

  • Line-based editing operations
  • Token-efficient partial file access with line-range specifications
  • Optimized for LLM tool integration
  • Safe concurrent editing with hash-based validation
  • Atomic multi-file operations
  • Robust error handling with custom error types
  • Comprehensive encoding support (utf-8, shift_jis, latin1, etc.)

Features

  • Line-oriented text file editing and reading
  • Smart partial file access to minimize token usage in LLM applications
  • Get text file contents with line range specification
  • Read multiple ranges from multiple files in a single operation
  • Line-based patch application with correct handling of line number shifts
  • Edit text file contents with conflict detection
  • Flexible character encoding support (utf-8, shift_jis, latin1, etc.)
  • Support for multiple file operations
  • Proper handling of concurrent edits with hash-based validation
  • Memory-efficient processing of large files

Requirements

  • Python 3.11 or higher
  • POSIX-compliant operating system (Linux, macOS, etc.) or Windows
  • Sufficient disk space for text file operations
  • File system permissions for read/write operations
  1. Install Python 3.11+
pyenv install 3.11.6
pyenv local 3.11.6
  1. Install uv (recommended) or pip
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create virtual environment and install dependencies
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"

Requirements

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

Installation

Run via uvx

uvx mcp-text-editor

Installing via Smithery

To install Text Editor Server for Claude Desktop 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 (recommended) or pip
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create virtual environment and install dependencies
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"

Usage

Start the server:

python -m mcp_text_editor

MCP Tools

The server provides several tools for text file manipulation:

get_text_file_contents

Get the contents of one or more text files with line range specification.

Request:

The tool accepts a files array. Each file contains one or more line ranges using start and end. File paths must be absolute.

{
  "files": [
    {
      "file_path": "/absolute/path/to/file.txt",
      "ranges": [
        {"start": 1, "end": 10},
        {"start": 20, "end": null}
      ]
    }
  ],
  "encoding": "utf-8"
}

Parameters:

  • file_path: Absolute path to the text file
  • start: First line to read (1-based)
  • end: Last line to read (inclusive); null reads through end of file
  • encoding: File encoding for all requested files (default: utf-8)

Response:

The top-level object is keyed by absolute file path. file_hash protects the whole-file state; each range_hash protects the corresponding range.

{
  "/absolute/path/to/file.txt": {
    "file_hash": "sha256-hash-of-the-file",
    "ranges": [
      {
        "content": "Lines 1-10 content",
        "start": 1,
        "end": 10,
        "range_hash": "sha256-hash-of-this-range",
        "total_lines": 50,
        "content_size": 512
      }
    ]
  }
}
patch_text_file_contents

Apply one or more non-overlapping patches to one file. Read the target ranges first and pass both the current file_hash and each matching range_hash.

Request:

{
  "file_path": "/absolute/path/to/file.txt",
  "file_hash": "sha256-hash-from-get-response",
  "patches": [
    {
      "start": 5,
      "end": 8,
      "range_hash": "sha256-hash-of-lines-5-through-8",
      "contents": "New content for lines 5-8\n"
    }
  ],
  "encoding": "utf-8"
}

Important notes:

  1. Obtain current hashes with get_text_file_contents immediately before editing.
  2. Use start and end; line_start and line_end are not accepted.
  3. Patches are applied from bottom to top and must not overlap.
  4. Line numbers are 1-based.
  5. Use append_text_file_contents, insert_text_file_contents, or delete_text_file_contents for those specialized operations.
  6. Use the same encoding for the read and patch calls.

Success response:

{
  "result": "ok",
  "file_hash": "sha256-hash-of-new-file-contents",
  "reason": null,
  "suggestion": null,
  "hint": null
}

Error response:

{
  "result": "error",
  "reason": "Content range hash mismatch",
  "suggestion": "get",
  "hint": "Please run get_text_file_contents first to get current content and hashes"
}

Common Usage Pattern

  1. Call get_text_file_contents for the exact range to replace.
  2. Read file_hash and the range's range_hash from the keyed response.
  3. Call patch_text_file_contents with those hashes and the same range.
  4. If the result is an error, read the file again before retrying.
path = "/absolute/path/to/file.txt"
contents = await get_text_file_contents({
    "files": [{
        "file_path": path,
        "ranges": [{"start": 5, "end": 8}]
    }]
})
file_info = contents[path]
selected_range = file_info["ranges"][0]

result = await patch_text_file_contents({
    "file_path": path,
    "file_hash": file_info["file_hash"],
    "patches": [{
        "start": 5,
        "end": 8,
        "range_hash": selected_range["range_hash"],
        "contents": "New content\n"
    }]
})

Error Handling

The server handles various error cases:

  • File not found
  • Permission errors
  • Hash mismatches (concurrent edit detection)
  • Invalid patch ranges
  • Overlapping patches
  • Encoding errors (when file cannot be decoded with specified encoding)
  • Line number out of bounds

Security Considerations

  • File Path Validation: The server validates all file paths to prevent directory traversal attacks
  • Access Control: Proper file system permissions should be set to restrict access to authorized directories
  • Hash Validation: All file modifications are validated using SHA-256 hashes to prevent race conditions
  • Input Sanitization: All user inputs are properly sanitized and validated
  • Error Handling: Sensitive information is not exposed in error messages

Troubleshooting

Common Issues

  1. Permission Denied

    • Check file and directory permissions
    • Ensure the server process has necessary read/write access
  2. Hash Mismatch and Range Hash Errors

    • The file was modified by another process
    • Content being replaced has changed
    • Run get_text_file_contents to get fresh hashes
  3. Encoding Issues

    • Verify file encoding matches the specified encoding
    • Use utf-8 for new files
    • Check for BOM markers in files
  4. Connection Issues

    • Verify the server is running and accessible
    • Check network configuration and firewall settings
  5. Performance Issues

    • Consider using smaller line ranges for large files
    • Monitor system resources (memory, disk space)
    • Use appropriate encoding for file type

Development

Setup

  1. Clone the repository
  2. Create and activate a Python virtual environment
  3. Install development dependencies: uv pip install -e ".[dev]"
  4. Run tests: make all

Code Quality Tools

  • Ruff for linting
  • Black for code formatting
  • isort for import sorting
  • mypy for type checking
  • pytest-cov for test coverage

Testing

Tests are located in the tests directory and can be run with pytest:

# Run all tests
pytest

# Run tests with coverage report
pytest --cov=mcp_text_editor --cov-report=term-missing

# Run specific test file
pytest tests/test_text_editor.py -v

Current test coverage: 90%

Project Structure

mcp-text-editor/
├── mcp_text_editor/
│   ├── __init__.py
│   ├── __main__.py      # Entry point
│   ├── models.py        # Data models
│   ├── server.py        # MCP Server implementation
│   ├── service.py       # Core service logic
│   └── text_editor.py   # Text editor functionality
├── tests/               # Test files
└── pyproject.toml       # Project configuration

License

MIT

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and code quality checks
  5. Submit a pull request

Type Hints

This project uses Python type hints throughout the codebase. Please ensure any contributions maintain this.

Error Handling

All error cases should be handled appropriately and return meaningful error messages. The server should never crash due to invalid input or file operations.

Testing

New features should include appropriate tests. Try to maintain or improve the current test coverage.

Code Style

All code should be formatted with Black and pass Ruff linting. Import sorting should be handled by isort.

Featured
CodeRabbit
CodeRabbit
AI writes the code. CodeRabbit catches the slop.
Try For Free →
ego lite browserego lite browser
ego lite browser
Fastest browser for AI agents to run web automation tasks, always free.
Download Free life-time →
Give your AI the whole web as clean markdownGive your AI the whole web as clean markdown
Give your AI the whole web as clean markdown
Integrate web data into your AI product. One API to scrape website & brand data.
Get API Key Now →
belt - the only tool your agent needs
belt - the only tool your agent needs
belt cli automatically finds the best tools and skills for your agent. image, video, music, tts...
one prompt install →
AppSignal
AppSignal
Monitor with ease. Code with confidence.
Start Free Trial →
Agent, connect blockchain
Agent, connect blockchain
Connect your Claude agent to live crypto prices and trading routes via 1inch
Get the MCP →
inference shell
inference shell
create and run specialised agents in minutes
build now →
CodeHealth MCP ServerCodeHealth MCP Server
CodeHealth MCP Server
Protect your code quality, stop the AI slop.
Try For Free →
Categories
Communication & Messaging
UpdatedJan 29, 2026
View on GitHub

More from tumf

  • Shell174

Related Communication & Messaging MCP Servers

View all →
wyattjoh avatar
Fastmail

wyattjoh/jmap-mcp

A Model Context Protocol (MCP) server that provides tools for interacting with JMAP (JSON Meta Application Protocol) email servers. Built with Deno and using the jmap-jam client library.
170
pdavis68 avatar
RepoMapper

pdavis68/repomapper

A tool to produce a map of a codebase within a git repository. Based entirely on the "Repo Map" functionality in Aider.chat
167
mnexa-ai avatar
e2a — email for AI agents

io.github.mnexa-ai/mcp-server

Authenticated email gateway for AI agents — per-agent inboxes, HITL approval, SPF/DKIM verified.
157
aaronsb avatar
Google Workspace

aaronsb/google-workspace-mcp

A Model Context Protocol (MCP) server that provides authenticated access to Google Workspace APIs, offering integrated Authentication, Gmail, Calendar, and Drive functionality
150
meysam81 avatar
Parse-DMARC MCP Server

meysam81/parse-dmarc

Lightweight DMARC parser: auto-fetch email reports, visualize compliance in a single all-in-one app
143
video-creator avatar
FFmpeg

video-creator/ffmpeg-mcp

Using ffmpeg command line to achieve an mcp server, can be very convenient, through the dialogue to achieve the local video search, tailoring, stitching, playback,clip, overlay, concat and other functions
134