
How to add MCP Text Editor Server to Cursor
Line-oriented text file editing for LLMs with token-efficient partial reads and hash-based conflict detection. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 191★ · stdio · no auth
Cursor 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 Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the MCP Text Editor Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of MCP Text Editor Server's tools to confirm it's connected.
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 Cursor
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 + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.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 Cursor?
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'.