mcp-edit-file-lines

mcp-edit-file-lines

24

Edit File Lines MCP Server allows for precise editing of text files using simple or complex matching in a secure environment. The server supports dry runs to preview changes and restricts operations to specified directories.

Edit File Lines MCP Server

A TypeScript-based MCP server that provides tools for precise line-based edits to text files within allowed directories.

Features

  • Primary tool edit_file_lines for line-based file edits using string or regex matching.
  • Capabilities include replacing entire lines, text matches, and handling regex for complex edits.
  • Supports multi-line edits and previewing changes with a dry run mode.

Additional Tools

  • approve_edit, which applies changes after verification.
  • get_file_lines and search_file for inspecting and locating texts in files.

Usage

  • Requires specifying allowed directories.
  • Edit states have a Time-to-Live for security.

Installation

Integrate with Claude Desktop by configuring claude_desktop_config.json.