Skip to main content
Glama
doc-version-mcp

doc-version-mcp

by hjamet

πŸ“„ doc-version-mcp

Python 3.10+ FastMCP License: MIT

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 | iex

The installer automatically:

  1. Detects or creates the target directory (~/Documents/code/doc-version-mcp).

  2. Configures a dedicated Python virtual environment (.venv) with all dependencies.

  3. Initializes the Content-Addressable Storage (CAS) hierarchy at ~/.gemini/antigravity/cas_commits/.

  4. Registers the server into your Antigravity MCP configuration (mcp_config.json).

  5. 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:

    • paper Mode: Tailored for scientific manuscripts (LaTeX and Markdown). Analyzes mathematical environments, AST sections, and evaluates AI-stylometry metrics ($P(\text{AI}) < 0.10$).

    • draft Mode: 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

commit_document

Creates a timestamped CAS snapshot of a document on disk or in virtual memory.

target (str, req), message (str, req), author (str, default "agent"), content (str, opt), is_pinned (bool, default False), mode (str, default "paper")

get_diff_artifact

Computes surgical word-level diffs and generates an interactive Markdown artifact in Antigravity Brain.

target (str, req), diff_explanation (str, opt), brain_dir (str, opt), artifact_name (str, opt), mode (str, default "paper"), from_commit_id (str, opt), to_commit_id (str, opt)

restore_commit

Restores a document from a historical CAS commit ID. Supports dry-run preview.

commit_id (str, req), target (str, opt), dry_run (bool, default False)

list_commits

Lists stored CAS commits with timestamps, authors, and metadata.

target (str, opt), limit (int, default 10), mode (str, opt)

prune_commits

Purges expired snapshots based on TTL and disk quota, protecting pinned baselines.

ttl_days (int, default 14), max_size_mb (int, default 500), keep_baselines (bool, default True)

record_git_pull_event

Synchronizes a Git repository via git pull --rebase with autostash and creates an upstream snapshot.

repo_path (str, req), autostash (bool, default True)


πŸ”§ 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/ -v

Manual 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 tools
commit_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

    A3.5/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct operation: git sync, snapshot creation, diff generation, restore, listing, and pruning. No overlapping purposes; descriptions clearly separate responsibilities.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness5/5

    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

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to perform safe, semantic edits on Markdown and DOCX documents through a normalized model with staging, diff review, and stale-edit protection.
      13
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables 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 npm
      MIT