# Hashfile MCP

An MCP server that edits files by line content instead of line numbers, and keeps agents away from secrets and lock files.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 5
- Author: mrorigo
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mrorigo/hashfile-mcp
- Updated: 2026-03-21
- HTML: https://affpapa.org/en/nevibecode/mcp/hashfile-mcp

## What it does

Line-number editing breaks the moment someone inserts a few lines above. Hashfile tags every line with a short hash on read, so an edit points at content rather than a position. The server locates the line even after it moves, and a file hash blocks the operation if the content changed since you read it. Several changes can go into one atomic batch: `replace`, `insert_after`, `insert_before`, `delete`.

Nine tools ship with it. Three handle hash-anchored work (`read_text_file`, `edit_text_file`, `write_text_file`), six cover plain filesystem tasks (`list_directory`, `directory_tree`, `create_directory`, `move_file`, `write_file`, `read_multiple_files`). Access rules live in `AGENTS.md` frontmatter: `forbidden` blocks a path, `read_only` permits reads but not writes, `ignore` keeps a directory out of the agent's context. Put the file anywhere in the tree and the nearest one applies. `.gitignore` patterns are honored too, with `AGENTS.md` taking precedence.

Build it with `cargo build --release`; the binary lands at `target/release/hashfile-mcp`. Rust has to be installed first, and you point your MCP client config at that binary path yourself. The server pulls in no dependencies.

## Requirements
- Needs: a prebuilt binary from the repository releases

## Install

### Claude Code (native platform)

**Install**
- The MCP registry has no launch command for it: see the repository README

## When to use it
- edit a file that shifted since the last read without hitting the wrong line
- keep an agent out of `.env` files and private keys
- let an agent read lock files and schemas but never write them
- hide `node_modules` and build output from agent context
- apply several edits in one atomic operation

## Example prompts
- Read `src/main.rs` and replace the line with the `main` function
- Add a `forbidden` rule for `secrets/**` and `**/*.env` to `AGENTS.md`
- Show the project tree without `node_modules` and `target`

## Similar
- [no-heredoc](https://affpapa.org/en/nevibecode/rules/no-heredoc.md) — rule · ★ 40451
- [access](https://affpapa.org/en/nevibecode/skills/anthropics-access.md) — skill · 3867 installs
- [access-control-rbac](https://affpapa.org/en/nevibecode/skills/access-control-rbac.md) — skill · 757 installs
- [security-guidance](https://affpapa.org/en/nevibecode/skills/owasp-security-guidance.md) — skill · 401 installs
- [node9](https://affpapa.org/en/nevibecode/mcp/node9.md) — MCP server · ★ 219
- [Koma Core MCP](https://affpapa.org/en/nevibecode/mcp/koma-core-mcp.md) — MCP server · ★ 13

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
