# Hashfile MCP [Health: Active]

**Category:** 📂 File Systems  
**Repository:** https://github.com/mrorigo/hashfile-mcp  
**GitHub Stars:** 5  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/hashfile-mcp

## Description
Hash-anchored file editing with surgical precision over file editing and ironclad control of access

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/mrorigo/hashfile-mcp), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Install:

```sh
cargo build --release
```

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/hashfile-mcp/readme_

