Hex Line

v1.31.0
io.github.levnikolaevich/hex-line-mcp Checked 9 hours ago Published 6 months ago

Hash-verified file editing MCP server with token efficiency hook for AI coding agents.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

read_file Read File

Read file with progressive disclosure. Default: minimal plain partial read for discovery; enable edit-ready metadata explicitly when preparing a verified edit.

ParameterTypeDescription
edit_readybooleanInclude hash/checksum edit protocol blocks explicitly. Default: false for discovery reads.
file_pathstringFile path
file_pathsarrayArray of file paths to read (batch mode)
limitnumberMax lines (default: 200 for discovery, 2000 for edit-ready, 0 = all)
offsetnumberStart line (1-indexed, default: 1)
plainbooleanOmit hashes (lineNum|content)
rangesLine ranges, e.g. ["10-25", {"start":40,"end":55}]
verbositystringResponse budget. `minimal` is discovery-first, `compact` adds revision context, `full` preserves the richest payload.

edit_file Edit File

Apply hash-verified partial edits to one file. Batch ALL hunks for the same file into ONE call via the `edits` array -- separate sequential edit_file calls on one file go stale and conflict (the most common edit failure). Carry base_revision only for a genuinely later follow-up after the file changed. Anchors accept tag.N, a bare line number, or unique line content (auto-resolved); range_checksum accepts "auto" to compute it for the current range. Preserves existing line endings and trailing-newline shape; conservative conflicts return retry helpers. boundary_mode=inclusive deletes the anchor…

ParameterTypeDescription
edits *JSON array of canonical edits. [{"set_line":{"anchor":"ab.12","new_text":"x"}}] [{"replace_lines":{"start_anchor":"ab.10","end_anchor":"cd.15","new_text":"x","range_checksum":"10-15:a1b2"}}] [{"insert…
file_path *stringFile to edit
allow_externalbooleanAllow editing a path outside the current project root. Use only when you intentionally target a temp or external file.
base_revisionstringPrior revision from read_file/edit_file. Enables conservative auto-rebase for same-file follow-up edits.
conflict_policystringConflict handling (default: "conservative"). "conservative" returns structured CONFLICT output with recovery_ranges, retry_edit/retry_edits, suggested_read_call, and retry_plan when available.
dry_runbooleanPreview changes without writing
restore_indentbooleanAuto-fix indentation to match anchor (default: false)

write_file Write File

Create a new file or overwrite existing. Creates parent dirs. For existing files prefer edit_file (shows diff, verifies hashes).

ParameterTypeDescription
content *stringFile content
file_path *stringFile path
allow_externalbooleanAllow writing a path outside the current project root. Use only when you intentionally target a temp or external file.

outline File Outline

AST-based structural outline with hash anchors for direct edit_file usage. Supports JavaScript/TypeScript, Python, C#, and PHP code files plus markdown headings (.md/.mdx, fence-aware).

ParameterTypeDescription
file_path *stringSource file path

verify Verify Checksums

Check if held checksums are still valid without rereading. Use before delayed or mixed-tool follow-up edits; returns canonical status, next_action, and reread guidance.

ParameterTypeDescription
checksums *arrayChecksum strings, e.g. ["1-50:f7e2a1b0", "51-100:abcd1234"]
file_path *stringFile path
base_revisionstringOptional prior revision to compare against latest state.

inspect_path Inspect Path

Inspect a file or directory path. Files return compact metadata; directories return a gitignore-aware tree or pattern matches.

ParameterTypeDescription
path *stringFile or directory path
formatstring"compact" = shorter path view, "full" = include sizes/metadata where available
gitignorebooleanRespect root .gitignore patterns (default: true). Nested .gitignore not supported
max_depthnumberMax recursion depth (default: 2 for discovery, or 20 in pattern mode)
max_entriesnumberMax entries to show in pattern mode before truncation metadata is returned (default: 60, 0 = unlimited)
patternstringGlob filter on names (e.g. "*-mcp", "*.mjs"). Returns flat match list instead of tree
typestring"file", "dir", or "all" (default). Like find -type f/d
verbositystringResponse budget. `minimal` returns the shortest tree summary.

changes Semantic Diff

Semantic diff against git ref (default: HEAD). Returns canonical status, summary, next_action, changed symbols, and graph-backed risk hints when available.

ParameterTypeDescription
path *stringFile or directory path
compare_againststringGit ref to compare against (default: "HEAD")

bulk_replace Bulk Replace

Search-and-replace text across multiple files inside an explicit root path. Use for renames and refactors when the project scope is known.

ParameterTypeDescription
path *stringRoot directory for the replacement scope
replacements *JSON array of {old, new} pairs: [{"old":"foo","new":"bar"}]
allow_externalbooleanAllow a replacement root outside the current project root. Use only when you intentionally target a temp or external directory.
dry_runbooleanPreview without writing (default: false)
formatstring"compact" (default) = summary only, "full" = include capped diffs
globstringFile glob (default: "**/*.{md,mjs,json,yml,ts,js}")
max_filesnumberMax files to process (default: 100)