Mcp Multi Edit

io.github.eaisdevelopment由 GitHub 帳號 eaisdevelopment 發布v0.2.7更新於 Oct 24, 2026

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

已驗證STDIO僅桌面檔案與儲存開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理在單次原子呼叫中,對一個或多個檔案批次執行多處尋找取代編輯。

可以做什麼
在單一檔案上依序原子地執行多處尋找取代,支援全部取代、試跑預覽,並預設建立 .bak 備份。跨多個檔案協調編輯,任一檔案失敗時自動回滾所有已修改的檔案。提交前可用試跑預覽具體變更,並在尋找字串符合多處時收到結構化錯誤碼、復原提示與衝突警告。
適用情境
適合重新命名變數、遷移日誌呼叫或跨多個檔案重構等情境,此時內建的單次編輯工具需要大量個別呼叫。它能減少批次編輯的工具呼叫次數與上下文 token 消耗。
執行需求
透過 npx 從 npm 套件 @essentialai/mcp-multi-edit 以 stdio 在本機執行。需要 Node.js 20 或更新版本,以及 Claude Code 或 Claude Desktop。未宣告驗證、環境變數或標頭。
安裝前請注意
它會寫入本機檔案:編輯會直接修改檔案,但預設會建立備份,也可用試跑預覽變更。它要求絕對路徑並會解析符號連結。關閉備份後,失敗或誤操作的編輯將失去復原保障。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Multi Edit,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Multi Edit MCP Server

[npm version] [license] [tests] [coverage]

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 tokensWith 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:

json
{  "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:

markdown
## 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 overthe 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:

bash
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):

json
{  "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.

json
{  "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.

json
{  "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

bash
npm install           # Install dependenciesnpm run build         # Compile TypeScriptnpm test              # Run 264 testsnpm run test:coverage # Coverage report (90%+)npm run benchmark     # Run benchmark suitenpm 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 [email protected].


Built by Essential AI Solutions

來源:README.md,提交 53fb3e7

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.7最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。