
How to add MCP Text Editor Server to Claude Desktop
Line-oriented text file editing for LLMs with token-efficient partial reads and hash-based conflict detection. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 14, 2026 ยท 191โ ยท stdio ยท no auth
Claude Desktop config for MCP Text Editor Server
uvx mcp-text-editor{
"mcpServers": {
"mcp-text-editor-server": {
"command": "uvx",
"args": [
"mcp-text-editor"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the MCP Text Editor Server config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm MCP Text Editor Server's tools appear under the ๐ tools menu.
Before you start
- Python 3.13+ (README also notes 3.11+ in an earlier section)
- uv / uvx installed (curl -LsSf https://astral.sh/uv/install.sh | sh)
- POSIX-compliant OS (Linux, macOS) or Windows
- File system read/write permissions
What MCP Text Editor Server can do in Claude Desktop
get_text_file_contentsGet the contents of one or more text files with line-range specification (1-based line numbers). Supports a single range or multiple ranges across multiple files in one call, with optional per-file encoding. Returns content plus SHA-256 hashes, total line count, and content size for use in subsequent edits.
patch_text_file_contentsApply patches to one or more text files with robust error handling and conflict detection. Requires the file hash and per-range range_hash from get_text_file_contents. Patches are applied bottom-to-top to handle line-number shifts, must not overlap, and use 1-based line numbers (end: null appends to end of file). Returns ok with a new hash, or an error with suggestions/hints on conflict.
edit_text_file_contentsEdit text file contents with conflict detection (shown in the README's common usage pattern). Takes a file path, the current hash, optional encoding, and a list of line-based patches (line_start/line_end/contents); returns ok or an error such as a hash mismatch when the file was modified concurrently.
Security
The server validates all file paths to prevent directory traversal attacks. All file modifications are validated using SHA-256 hashes to prevent race conditions. Inputs are sanitized and sensitive information is not exposed in error messages. Set proper file system permissions to restrict access to authorized directories.
MCP Text Editor Server + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the MCP Text Editor Server config there under the "mcpServers" key and restart the client.
Is MCP Text Editor Server safe to use with Claude Desktop?
The server validates all file paths to prevent directory traversal attacks. All file modifications are validated using SHA-256 hashes to prevent race conditions. Inputs are sanitized and sensitive information is not exposed in error messages. Set proper file system permissions to restrict access to authorized directories.
How does it reduce token usage for LLMs?
It supports partial file access via line-range specifications, so the model can read only the necessary portions of a file instead of the whole thing.
How are concurrent edits handled?
Every read returns SHA-256 hashes (file hash and per-range range_hash). Patches must supply the matching hashes; if the file changed, the server returns a hash-mismatch error and you re-fetch fresh content before retrying.
How do I install it for Claude Desktop?
Add an mcpServers entry running 'uvx mcp-text-editor' to claude_desktop_config.json, or install automatically via Smithery with 'npx -y @smithery/cli install mcp-text-editor --client claude'.