Hashfile MCP logo

Hashfile MCP

Rust MCP server for hash-anchored file edits, filesystem operations, and AGENTS.md access controls.

Install Hashfile MCP

Run the project’s own setup commands, in order.

Setup steps from the project

Hashfile MCP installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    cargo build --release
    

Overview

Hashfile MCP MCP server exposes a Rust-based stdio interface for precise file editing and controlled filesystem access. It tags file lines with hashes, verifies file content before edits, and supports access rules from hierarchical AGENTS.md files and .gitignore patterns. Reach for it when an AI agent needs to modify changing files while avoiding secrets, generated artifacts, lock files, or other protected paths.

Use cases

  • Edit source files without relying on fixed line numbers
  • Protect secrets and environment files from agent access
  • Prevent changes to lock files and schemas
  • Hide dependencies and generated artifacts from context
  • Apply multiple verified edits in one request

Key features

  • Hash-anchored line editing
  • File-level stale-content verification
  • Fuzzy matching for moved lines
  • AGENTS.md access controls
  • Hierarchical .gitignore enforcement
  • Standard filesystem operations

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

12/12 checks healthy over the last 46d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars5Stargazers on the source repository.
Last commit8mo agoMost recent push to the default branch.

How Hashfile MCP works

What Hashfile MCP does

Hashfile MCP MCP server provides MCP tools for reading, editing, and managing files through a local filesystem interface. Its main distinction is hash-anchored editing: instead of relying only on line numbers, the server associates each line with a short content hash and checks the file's overall hash before applying changes.

The server also applies filesystem access rules. An AGENTS.md file can mark paths as forbidden, read_only, or ignore. These rules can be placed at different levels of a project tree, with the nearest applicable file taking precedence. Existing .gitignore patterns are also considered, helping keep dependencies, build output, and other ignored content out of the agent's view.

How it works

A read through read_text_file returns lines with hash tags, along with metadata including the total line count and a six-character file hash. An edit request supplies that file hash and one or more operations anchored to tagged lines. Supported operations are replace, insert_before, insert_after, and delete.

When content moves because lines were added or removed, fuzzy matching can locate the referenced line by its hash rather than trusting its original position. The file-level hash provides a separate stale-content check. If the file has diverged, or if an anchor cannot be resolved safely, the operation reports a conflict instead of silently changing an unintended location. Multiple operations can be submitted together as one edit request.

The Hashfile MCP MCP server runs over stdio. It is implemented in Rust using the rmcp SDK and uses FNV-1a hashing for both line and file verification. The line hash uses two hexadecimal characters, while the file hash uses six.

Setup and configuration

Build the release binary with:

bash
cargo build --release

The resulting executable is target/release/hashfile-mcp. Register that executable in an MCP client configuration by setting it as the server command. The documented example uses Claude Desktop, but the transport is standard stdio.

Access rules are optional. To add them, create an AGENTS.md file in the project or in a relevant subdirectory. Its frontmatter can list glob patterns under forbidden, read_only, and ignore. For example, a project can block .env files, allow reads but not writes to lock files, and hide node_modules or generated source files.

No environment variables are documented as required. Tool enablement through environment variables is listed as future work rather than current configuration.

Tools and capabilities

The server exposes nine tools divided into two groups:

  • read_text_file, edit_text_file, and write_text_file provide hashline-based reading, editing, and writing.
  • list_directory lists entries with [FILE] and [DIR] prefixes.
  • directory_tree returns a compact tree and accepts exclude_patterns.
  • create_directory creates directories recursively.
  • move_file moves or renames files and directories.
  • write_file performs raw UTF-8 writes without hashline formatting.
  • read_multiple_files reads several files in one operation.

The standard filesystem tools also enforce applicable AGENTS.md restrictions. forbidden paths block access, read_only paths block writes, and ignore paths are hidden from the agent context. .gitignore patterns are merged with these controls, while AGENTS.md ignore patterns take precedence.

Limitations and notes

Hashfile MCP MCP server is limited to the capabilities documented in the repository. It does not currently provide the planned environment-based tool switches, command-line configuration, file information lookup, file search, or directory listings with sizes.

The server uses stdio rather than a network transport, so the client must launch the compiled executable. Access behavior depends on the AGENTS.md and .gitignore files found in the relevant directory hierarchy; those files should be reviewed carefully before giving an agent write access to a project.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Hashfile MCP

Hashfile MCP is an MCP server that connects AI clients to a local filesystem through stdio. Its main tools provide hash-anchored text reading, editing, and writing, plus directory listing, tree views, file moves, directory creation, raw writes, and batch file reads with AGENTS.md access enforcement.

Build it with `cargo build --release`, then configure your MCP client to launch `target/release/hashfile-mcp` as a stdio server. The repository shows this setup for Claude Desktop and does not document required environment variables.

Create an `AGENTS.md` file with `forbidden`, `read_only`, or `ignore` glob patterns. Use `forbidden` to block access, `read_only` to prevent writes, and `ignore` to hide paths such as dependencies or generated files. Rules can be placed throughout the project tree.

It checks a six-character file hash before applying changes and anchors operations to hashed lines. Fuzzy matching can find a line after its position changes, while divergent file content or unresolved anchors produce a conflict instead of an unchecked edit.

The repository does not specifically name Cursor. It documents a standard stdio MCP configuration and says to add the executable to an MCP client configuration, so compatibility depends on the client's support for standard stdio MCP servers.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

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 PreviewHashfile MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/hashfile-mcp?style=directory)](https://allmcps.com/mcp/hashfile-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/hashfile-mcp"><img src="https://allmcps.com/api/badge/hashfile-mcp?style=directory" alt="Hashfile MCP on AllMCPs" /></a>