MCP Directory

How to add MCP Text Editor Server to Windsurf

Line-oriented text file editing for LLMs with token-efficient partial reads and hash-based conflict detection. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.

Last updated June 14, 2026 · 191 · stdio · no auth

Windsurf 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

  1. 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
  2. 2Paste the MCP Text Editor Server config below.
  3. 3Fill in placeholder secrets, then save.
  4. 4Click Refresh in the MCP panel.
  5. 5MCP Text Editor Server's tools become available to Cascade.

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 Windsurf

get_text_file_contents

Get 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_contents

Apply 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_contents

Edit 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 + Windsurf FAQ

Where is the Windsurf config file?

Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_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 Windsurf?

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'.

View repo Full MCP Text Editor Server page