drio
Open app

Edit File Lines MCP Server

Source

MCP Server to make line-based edits to a file.

Catalog onlyCatalog onlySTDIO

Overview

MCP Edit File Lines is a TypeScript-based server that enables users to perform precise line-based edits on text files, facilitating modifications within allowed directories.

To use this server, start it with one or more specified allowed directories. You can then utilize various tools such as edit_file_lines for making edits, approve_edit to approve changes, and get_file_lines to inspect specific lines.

  • Line-based text editing with string or regex support - Preview edits with a dry run feature - Two-step approval process for safer editing - Tools for searching files and retrieving specific lines - Intelligent whitespace handling and pattern matching
  1. Making complex modifications to JavaScript or TypeScript files.
  2. Updating configurations while preserving file structure.
  3. Searching files for specific components or patterns before editing.

Add to your AI client

Use these steps to connect Edit File Lines MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.

Cursor

Add this to your .cursor/mcp.json file in your project root, then restart Cursor.

.cursor/mcp.json

{
  "mcpServers": {
    "mcp-edit-file-lines-oakenai": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-edit-file-lines-oakenai"
      ]
    }
  }
}

Claude Desktop

Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.

~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)

{
  "mcpServers": {
    "mcp-edit-file-lines-oakenai": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-edit-file-lines-oakenai"
      ]
    }
  }
}

Claude Code

Add this to your project's .mcp.json file. Claude Code will detect it automatically.

.mcp.json (project root)

{
  "mcpServers": {
    "mcp-edit-file-lines-oakenai": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-edit-file-lines-oakenai"
      ]
    }
  }
}

VS Code (Copilot)

Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.

.vscode/mcp.json

{
  "servers": {
    "mcp-edit-file-lines-oakenai": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-edit-file-lines-oakenai"
      ]
    }
  }
}

Windsurf

Add this to your Windsurf MCP config file, then restart Windsurf.

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "mcp-edit-file-lines-oakenai": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-edit-file-lines-oakenai"
      ]
    }
  }
}

Cline

Open Cline settings, navigate to MCP Servers, and add this server configuration.

Cline MCP Settings (via UI)

{
  "mcpServers": {
    "mcp-edit-file-lines-oakenai": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-mcp-edit-file-lines-oakenai"
      ]
    }
  }
}

FAQ

Can I edit files in any directory?

No, the server operations are restricted to specified allowed directories.

Are there any safety measures in place?

Yes, the server includes security checks, like validating symlinks and limiting operations to allowed paths.

What happens if I use an invalid state ID?

You will receive an error indicating that the state ID is invalid or expired.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":240,"uuid":"67cd75fb-5a84-4538-ad5b-ddc3edefd52e","name":"mcp-edit-file-lines","title":"Edit File Lines MCP Server","description":"MCP Server to make line-based edits to a file.","avatar_url":"https://avatars.githubusercontent.com/u/110275537?v=4","created_at":"2024-12-13T10:39:11.762Z","updated_at":"2024-12-13T12:28:11.589Z","status":"created","author_name":"oakenai","author_avatar_url":"https://avatars.githubusercontent.com/u/110275537?v=4","tags":"[]","category":"developer-tools","is_featured":false,"sort":1,"url":"https://github.com/oakenai/mcp-edit-file-lines","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":null,"user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]