snapedit
Click on "Install 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., "@snapeditTake a snapshot of src/index.js and apply my changes."
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.
snapedit
Snapshot-based file editing for AI agents — send only the NEW content, never the old block.
snapedit lets an editing agent (Claude Code, OpenCode, or any MCP client)
edit files by sending only the new content — never the old text. Files are
captured as immutable, content-addressed snapshots; edits reference the
snapshot's 1-based line numbers, so lines shifted by prior edits elsewhere
never silently misapply.
Agent snapedit Filesystem
│ read_snapshot(path) │
├────────────────────────────────►│ sha256(bytes) → blob_id
│◄── blob_id + numbered page ────┤
│ │ …(agent thinks)…
│ apply_snapshot_patch(blob, │
│ from, to, NEW_CONTENT) ──────►│ base=snapshot · ours=live
│ │ 3-way merge OR splice
│◄── ok:true / conflict / err ────┤
│ │ atomic write + lockWhy
Direct rewrite tools force the agent to transmit the old text to locate a
change; when a file changes between reads, misalignment silently corrupts
files. snapedit replaces that with:
Immutable snapshots —
blob_id = sha256(bytes). The agent carries only the id; content is never re-sent.3-way merge on apply — base = snapshot, ours = live file. Earlier edits (even insertions above the hunk) are preserved; the patch lands exactly where the snapshot said it should.
Explicit conflicts — if the live file changed inside the hunk with different content, no write happens; a structured conflict is returned with previews of both sides.
Safety over guesswork — ambiguous patches (hunk text duplicated in the live file) are refused with zero writes, never silently applied to the wrong occurrence.
No shell transport — all bodies travel over stdio MCP (JSON-RPC lines). Large files are paged, never truncated by a shell.
Related MCP server: Rewindex
Features
Feature | Details |
Content-addressed store |
|
Cross-process safety | advisory locks, |
Concurrency | parallel edits: disjoint ranges both land; same range → clean conflict |
Ambiguity safety | duplicated hunk text ⇒ refused, file proven byte-identical |
Store GC |
|
Zero dependencies | plain Node.js ≥ 18, ESM |
Install
git clone https://github.com/rianprei/snapedit.git
cd snapedit
npm test # 55 tests, no deps required
npm link # optional: expose `snapedit` on PATHQuick start (CLI)
# snapshot + numbered page (default page 0, 300 lines)
snapedit read path/to/file.txt
# apply NEW content to snapshot lines 2..4 (1-based, inclusive)
snapedit apply path/to/file.txt <blob_id> 2 4 --content $'wrote new lines\n'
# where does the hunk map in the live file today?
snapedit locate path/to/file.txt <blob_id> 2 4
# run the MCP server over stdio
snapedit mcpClaude Code configuration
Add an MCP server entry (Claude Code ~/.claude.json, or OpenCode's "type": "local" MCP):
{
"mcpServers": {
"snapedit": {
"command": "/abs/path/to/snapedit/bin/snapedit",
"args": ["mcp"]
}
}
}Agent edit protocol (keep this short)
read_snapshot(page containing region) — rememberblob_id.apply_snapshot_patch(path, blob_id, from, to, new_content).ok:true→ done.mode:"conflict"→ re-read_snapshot, retry on the new snapshot.kind:"snapshot_missing"→ re-read_snapshot.
Never send the old text; never concatenate whole-file bodies yourself.
new_content is the exact replacement for snapshot lines [from..to]
(1-based, inclusive). Multi-line edits work as a single new_content; the
merge replays the hunk in snapshot coordinates, so earlier shifts don't break
it.
Documentation
Protocol — full JSON-RPC tool contracts, results, errors
Architecture — modules, data flow, concurrency model
Safety & invariants — ambiguity gate, conflict rules, corruption defenses, GC, locking
Security
See docs/SAFETY.md for the full property list. Highlights:
Refuses ambiguous applies deterministically (
match_count != 1 → write == false, proven byte-identical by sha256 in tests).Path-like
blob_ids rejected (no filesystem traversal via the store).MCP input validation: malformed JSON-RPC →
-32600, invalid tool args →bad_arg, never a crash of the server.Atomic write: temp file in same dir +
rename→ readers never observe partial content.
License
MIT — see LICENSE.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceA lightweight, multi-tenant blob storage and diff server that helps LLM coding agents manage large code edits while reducing hallucinations and maintaining work integrity.Last updatedMIT
- Flicense-qualityAmaintenanceAuto-snapshot tool for AI agents. Reduces the risk of AI agents breaking your code by automatically saving a snapshot of every file change locally. Rewind sessions, audit code changes, and inspect diffs directly from your AI chat or the built-in dashboard. Free and safe no cloud run local.Last updated1

statecli-mcp-serverofficial
Alicense-qualityDmaintenanceGives AI agents memory, undo, and self-awareness by tracking file changes and enabling checkpoints and rollbacks.Last updated481MIT- AlicenseAqualityBmaintenanceExposes hash-anchored file edits to MCP-compatible AI coding agents, enabling safe read and write operations with stale edit detection.Last updated1501MIT
Related MCP Connectors
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Persistent docs and memory for AI agents — read, write, organize & search a shared workspace.
The team layer for AI coding agents: shared contracts, collision alerts, E2EE sessions.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rianprei/snapedit'
If you have feedback or need assistance with the MCP directory API, please join our Discord server