Skip to main content
AllMCPs
BrowseBestCategoriesStackCompareToolsGuidesBlog
Log in Submit MCP

Stay in the loop

Get new MCP servers and top picks in your inbox.

AllMCPs

The open directory for discovering and installing Model Context Protocol servers.

AllMCPs on GitHub (opens in a new tab)
Launched onTiny Startupstinystartups.com
Explore
  • Browse servers
  • Best MCP servers
  • Categories
  • MCP clients
  • Agent prompts
  • Stack Builder
  • Compare servers
  • Random discovery New
  • Submit a server
  • Pricing & Boost Boost
Learn
  • Guides hub
  • What is MCP?
  • Install guide
  • Build an MCP server
  • Deploy an MCP server
  • Security guide
  • Troubleshooting
  • MCP for SEO & AEO
  • Protocol versioning
  • Blog & updates
Tools
  • All developer tools
  • Config generator
  • Config validator
  • Config auditor
  • MCP playground
  • Token calculator
  • OpenAPI β†’ MCP
  • Badge generator
For agents
  • REST API docs
  • Trust & traffic Live
  • Remote MCP server SSE β†— (opens in a new tab)
  • llms.txt β†— (opens in a new tab)
  • Catalog JSON β†— (opens in a new tab)
Company
  • About
  • Advertise Sponsor
  • Contact
  • GitHub β†— (opens in a new tab)
  • Terms
  • Privacy
AllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZoneAllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZone
Β© 2026 Jackalope Digital LLC. All rights reserved.
  1. Home
  2. πŸ“‚ File Systems
  3. Hledit MCP
Hledit MCP logo
Health: ActiveRecent health check succeeded.Last checked 9/9/2026, 10:32:03 AM

Hledit MCP

User RatingsBe the first to rate and review this MCP server!
View Repository1 GitHub StarsTotal stargazers on GitHub for the source repository (1 stars).Visit Website
file-systemseditingstale-write-protectionmcpcli

MCP server for hash-anchored file edits with stale-write rejection to prevent overwriting changed lines.

Quick Install

Automated & IDE Setup

Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β€” or use 1-click editor setup below.

Add to CursorAdd to VS Code
Automated check passedβ€” started and listed 1 tools correctly (1mo ago).
Manual Client & Custom JSON ConfigExpand JSON β–Ύ

Client Config & Setup

Choose your client or environment
Target File:~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "dabito-hledit-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "hledit-mcp"
      ]
    }
  }
}

πŸ’‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.

Install Tool Schemas (1) Directory Badge Claim listing AlternativesπŸ“‚ More in File Systems

Overview

This MCP server exposes the hledit CLI's hash-anchored file editing primitives to MCP clients, enabling safe local workspace file edits. It reads files with stable line anchors, validates these anchors against current content, and rejects writes if the file has changed since reading, preventing stale context overwrites. Use this when you need explicit stale-write failure handling over MCP instead of blind text replacement.

Use cases

β€’Read files with stable line anchors for precise editing
β€’Apply single or batch edits referencing hash-anchored lines
β€’Prevent stale writes by validating line anchors before editing
β€’Integrate hash-anchored file editing into MCP-compatible clients
β€’Manage local workspace files with explicit stale context failure

Key features

β€’Reads files with line anchors combining line number and hash
β€’Rejects writes if anchors are stale to avoid corrupting files
β€’Supports read, single edit, and batch edit operations
β€’Configurable working directory and binary path
β€’Optional textual diff output for edits
β€’Compatible with MCP clients like Claude Code, Claude Desktop, Cursor

Capabilities & Tool Schemas (1) ~582 tokensApproximate context cost of this server’s tool schemas (~4 chars/token), before any tool is called. Actual usage depends on your client and model.Verified live Verified liveCaptured by calling this server’s live tools/list endpoint.

Inspect callable tools, capabilities, and parameters exposed to AI agents by Hledit MCP.

hledit

Read, edit, or batch-edit files using hash-anchored line references (LN#HASH, currently LN#HHH). Use op:'read' to get anchors, op:'edit' for single changes, op:'batch' for multiple edits in one call. Anchors come from the most recent read and detect stale context before any write.

Documentation Overview

hledit-mcp

npm version License: MIT MCP Registry Glama

hledit-mcp is an MCP server exposing hledit's hash-anchored file edits to standard MCP clients such as Claude Code, Claude Desktop, and Cursor.

Same idea as pi-hledit (the Pi-native integration), but over MCP instead of Pi's extension API, so the same edit primitive can be used from MCP-compatible clients. Official MCP Registry: io.github.dabito/hledit-mcp.

Instead of asking an agent to reproduce old text exactly, hledit read annotates each line with a stable anchor:

text
5#K7Q:func main() {
6#M9A:    fmt.Println("hello")
7#R2C:}

Write commands reference anchors such as 6#M9A. Before changing the file, hledit recomputes the hash at that line. If the file changed since it was read, the anchor is rejected and no write happens β€” the agent gets a stale error and a remap hint instead of silently corrupting the wrong line.

Demo

See docs/demo/transcript.md for a deterministic MCP stdio transcript showing stale-write rejection over the actual hledit-mcp tool surface.

The transcript is generated by docs/demo/hledit-mcp-demo.mjs, which drives dist/index.js through @modelcontextprotocol/sdk's stdio client. It does not call hledit directly.

MCP server for stale-write-safe file editing

hledit-mcp gives MCP-compatible coding agents one file-editing tool that reads line anchors, validates those anchors against current file contents, and rejects stale writes before touching disk. It is for local workspace edits where you want explicit stale-context failure instead of blind text replacement.

Why MCP, separately from pi-hledit

pi-hledit and hledit-mcp share the same tool contract (core.ts in this repo β€” arg-building, batch translation, result formatting) and the same underlying hledit CLI. Only the registration/execution glue differs: pi-hledit wires that contract into Pi's registerTool, this wires it into @modelcontextprotocol/sdk's McpServer. MCP has no equivalent of Pi's renderCall/renderResult terminal rendering, so this package doesn't have one either β€” that layer is genuinely Pi-specific chrome, not part of the portable tool contract.

Use hledit-mcp when you want stale-write rejection over an MCP tool boundary instead of relying on a host's native text replacement behavior.

Requirements

  • Go 1.21+ to install the hledit CLI (or a prebuilt binary on PATH)
  • Node.js 18+
  • An MCP-compatible client

Install

Install the hledit CLI first:

bash
go install github.com/dabito/hledit@latest

Then configure your MCP client to run hledit-mcp. For Claude Code, verify the current CLI syntax with claude mcp add --help; recent versions use:

Terminal
claude mcp add hledit -- npx -y hledit-mcp

Claude Desktop and other MCP clients can use the same stdio server shape:

config.json
{
  "mcpServers": {
    "hledit": {
      "command": "npx",
      "args": ["-y", "hledit-mcp"],
      "env": {
        "HLEDIT_CWD": "/path/to/workspace"
      }
    }
  }
}

Set HLEDIT_CWD to the workspace the MCP client should allow hledit to edit.

Configuration

VariableDefaultDescription
HLEDIT_BINhledit (on PATH)Path to the hledit binary, if not on PATH.
HLEDIT_CWDserver's process.cwd()Working directory hledit resolves relative paths against. Keep this scoped to the workspace you expect the MCP client to edit.
HLEDIT_MCP_DIFF0Opt-in textual diff output for successful edit/batch calls. Off by default to keep MCP/model context compact. Set 1, true, or yes to enable.
HLEDIT_MCP_DIFF_MAX_LINES80Max diff lines when HLEDIT_MCP_DIFF is enabled, including the omission marker. Minimum accepted value: 3.
HLEDIT_MCP_DIFF_CONTEXT2Context lines around changed ranges when diff output is enabled. Minimum accepted value: 0.
HLEDIT_MCP_DIFF_MAX_CELLS40000Max LCS comparison cells before diff body is omitted. Minimum accepted value: 1.

Tool

hledit

One tool, three operations, matching pi-hledit's contract exactly:

opPurpose
readRead annotated lines with LN#HASH anchors
editApply a single replace/insert/delete/replace-range
batchApply multiple anchor-referenced edits in one call
NameTypeRequiredDescription
opstringβœ“"read", "edit", or "batch"
pathstringβœ“File path
offsetnumber1-indexed starting line (read)
limitnumberMax lines to return (read); defaults to 2000
contextnumberSurrounding lines around each grep match; defaults to 2 when grep is set, use 0 for match-only output
grepstringFilter lines by substring (read)
actionstringreplace, insert, delete, or replace-range (edit)
end_anchorstringEnd anchor for replace-range/range delete
contentstringReplacement/inserted content; empty = delete
afterbooleanFor action:"insert", insert after the anchor
editsarray or stringfor batchPreferred: structured array of batch edit ops (replace/delete/insert). Legacy JSON string still accepted.

Workflow: read to get anchors β†’ edit (single change) or batch (multiple). If an edit returns stale, re-read to get fresh anchors before retrying β€” the anchor's line moved or changed since it was read.

Successful edit and batch calls return concise summaries, including Lines: +N -M when the installed hledit CLI provides line delta metadata (hledit >= 1.2.4). Older hledit versions still work; they just omit the line delta summary.

Contextual grep uses a small default window (context:2) when grep is set; pass context:0 for match-only output.

Set HLEDIT_MCP_DIFF=1 to append a capped fenced diff block for successful edits. Leave it off for the most token-economical MCP responses.

Preferred batch shape uses structured edits so the MCP/RPC layer handles escaping:

config.json
{
  "op": "batch",
  "path": "src/file.ts",
  "edits": [
    { "op": "replace", "anchor": "12#NKT", "lines": ["const ok = true;"] }
  ]
}

Contextual grep example:

config.json
{ "op": "read", "path": "src/file.ts", "grep": "validateToken" }

Match-only grep example:

config.json
{ "op": "read", "path": "src/file.ts", "grep": "validateToken", "context": 0 }

Legacy JSON-string edits remains supported during the transition.

Default read calls are bounded: when offset/limit are omitted, the server uses offset=1 and limit=2000.

Development

Terminal
npm install
npm test          # typecheck + build + unit/e2e tests + lint
npm run build      # compile index.ts+core.ts to dist/index.js
npm start         # run the server directly from source via tsx (stdio transport)

Unit tests in core.test.ts cover the same contract as pi-hledit's test suite, minus the Pi-specific rendering assertions (there's no render layer here). e2e.test.ts drives the built dist/index.js over a real MCP stdio handshake with @modelcontextprotocol/sdk's own Client/StdioClientTransport β€” the same artifact npx hledit-mcp runs, not just the TypeScript source.

The published bin/main point at dist/index.js, built with esbuild (build.mjs) and run via plain node β€” this keeps the >=18 Node requirement honest. Running index.ts directly with node (no tsx) only works on Node β‰₯22.6, which has built-in TypeScript type-stripping; older LTS versions have no such support at all.

Credits and prior art

The hashline-edit idea comes from Can BΓΆlΓΌk / @can1357's coding-agent harness work, especially β€œI Improved 15 LLMs at Coding in One Afternoon. Only the Harness Changed.” and oh-my-pi. See hledit's credits for more prior art.

Related packages

  • hledit β€” the standalone CLI both integrations wrap.
  • pi-hledit β€” the Pi-native integration, same tool contract.

Read the full README β†’View source on GitHub β†’

Related MCP Servers

View all in File Systems View all alternatives
  • MCP Text Editor logoMCP Text Editor

    A line-oriented text file editor. Optimized for LLM tools with efficient partial file access to minimize token usage.

    πŸ“‚ File Systems1 views
    Compare vs MCP Text Editor β†’
  • Chisel logoChisel

    Reduce context usage on file use. Send only unified diffs instead of full files (up to 20-100Γ— fewer tokens), and read large files with targeted grep/sed instead of full reads (up to 500Γ—). Kernel-enforced path confinement hard-locks the agent to a configured root: no accidental reads or writes outside scope. Standalone for your file access or embed in any MCP server (Rust, Node.js, Python via WASM).

    πŸ“‚ File Systems3 views
    Compare vs Chisel β†’
  • MCP Server Opendal logoMCP Server Opendal

    Model Context Protocol Server for Apache OpenDALβ„’

    πŸ“‚ File Systems2 views
    Compare vs MCP Server Opendal β†’
  • Llm Context.py logoLlm Context.py

    Share code context with LLMs via MCP or clipboard

    πŸ“‚ File Systems2 views
    Compare vs Llm Context.py β†’

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

GitHub stars
1
Stargazers on the source repository.
Last commit
1mo ago
Most recent push to the default branch.
Availability
100%
Our rolling endpoint + install checks that succeeded.
Install check
Passed
Our sandbox started it and listed its tools.
Tools exposed
1
Callable tools this server registers over MCP.
Directory activity
2 views
Config copies, upvotes, and views on AllMCPs.

Reviews

No reviews yet β€” be the first to share how this listing worked for you.

Frequently Asked Questions about Hledit MCP

It ensures edits apply only if the file content at the referenced line matches the expected hash, preventing stale or conflicting writes.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewHledit MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/dabito-hledit-mcp?style=directory)](https://allmcps.com/mcp/dabito-hledit-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/dabito-hledit-mcp"><img src="https://allmcps.com/api/badge/dabito-hledit-mcp?style=directory" alt="Hledit MCP on AllMCPs" /></a>

Technical Specs & Signals

CategoryπŸ“‚File Systems
PricingFree
More technical detailsExpand β–Ύ
TransportSTDIO
RuntimeNode.js
AuthNo auth required
LicenseMIT
ClientsClaude Desktop, Cursor
Last updatedAug 9, 2026
Views2
Unique ViewsTotal visits recorded for this listing page on AllMCPs.
Installs0
Installs & Copy ActionsTotal times users copied install commands or configuration snippets for this server.
GitHub stars1
GitHub Star CountTotal stargazers on GitHub representing community popularity (1 stars).
Last commit1mo ago
Last Repository CommitThe most recent commit or push recorded for this server's GitHub repository.Last commit on Jul 14, 2026
68Quality signal: Great Β· 68/100How this signal is calculated β–Ύ
Server availability25/25
Verified ownership10/20
Documentation & tools30/30
Adoption & activity3/15
Community engagement0/10

A guidance signal from public completeness & health data β€” not a user rating. New listings start lower and rise as they add docs, get verified, and grow adoption. Signals we can't observe for a listing are skipped, not counted against it.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 23d ago via OSV.dev Β· hledit-mcp (npm)

β˜… FeaturedAllMCPs Server logo

AllMCPs Server

The official MCP server for AllMCPs.com - submit and manage tools directly from your AI. The open directory for MCP servers. Connect Claude, Cursor, Windsurf, and AI agents to databases, tools, files, and APIs. Explore 10,000+ servers. AllMCPs is the premier, open directory for discovering, evaluating, and installing Model Context Protocol (MCP) servers to equip AI agents and LLMs with real-world superpowers.

Explore Server β†’

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to unlock edit access and the Official badge β€” proof is checked automatically, then reviewed by our team.

Free dofollow backlink: add your website and place the AllMCPs badge on it β€” no claim needed. We detect it automatically and keep it verified as long as the badge stays live.

Claim & get free dofollow

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.

Explore more

More in πŸ“‚ File Systems β†’Best MCP servers for File Systems β†’Alternatives to Hledit MCP β†’Install in Claude DesktopInstall in CursorInstall in VS Code