
submersible/mcp-hashline-edit-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
ハッシュラインベースのファイル編集を提供するMCPサーバー — コンテンツハッシュと行アドレスを編集して、完全性検証を行います.
概要
ハッシュラインベースのファイル編集を提供するMCPサーバー — コンテンツハッシュと行アドレスを編集して、完全性検証を行います。 oh-my-pi からハッシュラインの編集形式に基づく。 LLM はファイル、ショート コンテンツハッシュにタグ付けされたすべての行を読みます。 編集時のモデル参照タグ — "replace line 2:f1", "replace range 1:a3 から 3:0e", "insert after 3:0e". 読み直してからファイルが変更された場合、ハッシュが一致しない場合は、破損前に拒否された編集を行います。 モデルは、変更を識別するために、古いコンテンツ/空白を再現する必要はありません。 Benchmarks は、ほとんどのモデルで str replace をマッチしたり、最も弱いモデルが最も高くなります(最大 10x 改善)。 - バーンランタイム(Bun.hash.xxHash32 for line hashing) - グレープツールのPATHのリッピング(rg) ~/Library/Application Support/Claude/claude desktop config.json に追加します。 .cursor/mcp.json に追加します(root または global を実行します):
概要(AI 翻訳)
ハッシュラインベースのファイル編集を提供するMCPサーバー — コンテンツハッシュと行アドレスを編集して、完全性検証を行います。
oh-my-pi からハッシュラインの編集形式に基づく。
ハッシュラインとは?
LLM はファイル、ショート コンテンツハッシュにタグ付けされたすべての行を読みます。
編集時のモデル参照タグ — “replace line 2:f1]”, "replace range [1:a3]], "Insert After [[3:0e]]]]) 読み直してからファイルが変更された場合、ハッシュが一致しない場合は、破損前に拒否された編集を行います。
モデルは、変更を識別するために、古いコンテンツ/空白を再現する必要はありません。 ベンチマークは、ほとんどのモデルのハッシュラインマッチやビート[str_replace]を表示し、最も弱いモデルが増加します(最大10倍改善)。
要件
- バーンランタイム([T5])
- PATH の [[T7] ツールの ripgrep ([[T6])]
インストール
使用法
##Claudeデスクトップ
[~/Library/Application Support/Claude/claude_desktop_config.jsonに追加します。
カーソル
[.cursor/mcp.json に追加します。(root または global をプロジェクト):
##任意のMCPクライアント
サーバは stdio 上で動作します。
ソースから
ツール
##[read_file
hashline-prefixed 出力 (LINE:HASH|content) でファイルを読みます。
| パラメーター | 種類 | 説明 | お問い合わせ
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
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).
Requirements
Install
npm install mcp-hashline-edit-server
# or
bun add mcp-hashline-edit-server
Usage
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-server
From source
git clone https://github.com/Submerisble/mcp-hashline-edit-server.git
cd mcp-hashline-edit-server
bun install
bun run src/index.ts
Tools
read_file
Read file with hashline-prefixed output (LINE:HASH|content).
| Parameter | Type | Description |
|---|---|---|
path |
string | File path (relative or absolute) |
offset |
number? | Start line (1-indexed) |
limit |
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 |
|---|---|---|
path |
string | File path |
edits |
array | Edit operations |
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"hashline-edit": {
"command": "bunx",
"args": ["mcp-hashline-edit-server"]
}
}
}