doc-version-mcp
Synchronizes Git repositories via record_git_pull_event, performing git pull --rebase with autostash and creating upstream snapshots for collaboration.
Provides versioning and AST diffing for LaTeX documents in paper mode, including analysis of mathematical environments, sections, and AI-stylometry metrics.
Supports versioning and AST diffing for Markdown documents with word-level diffs and AI-compliance auditing in paper mode.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@doc-version-mcp Commit the latest draft of my paper and show a diff against the last commit."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π doc-version-mcp
FastMCP Server for Document Versioning, Content-Addressable Storage (CAS), AST Diffs, and AI-Compliance Auditing.
doc-version-mcp provides a robust, local-first document versioning engine built on top of the Model Context Protocol (MCP). It brings Git-like precision to LLM agents and human authors without cluttering Git commit histories, offering deterministic snapshots, word-level differential AST projections, and collaborative safety rails.
β‘ Quick Start (Windows PowerShell One-Liner)
Install and configure doc-version-mcp automatically with a single command in PowerShell:
irm https://raw.githubusercontent.com/hjamet/doc-version-mcp/main/install.ps1 | iexThe installer automatically:
Detects or creates the target directory (
~/Documents/code/doc-version-mcp).Configures a dedicated Python virtual environment (
.venv) with all dependencies.Initializes the Content-Addressable Storage (CAS) hierarchy at
~/.gemini/antigravity/cas_commits/.Registers the server into your Antigravity MCP configuration (
mcp_config.json).Copies metadata schemas and installs command-line wrappers (
doc-version.cmd,doc-version.ps1).
Related MCP server: Lians Agent Memory
ποΈ Architecture & Key Features
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LLM Agent / User β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β FastMCP Stdio Transport
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β doc-version-mcp β
β βββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ β
β β CAS Storage Engine β β AST & Diff Generator β β
β β - SHA-256 Addressing β β - LaTeX & KaTeX Diffs β β
β β - zlib Level 9 Compress β β - Mode 'paper' & 'draft'ββ
β β - Isolated Commit Trees β β - AI Compliance Auditingββ
β βββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Local Storage & Workspace Integrity β
β ~/.gemini/antigravity/cas_commits/{commits,objects}/ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββContent-Addressable Storage (CAS): Documents are stored as immutable, content-addressed blobs compressed via
zlib(level 9) and indexed by SHA-256 hashes, keeping disk overhead minimal.Dual Operational Modes:
paperMode: Tailored for scientific manuscripts (LaTeX and Markdown). Analyzes mathematical environments, AST sections, and evaluates AI-stylometry metrics ($P(\text{AI}) < 0.10$).draftMode: Dedicated to precision editing of drafts. Audits<XXX>uncertainty placeholders and enforces a strict text retention threshold ($\ge 90%$).
Deterministic Collaboration:
Seamless upstream synchronization (
record_git_pull_event) with automatic stashing (--autostash).Strict preservation of co-author contributions with blocking conflict detection.
Zero uncontrolled global rewrites: changes are validated block-by-block.
Local-First & Portable: Pure local Python package, independent of cloud services and fully compatible with multi-machine setups.
π οΈ MCP Tools Reference
doc-version-mcp exposes 6 declarative MCP tools:
Tool Name | Description | Key Parameters |
| Creates a timestamped CAS snapshot of a document on disk or in virtual memory. |
|
| Computes surgical word-level diffs and generates an interactive Markdown artifact in Antigravity Brain. |
|
| Restores a document from a historical CAS commit ID. Supports dry-run preview. |
|
| Lists stored CAS commits with timestamps, authors, and metadata. |
|
| Purges expired snapshots based on TTL and disk quota, protecting pinned baselines. |
|
| Synchronizes a Git repository via |
|
π§ Client Configuration Guide
1. Google Antigravity
Add the server to ~/.gemini/antigravity/mcp_config.json:
{
"mcpServers": {
"doc-version": {
"command": "C:\\Users\\<USER>\\Documents\\code\\doc-version-mcp\\.venv\\Scripts\\doc-version.exe",
"args": [],
"env": {
"SystemRoot": "C:\\Windows",
"PATH": "%PATH%"
}
}
}
}2. Claude Desktop
Add to %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"doc-version": {
"command": "C:\\Users\\<USER>\\Documents\\code\\doc-version-mcp\\.venv\\Scripts\\doc-version.exe",
"args": []
}
}
}3. Cursor
Configure in .cursor/mcp.json or Global Settings:
{
"mcpServers": {
"doc-version": {
"command": "C:\\Users\\<USER>\\Documents\\code\\doc-version-mcp\\.venv\\Scripts\\doc-version.exe",
"args": []
}
}
}4. Claude Code CLI
claude mcp add doc-version -- C:\Users\<USER>\Documents\code\doc-version-mcp\.venv\Scripts\doc-version.exeπ» Local Development & Testing
Installation from Source
# Clone the repository
git clone https://github.com/hjamet/doc-version-mcp.git
cd doc-version-mcp
# Create and activate virtual environment
python -m venv .venv
.\.venv\Scripts\Activate.ps1
# Install in editable mode with development dependencies
pip install --upgrade pip
pip install -e ".[dev]"Running Test Suite
pytest tests/ -vManual Inspection & CLI Run
# Verify FastMCP server entry point
doc-version --helpπ License
This project is licensed under the terms of the MIT License.
Available Tools
6 toolscommit_documentCommit DocumentA
CrΓ©e un instantanΓ© horodatΓ© d'un document dans le Content-Addressable Storage (CAS). Supporte les fichiers sur disque et les mΓ©moires virtuelles (drafts sans fichier).
Inputs: target (required), message (required), mode, author, +2 more. Returns: result
get_diff_artifactGet Diff ArtifactB
Génère la vue différentielle chirurgicale AST et produit l'artéfact Markdown Antigravity. Supporte le mode paper (LaTeX/Markdown avec KaTeX) et le mode draft (audit syntaxique balises, rétention >=90%).
Inputs: target (required), mode, content, brain_dir, +4 more. Returns: result
list_commitsList CommitsC
Liste les commits stockΓ©s dans le CAS avec mΓ©tadonnΓ©es d'horodatage et auteur.
Inputs: mode, limit, target. Returns: result
prune_commitsPrune CommitsA
Purge les snapshots expirés selon le TTL et régule la taille totale sous max_size_mb. Protège les baselines épinglées (is_pinned) si keep_baselines=True.
Inputs: ttl_days, max_size_mb, keep_baselines. Returns: result
record_git_pull_eventRecord Git Pull EventB
Synchronise un dΓ©pΓ΄t Git via git pull --rebase (--autostash), dΓ©tecte les conflits et enregistre un snapshot CAS horodatΓ© de l'Γ©tat rΓ©cupΓ©rΓ©.
Inputs: repo_path (required), autostash. Returns: result
restore_commitRestore CommitC
Restaure un document depuis son commit ID dans le CAS. Si dry_run=True, prΓ©visualise sans modifier le disque.
Inputs: commit_id (required), target, dry_run. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 6 tools
Each tool targets a distinct operation: git sync, snapshot creation, diff generation, restore, listing, and pruning. No overlapping purposes; descriptions clearly separate responsibilities.
All tools follow a consistent verb_noun snake_case pattern (record_git_pull_event, commit_document, get_diff_artifact, restore_commit, list_commits, prune_commits). Verbs and nouns are clear and predictable.
With 6 tools, the server is well-scoped for a document versioning domain. Each tool covers a core operation without redundancy, striking a balance between minimalism and functionality.
The tool surface covers the full lifecycle: create (commit_document), read/restore (restore_commit), list (list_commits), delete (prune_commits), diff (get_diff_artifact), and external integration (record_git_pull_event). No obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
Local-first long-term memory for AI agents, with byte-recomputable signed verification receipts.
A real-time, multiplayer filesystem for agents and humans: shared files, live edits, history.
A shared, governed brain for AI agents: versioned context with approvals, local or hosted.
A home for your agents: an owned book of record any AI agent can write to, with provenance and undo.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read and write a local-first knowledge base of plain markdown files in git, with governance gates for safe, hash-anchored edits.1Apache 2.0

Lians Agent Memoryofficial
AlicenseAqualityCmaintenanceLocal-first bitemporal memory for AI agents with deterministic supersession, point-in-time recall, erasure proofs, and tamper-evident audit history.917Apache 2.0- AlicenseAqualityDmaintenanceEnables AI agents to perform safe, semantic edits on Markdown and DOCX documents through a normalized model with staging, diff review, and stale-edit protection.13MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to create, read, update, and restore encrypted shared workspaces and artifacts addressed by a single link, so multiple agents and people can collaborate on the same living document. Writes are version-conditional to prevent clobbering, and content is encrypted client-side so the server only ever holds ciphertext.19 npmMIT