io.github.eaisdevelopment/mcp-multi-edit

Registre officiel IA et agents

Atomic multi-file find-and-replace by Essential AI Solutions (essentialai.uk)

Que pouvez-vous faire avec io.github.eaisdevelopment/mcp-multi-edit ?

  • 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 -- .bak files created before every edit (disable with backup: false)
  • Structured errors -- machine-readable error codes with recovery hints for automatic retry
  • Conflict detection -- warns when old_string matches multiple locations
  • Path validation -- absolute path enforcement, symlink resolution, existence checks

Installation

Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).

NPM package @essentialai/mcp-multi-edit
Claude Code
claude mcp add mcp-multi-edit -- npx -y @essentialai/mcp-multi-edit@0.2.7
Configuration JSON (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "mcp-multi-edit": {
            "command": "npx",
            "args": [
                "-y",
                "@essentialai/mcp-multi-edit@0.2.7"
            ]
        }
    }
}

Documentation

Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.

Sommaire
  1. Multi Edit MCP Server
  2. Why Multi Edit?
  3. Quick Start
  4. Tools
  5. Features
  6. Error Codes
  7. Requirements
  8. Development
  9. Documentation
  10. License

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.

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 mcpServers as 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-edit

Note: The CLI only accepts simple names (letters, numbers, hyphens, underscores). For the full branded display name, use the .mcp.json approach 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 }
  ]
}
ParameterTypeDefaultDescription
file_pathstringrequiredAbsolute path to the file
editsarrayrequiredFind-and-replace operations (applied in order)
edits[].old_stringstringrequiredText to find (exact match)
edits[].new_stringstringrequiredReplacement text
edits[].replace_allbooleanfalseReplace all occurrences
dry_runbooleanfalsePreview changes without applying
backupbooleantrueCreate .bak backup before editing
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 }
      ]
    }
  ]
}
ParameterTypeDefaultDescription
filesarrayrequiredArray of file edit operations
files[].file_pathstringrequiredAbsolute path to the file
files[].editsarrayrequiredEdits for this file (same format as above)
dry_runbooleanfalsePreview 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 -- .bak files created before every edit (disable with backup: false)
  • Structured errors -- machine-readable error codes with recovery hints for automatic retry
  • Conflict detection -- warns when old_string matches multiple locations
  • Path validation -- absolute path enforcement, symlink resolution, existence checks

Error Codes

CodeRetryableDescription
MATCH_NOT_FOUNDYesold_string not found in file
AMBIGUOUS_MATCHYesold_string matches multiple locations
VALIDATION_FAILEDYesInvalid input schema
FILE_NOT_FOUNDNoFile does not exist
PERMISSION_DENIEDNoInsufficient file permissions
BACKUP_FAILEDNoCould 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 mode
Project 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 definitions

Documentation

DocumentDescription
Installation GuideAll setup options for Claude Code and Claude Desktop
Usage GuideDetailed tool reference with examples
TroubleshootingCommon issues and solutions
ChangelogVersion history
Benchmark ReportPerformance 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

Questions fréquentes

Qu'est-ce que io.github.eaisdevelopment/mcp-multi-edit ?

Atomic multi-file find-and-replace by Essential AI Solutions (essentialai.uk)

Comment installer io.github.eaisdevelopment/mcp-multi-edit ?

Il s'exécute sur votre machine. Dans Claude Code : claude mcp add mcp-multi-edit -- npx -y @essentialai/mcp-multi-edit@0.2.7. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.

Faut-il une clé API pour io.github.eaisdevelopment/mcp-multi-edit ?

Son entrée au registre n'indique aucune clé ni secret obligatoire. Certaines fonctions peuvent tout de même demander un compte auprès du service auquel il se connecte.

io.github.eaisdevelopment/mcp-multi-edit est-il open source ?

Son code est public sur GitHub, mais le dépôt ne déclare pas de licence standard.

Qui maintient io.github.eaisdevelopment/mcp-multi-edit ?

Il est publié par eaisdevelopment. AI.tn le référence sans le maintenir ni le recommander.

Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.