Hledit MCP Server

Hash-anchored file edits for MCP clients. Rejects stale writes before they happen.

Local serverstdioTypeScript

What is the Hledit MCP MCP server?

Most developer tooling work still happens through a UI a human drives. Hledit MCP MCP server moves it into the conversation instead. Hash-anchored file edits for MCP clients. Rejects stale writes before they happen.

The short version

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.

The tools it exposes

The server publishes 14 tools. What each one is for:

  • Variable — Default
  • HLEDIT_BIN — hledit (on PATH)
  • HLEDIT_CWD — server's process.cwd()
  • HLEDIT_MCP_DIFF — 0
  • HLEDIT_MCP_DIFF_MAX_LINES — 80
  • HLEDIT_MCP_DIFF_CONTEXT — 2
  • HLEDIT_MCP_DIFF_MAX_CELLS — 40000
  • read — Read annotated lines with LN#HASH anchors
  • edit — Apply a single replace/insert/delete/replace-range
  • batch — Apply multiple anchor-referenced edits in one call
  • path — string
  • offset — number

Getting it running

The server ships on npm as hledit-mcp, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

What it needs from you

Configuration is passed through the environment: HLEDIT_CWD. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

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

How it compares

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Hledit MCP's toolset — Variable, HLEDIT_BIN, HLEDIT_CWD and 11 more — is a fair guide to whether it matches your workflow. It is maintained by dabito; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Hledit MCP.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
VariableDefault
HLEDIT_BINhledit (on PATH)
HLEDIT_CWDserver's process.cwd()
HLEDIT_MCP_DIFF0
HLEDIT_MCP_DIFF_MAX_LINES80
HLEDIT_MCP_DIFF_CONTEXT2
HLEDIT_MCP_DIFF_MAX_CELLS40000
readRead annotated lines with LN#HASH anchors
editApply a single replace/insert/delete/replace-range
batchApply multiple anchor-referenced edits in one call
pathstring
offsetnumber
limitnumber
contextnumber

How to install the Hledit MCP MCP server

{
  "mcpServers": {
    "hledit": {
      "command": "npx",
      "args": ["-y", "hledit-mcp"],
      "env": {
        "HLEDIT_CWD": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Go 1.21+ to install the hledit CLI (or a prebuilt binary on PATH) - Node.js 18+ - An MCP-compatible client
VariableDescriptionRequired
HLEDIT_CWDConfiguration value read at startup.Optional

Example prompts to try

  • Use Hledit MCP to Variable.
  • Use Hledit MCP to HLEDIT BIN.
  • Use Hledit MCP to HLEDIT CWD.

Frequently asked questions

It connects Hledit MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (Variable, HLEDIT_BIN, HLEDIT_CWD, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Hledit MCP directly.