Multi Edit MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Multi Edit MCP Server Rename `oldFunction` to `newFunction` across all files in src/"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Multi Edit MCP Server
An MCP server that gives Claude the ability to perform multiple find-and-replace operations in a single tool call with guaranteed atomicity -- all edits succeed or none apply.
Built by Essential AI Solutions for Claude Code and Claude Desktop.
Why Multi Edit?
Claude's built-in Edit tool handles one find-and-replace per call. When renaming a variable across a file or refactoring multiple files, that means dozens of individual tool calls -- each consuming context tokens and adding latency.
Multi Edit batches them into a single call:
Without multi_edit: 105 tool calls | 15,750 tokens
With multi_edit: 21 tool calls | 7,850 tokens (-80% calls, -50% tokens)
With multi_edit_files: 6 tool calls | 4,550 tokens (-94% calls, -71% tokens)Benchmarks run on realistic scenarios (bulk rename, logging migration, cross-file refactor). See benchmarks/results/BENCHMARK-REPORT.md for full details.
Related MCP server: filetools
Quick Start
Claude Code
Add .mcp.json to your project root:
{
"mcpServers": {
"Multi Edit from Essential AI Solutions (essentialai.uk)": {
"command": "npx",
"args": ["-y", "@essentialai/mcp-multi-edit"]
}
}
}Restart Claude Code. Then add the included CLAUDE.md to your project root so Claude automatically prefers multi_edit over the built-in Edit tool:
## Editing Files
When making multiple edits to the same file or across multiple files,
prefer using the `multi_edit` and `multi_edit_files` MCP tools over
the built-in Edit tool. These batch edits atomically in a single call.That's it -- Claude will now use multi_edit whenever it's the right tool for the job.
Display name: Claude Code uses the key name in
mcpServersas the server's display name. You can change the key to any name you prefer.
Alternative: One-liner via CLI:
claude mcp add --transport stdio multi-edit -- npx -y @essentialai/mcp-multi-editNote: The CLI only accepts simple names (letters, numbers, hyphens, underscores). For the full branded display name, use the
.mcp.jsonapproach above.
Claude Desktop
Add to your config file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"Multi Edit from Essential AI Solutions (essentialai.uk)": {
"command": "npx",
"args": ["-y", "@essentialai/mcp-multi-edit"]
}
}
}Restart Claude Desktop.
Full installation guide: docs/installation.md
Tools
multi_edit -- Single file, multiple edits
Batch multiple find-and-replace operations on one file. Edits apply sequentially and atomically.
{
"file_path": "/project/src/app.ts",
"edits": [
{ "old_string": "const oldName = getValue()", "new_string": "const newName = getValue()" },
{ "old_string": "console.log", "new_string": "logger.info", "replace_all": true }
]
}Parameter | Type | Default | Description |
| string | required | Absolute path to the file |
| array | required | Find-and-replace operations (applied in order) |
| string | required | Text to find (exact match) |
| string | required | Replacement text |
| boolean |
| Replace all occurrences |
| boolean |
| Preview changes without applying |
| boolean |
| Create |
multi_edit_files -- Multiple files, one atomic operation
Coordinate edits across multiple files. If any file fails, all files are rolled back automatically.
{
"files": [
{
"file_path": "/project/src/types.ts",
"edits": [
{ "old_string": "interface UserData {", "new_string": "interface UserProfile {" }
]
},
{
"file_path": "/project/src/api.ts",
"edits": [
{ "old_string": "UserData", "new_string": "UserProfile", "replace_all": true }
]
}
]
}Parameter | Type | Default | Description |
| array | required | Array of file edit operations |
| string | required | Absolute path to the file |
| array | required | Edits for this file (same format as above) |
| boolean |
| Preview changes without applying |
Full usage guide with examples: docs/usage.md
Features
Atomic operations -- all edits succeed or none apply, no partial state
Multi-file rollback -- if any file fails, all previously changed files are restored
Dry-run preview -- see exactly what would change before committing
Automatic backups --
.bakfiles created before every edit (disable withbackup: false)Structured errors -- machine-readable error codes with recovery hints for automatic retry
Conflict detection -- warns when
old_stringmatches multiple locationsPath validation -- absolute path enforcement, symlink resolution, existence checks
Error Codes
Code | Retryable | Description |
| Yes |
|
| Yes |
|
| Yes | Invalid input schema |
| No | File does not exist |
| No | Insufficient file permissions |
| No | Could not create backup file |
When retryable is true, Claude reads the recovery_hints in the response, adjusts the input, and retries automatically.
Troubleshooting guide: docs/troubleshooting.md
Requirements
Node.js 20 or later
Claude Code or Claude Desktop
Development
npm install # Install dependencies
npm run build # Compile TypeScript
npm test # Run 264 tests
npm run test:coverage # Coverage report (90%+)
npm run benchmark # Run benchmark suite
npm run dev # Watch modeProject Structure
src/
index.ts # MCP server entry (stdio transport)
server.ts # Server factory and tool registration
tools/
multi-edit.ts # multi_edit tool handler
multi-edit-files.ts # multi_edit_files tool handler
core/
editor.ts # File editing engine (atomic read-modify-write)
validator.ts # Zod input validation schemas
reporter.ts # Result formatting and diff generation
errors.ts # Error classification and envelope creation
types/
index.ts # TypeScript type definitionsDocumentation
Document | Description |
All setup options for Claude Code and Claude Desktop | |
Detailed tool reference with examples | |
Common issues and solutions | |
Version history | |
Performance measurements |
License
PolyForm Noncommercial License 1.0.0
Free for personal and non-commercial use. For commercial licensing, contact support@essentialai.uk.
Built by Essential AI Solutions
Available Tools
2 toolsmulti_editA
Perform multiple find-and-replace operations on a single file atomically. All edits succeed or none apply.
Inputs: edits (required), file_path (required), backup, dry_run, +1 more.
multi_edit_filesA
Perform coordinated edits across multiple files atomically. All file edits succeed or none apply.
Inputs: files (required), backup, dry_run, include_content.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools are clearly differentiated by scope: multi_edit targets a single file while multi_edit_files targets multiple files. Although the names are similar, the descriptions explicitly clarify the difference, leaving little room for confusion.
Both tools follow a consistent snake_case pattern with the shared prefix 'multi_edit', and the suffix 'files' for the multi-file variant. The naming is predictable and clearly related.
With only two tools, the server feels thin for a general-purpose editor, but it is well-scoped for its specific purpose of atomic multi-edits. The count is borderline but acceptable given the narrow domain.
The server fully covers its stated purpose: atomic editing on a single file and across multiple files. No obvious operations are missing for the domain it targets.
Maintenance
Related MCP Connectors
Code-map tools for AI agents: see a repo's structure first, then edit only what matters.
A real-time, multiplayer filesystem for agents and humans: shared files, live edits, history.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Find, read and reorganize files across Google Drive, OneDrive, SharePoint and Dropbox, with undo.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables precise file patching using SEARCH/REPLACE blocks, with mandatory directory sandboxing, automatic Python QA (Ruff/Black/MyPy), and git versioning for rollback.1MIT
- AlicenseBqualityCmaintenanceEnables AI agents to read, replace, and write files through line-range-scoped, byte-literal edits that preserve CRLF/LF line endings and indentation, reject ambiguous matches, and perform atomic writes. It returns the actual current range content and a self-correction hint on mismatch, eliminating 'Could not find oldString' failures in MCP clients like opencode and Claude Desktop.3MIT
- AlicenseBqualityCmaintenanceEnables local, cross-platform file workflows through batched operations and paginated retrieval of complete results kept on the host, reducing repeated tool calls and context token use while confining access to configured project roots.2Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables MCP-capable coding agents to perform batched, token-efficient file and search operations with tolerant, automatically verified edits and diffs. It supports sandboxed workspace access, optional command execution, caching, and post-edit syntax/import checks.MIT