MCP Edit File Lines MCP Server

Make line-based edits to a text file. Each edit replaces exact line sequences.

Local serverstdioTypeScript

What is the MCP Edit File Lines MCP server?

MCP Edit File Lines MCP server exists for a simple reason — assistants are far more useful when they can act on MCP Edit File Lines directly instead of describing what you should do. Make line-based edits to a text file. Each edit replaces exact line sequences.

What you get

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

What the assistant can call

Once MCP Edit File Lines is connected, these are the calls the assistant has available:

  • get_file_lines — edit_file_lines (dry run)
  • approve_edit — Shows the output of each operation
  • edit_file_lines — Make line-based edits to a file using string or regex pattern matching. Each edit can: - Replace entire lines - Replace specific text matches while
  • search_file — Search a file for text patterns or regular expressions to find specific line numbers and their surrounding context. This tool is particularly useful
  • Testing — The Testing tool exposed by this server
  • Debugging — Use the Test Tools script to test the MCP tools directly against sample files. The MCP Inspector

Setting it up

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

Configuration and credentials

You will need one environment variable: MCP_EDIT_STATE_TTL. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Choosing this one

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. MCP Edit File Lines's toolset — get_file_lines, approve_edit, edit_file_lines and 3 more — is a fair guide to whether it matches your workflow. It is maintained by oakenai; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mcp edit file lines mcp server does with a few real requests.

Available tools

ToolWhat it does
get_file_linesedit_file_lines (dry run)
approve_editShows the output of each operation
edit_file_linesMake line-based edits to a file using string or regex pattern matching. Each edit can: - Replace entire lines - Replace specific text matches while preserving line formatting - Use regex patterns for complex matches - Ha
search_fileSearch a file for text patterns or regular expressions to find specific line numbers and their surrounding context. This tool is particularly useful for locating the exact lines you want to edit with edit_file_lines.
TestingThe Testing tool exposed by this server.
DebuggingUse the Test Tools script to test the MCP tools directly against sample files. The [MCP Inspector](https://github.com/modelcontextprotocol/inspector) might help, but it currently does not support handing input that are n

Configuration

VariableDescriptionRequired
MCP_EDIT_STATE_TTLConfiguration value read at startup.Optional

Example prompts to try

  • Use MCP Edit File Lines to get file lines.
  • Use MCP Edit File Lines to approve edit.
  • Use MCP Edit File Lines to edit file lines.

Frequently asked questions

It connects MCP Edit File Lines to MCP-compatible AI assistants such as Claude and Cursor, exposing 6 tools (get_file_lines, approve_edit, edit_file_lines, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with MCP Edit File Lines directly.