
Hashfile MCP
io.github.mrorigoPublished by GitHub account mrorigov0.3.0Updated Oct 24, 2026
Hash-anchored file editing with surgical precision over file editing and ironclad control of access
Overview
Local MCP server for hash-anchored file editing and AGENTS.md-based access control, giving assistants precise, verified read and write access to project files.
- What you can do
- Read files with hash-tagged lines and apply anchored replace, insert and delete operations with file-hash verification
- Write whole files and get hashline-tagged verification back
- Browse directories, render compact directory trees, create directories, move files and read several files at once
- Enforce AGENTS.md frontmatter rules (forbidden, read_only, ignore) and respect .gitignore patterns
- When to use it
- Useful when an assistant edits code in a project where files change between reads and line-number edits go wrong, or when you want declarative rules that keep agents away from secrets, lock files and build artifacts.
- Requirements
- Runs as a local stdio process; the README builds it from source with Cargo (Rust) or you install a prebuilt release binary for macOS, Linux or Windows. Configure the binary path in your MCP client. No accounts, API keys or environment variables are declared.
Installation
In SourceWeft
- Open Hashfile MCP in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
Hashfile MCP Server
Fine-Grained Control for AI File Operations — A Model Context Protocol (MCP) server that gives you surgical precision over file editing and ironclad control over file access.
Why Hashfile MCP?
🎯 Surgical File Editing
Unlike traditional line-number-based editing that breaks when files change, Hashfile uses content-anchored operations:
- Hash-Anchored Lines: Every line tagged with a content hash — edits target the right content, not just the right line number
- Fuzzy Matching: Automatically finds moved lines even after insertions/deletions
- Collision Detection: File-level verification prevents editing stale content
- Multi-Operation Edits: Apply multiple precise changes in a single atomic operation
🔒 Ironclad Access Control
Take complete control over what AI agents can touch with AGENTS.md frontmatter:
forbidden: Block access to secrets, credentials, sensitive dataread_only: Allow reading schemas, configs, lock files — prevent modificationsignore: Hide generated code, dependencies, build artifacts from AI context- Hierarchical Discovery: Place AGENTS.md anywhere in your tree — nearest file wins
- Glob Patterns: Fine-tune access with wildcards (
secrets/**,**/*.env)
📖 Full AGENTS.md Documentation | 📋 Proposal Spec
🛠️ Drop-In Filesystem Compatibility
All standard MCP filesystem tools included:
list_directory— Browse with[FILE]/[DIR]prefixesdirectory_tree— Compact tree view (10x more token-efficient than JSON)create_directory— Recursive directory creationmove_file— Rename/move files and directorieswrite_file— Raw UTF-8 writes (non-hashline)read_multiple_files— Batch reads in one operation
Features at a Glance
Installation
The binary will be at target/release/hashfile-mcp.
Quick Start
1. Configure Your MCP Client
Add to Claude Desktop or your MCP client config:
2. (Optional) Add Access Control
Create AGENTS.md in your project root:
3. Start Editing
The AI can now:
- ✅ Read and edit source files with hash-anchored precision
- ✅ Browse directories and create new files
- ❌ Cannot touch your secrets or
.envfiles - ❌ Cannot modify lock files or schemas
- 🙈 Won't see
node_modulesor build artifacts
How Hashline Works
The Problem
Traditional line-number editing fails when files change:
The Solution
Content-anchored editing with hash verification:
- Read: Each line gets a hash tag →
42:a3|const x = 1; - Edit: Operations reference content, not just position →
"anchor": "42:a3" - Apply: Server finds the line by hash, even if it moved to line 45
- Verify: File hash must match — detects if content changed since read
Reliability Features
- File-Level Verification: 6-character hash prevents editing stale content
- Line-Level Anchoring: 2-character hash identifies specific lines
- Fuzzy Matching: Searches for unique hash match if line number changed
- Conflict Detection: Clear errors if content diverged
Core Tools
Hashline Tools (Precision Editing)
read_text_file
Returns content with hash-tagged lines for reliable editing:
edit_text_file
Apply hash-anchored operations:
Operation types: replace, insert_after, insert_before, delete
write_text_file
Write content and get back hashline-tagged verification
Filesystem Tools (Standard Operations)
list_directory
directory_tree
Supports exclude_patterns for filtering (e.g., ["**/node_modules/**", "**/.git/**"])
create_directory, move_file, write_file, read_multiple_files
Standard filesystem operations with AGENTS.md enforcement
AGENTS.md Access Control
Constraint Types
Automatic .gitignore Support
Hashfile MCP automatically respects .gitignore files in your project:
- Hierarchical: Walks up from target file to find all
.gitignorefiles - Standard syntax: Supports standard
.gitignorepatterns (basename, directory, path) - Combined with AGENTS.md: Patterns from both sources are merged
- Zero config: Works out of the box with existing projects
Pattern conversion:
Precedence: AGENTS.md ignore patterns take precedence over .gitignore.
Example: Protect a Monorepo
Hierarchical Control
Place AGENTS.md files at any level:
The nearest AGENTS.md in the directory hierarchy applies.
Development
Run Tests
Project Structure
Technical Details
- Language: Rust (edition 2021)
- MCP SDK: rmcp 0.15.0
- Line Hashing: FNV-1a (2 hex chars, 256 buckets)
- File Hashing: FNV-1a (6 hex chars, 16M buckets)
- Transport: stdio
- Dependencies:
rmcp,serde,serde_json,serde_yaml,globset,anyhow,fnv
Roadmap
- Environment variable-based tool enablement (
ENABLE_FILESYSTEM_TOOLS=true) - Granular tool control (
ENABLE_LIST_DIRECTORY=true, etc.) - Additional tools:
get_file_info,search_files,list_directory_with_sizes - Command-line argument support for configuration
License
See LICENSE file for details.
See Also
- The Harness Problem - I Improved 15 LLMs at Coding in One Afternoon. Only the Harness Changed. - Can Bölük Feb 2026
- AGENTS.md Proposal - Frontmatter specification for agent access control
Source: README.md at commit 7fb6099
Tools
0Version history
1- v0.3.0LatestSep 16, 2026
Score
40% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Declare a license in the repository or the registry entry.