mcp-hashline-edit-server
Provides tools for reading, writing, and searching local files using hashline-prefixed output and hash-verified line references to ensure edit integrity.
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., "@mcp-hashline-edit-serverReplace line 10:a1 in app.ts with 'export const version = "1.1.0";'"
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.
mcp-hashline-edit-server
MCP server providing hashline-based file editing — line-addressed edits with content hashes for integrity verification.
Based on hashline edit format from oh-my-pi.
What is Hashline?
LLM reads file, every line tagged with short content hash:
1:a3|function hello() {
2:f1| return "world";
3:0e|}Model references tags when editing — "replace line 2:f1", "replace range 1:a3 through 3:0e", "insert after 3:0e". If file changed since last read, hashes won't match, edit rejected before corruption.
Model doesn't need to reproduce old content/whitespace to identify changes. Benchmarks show hashline matches or beats str_replace for most models, weakest models gain most (up to 10x improvement).
Related MCP server: hashfile-mcp
Requirements
Install
npm install mcp-hashline-edit-server
# or
bun add mcp-hashline-edit-serverUsage
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"hashline-edit": {
"command": "bunx",
"args": ["mcp-hashline-edit-server"]
}
}
}Cursor
Add to .cursor/mcp.json (project root or global):
{
"mcpServers": {
"hashline-edit": {
"command": "bunx",
"args": ["mcp-hashline-edit-server"]
}
}
}Any MCP client
Server runs over stdio:
bunx mcp-hashline-edit-serverFrom source
git clone https://github.com/Submerisble/mcp-hashline-edit-server.git
cd mcp-hashline-edit-server
bun install
bun run src/index.tsTools
read_file
Read file with hashline-prefixed output (LINE:HASH|content).
Parameter | Type | Description |
| string | File path (relative or absolute) |
| number? | Start line (1-indexed) |
| number? | Max lines (default: 2000) |
edit_file
Edit file using hash-verified line references. Four edit variants:
set_line — Replace single line:
{"set_line": {"anchor": "2:f1", "new_text": " return \"universe\";"}}replace_lines — Replace range:
{"replace_lines": {"start_anchor": "1:a3", "end_anchor": "3:0e", "new_text": "function greet() {\n return \"hi\";\n}"}}insert_after — Insert after line:
{"insert_after": {"anchor": "1:a3", "text": " // new comment"}}replace — Fuzzy substring replace (fallback, no hashes needed):
{"replace": {"old_text": "return \"world\"", "new_text": "return \"universe\""}}Parameter | Type | Description |
| string | File path |
| array | Edit operations |
Edits validated atomically against file as last read. Sorted, applied bottom-up automatically.
write_file
Create or overwrite file.
Parameter | Type | Description |
| string | File path |
| string | Content to write |
grep
Search files with hashline-prefixed results.
Parameter | Type | Description |
| string | Regex pattern |
| string? | File or directory |
| string? | Filter by glob (e.g., |
| string? | Filter by file type |
| boolean? | Case-insensitive |
| number? | Context lines before |
| number? | Context lines after |
| number? | Max matches (default: 100) |
Requires rg (ripgrep) on system.
How the Hash Works
Strip trailing
\rRemove all whitespace
xxHash32on whitespace-stripped stringModulo 256, encode as 2-char lowercase hex (
00-ff)
Hash whitespace-insensitive — indentation changes don't affect hash, references robust against reformatting.
Error Recovery
Hash mismatch: Error shows updated LINE:HASH refs with >>> markers. Copy new refs, retry.
No-op error: Replacement matches current content. Re-read file for current state.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
- flockfsOAuthcom.flockfs
A real-time, multiplayer filesystem for agents and humans: shared files, live edits, history.
Exact text tools for AI agents: unified diff, patch apply, regex testing, grapheme counting.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Hash-chained HMAC-signed audit log MCP for A2A (agent-to-agent) calls. Every tool-call, agent-ha...
Related MCP Servers
- AlicenseAqualityAmaintenanceA line-oriented text file editor. Optimized for LLM tools with efficient partial file access to minimize token usage.6201MIT
- FlicenseNot gradedqualityCmaintenanceProvides reliable file editing through hash-anchored operations.5-
- AlicenseAqualityDmaintenanceExposes hash-anchored file edits to MCP-compatible AI coding agents, enabling safe read and write operations with stale edit detection.156 npm1MIT
- FlicenseAqualityCmaintenanceProvides file read, edit, and write operations with exact-match editing and hash-based consistency checks, designed for models that prefer structured schemas over patch grammars.3-