Retrieves the contents of a text file with optional line range specification
Modifies the contents of a text file with conflict detection
Retrieves contents from multiple text files in a single operation
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.
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.
The simplest way to install and run Text Editor is via uvx:
uvx mcp-text-editor
To install Text Editor automatically via Smithery:
npx -y @smithery/cli install mcp-text-editor --client claude
pyenv install 3.13.0
pyenv local 3.13.0
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install mcp-text-editor
Build and run the Docker image:
docker build --network=host -t mcp/text-editor .
To use Text Editor with Claude.app, add the following configuration to your Claude desktop config file:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"text-editor": {
"command": "uvx",
"args": [
"mcp-text-editor"
]
}
}
}
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.
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.
The Text Editor is particularly useful for LLM applications as it helps reduce token consumption by loading only the necessary portions of files.