repo-snapshot
Reads and manages the user's local Git repositories: fetches and safely fast-forwards clean default branches (dirty, diverged or locked trees are only reported), then exports committed content via git archive as a zip plus an identical browsable directory tree.
Uploads snapshot zips and browsable repo trees to a staging folder on an rclone-configured cloud remote, promotes it atomically with a server-side rename, archives the previous snapshot and applies daily/weekly/monthly retention.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
repo-snapshot
Export your local Git repositories to a timestamped, browsable snapshot on a cloud drive, once a day or on demand. Chat assistants and other tools that can read the drive but not your machine (or that hit Git host API limits) can then read your code from the snapshot.
Each run, in parallel and per repository:
fetches and safely fast-forwards clean default branches (dirty, diverged or locked trees are never touched, only reported),
exports committed content with
git archiveaszips/<repo>.zipplus a browsablerepos/<repo>/tree with identical contents and a SHA-256 for every zip,blocks any repo that contains secret-looking filenames or a
gitleaksfinding before upload,uploads to a staging folder, promotes it atomically with a server-side rename, archives the previous snapshot and applies daily/weekly/monthly retention.
One failing repo never stops the others. Only run-level failures (no rclone, expired drive
login, nothing exported) abort the run, and they leave the previous snapshot untouched.
It works with no AI client at all. The same operations are also an MCP server and a portable skill for Claude Code, Codex and Antigravity.
Requirements
Python 3.11+, git, rclone with a configured remote (credentials stay in
rclone), and gitleaks (required by default; set
secret_scan.required = false to fall back to the filename guard only).
Related MCP server: lgh
Install
uv tool install repo-snapshot # CLI only
uv tool install 'repo-snapshot[mcp]' # CLI plus the MCP serverQuick start
mkdir -p ~/.config/repo-snapshot
cp config/repo-snapshot.template.toml ~/.config/repo-snapshot/config.toml # then edit it
repo-snapshot doctor # tools, config, drive reachability, free space
repo-snapshot run --dry-run # plan only: nothing is written locally or remotely
repo-snapshot run # the real thingOther commands: sync, export [--no-upload --output-dir DIR], archive [--dry-run],
status, config show [--effective], logs path [--latest], logs prune. Every command
that reports results accepts --json.
Exit codes
Code | Meaning |
0 | Everything synced, exported, scanned, uploaded and promoted |
2 | Usage error |
3 | Run-fatal: missing tool, drive auth or reachability, no disk, peer run active, nothing exported, upload or promotion failure, or a secret under |
10 | Partial success: a snapshot was promoted but at least one repo needs attention (dirty, diverged, locked, sync error, export failure, blocked secret) or housekeeping failed |
78 | Configuration error (unknown key, bad value, missing or malformed file) |
A systemd unit should treat 10 as success-with-warnings (SuccessExitStatus=0 10).
Configuration
Layers, lowest to highest precedence: packaged defaults, machine defaults ([logging] only),
~/.config/repo-snapshot/config.toml, --config PATH or REPO_SNAPSHOT_CONFIG,
REPO_SNAPSHOT_SECTION__KEY environment variables, then repeatable --set section.key=value.
Unknown keys are errors. See config/repo-snapshot.template.toml for every setting.
Repository selection is fail-closed: exclude_repos globs and symlinks are rejected before any
Git read, allowed_remote_owners and denied_remote_patterns filter on the origin URL, and
include_repos only bypasses the owner allowlist.
Logs
run, sync, export, archive, status, doctor and mcp serve each write a trace-level log to
~/.logs/repo-snapshot/YYYY/MM/DD/repo-snapshot-<command>-<pid>-<UTC>.log (mode 0600), appends to
.runs.jsonl, updates latest, and redacts environment secrets and token shapes before writing.
repo-snapshot logs prune applies the [logging.retention] budget. The last run summary is in
~/.local/state/repo-snapshot/last-run.json.
MCP and client plugins
repo-snapshot mcp serve --transport stdio # tools: snapshot_run / sync / archive / status / doctor
repo-snapshot mcp call snapshot_status # same dispatcher, no SDK needed
repo-snapshot plugin generate --host claude --out ./plugin-claude # or codex, agysnapshot_archive defaults to dry_run = true. Over stdio, logs go to stderr so stdout carries
only protocol frames. The streamable-HTTP transport binds loopback only, validates Origin and
requires a per-run bearer token written to a 0600 file in the state directory. Generated plugins
contain thin manifests that launch the installed repo-snapshot; they ship no bin/ directory.
Scheduling
repo-snapshot run is a plain command with stable exit codes, so any scheduler works. With
systemd, a user timer with Persistent=true and SuccessExitStatus=0 10 is enough.
Development
uv sync --all-extras
uv run pytest -q
uv run ruff check .
python scripts/oss_hygiene.py # no private ids, hosts or paths in tracked filesMIT licensed.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Manage repositories, users, releases, and automate GitHub workflows
Runnable, versioned lists for agents: tools, prompts and lists as resources. Git under the hood.
Versioned cloud drives for AI agents: read, search and edit files, fork a drive, review, undo.
1Read, search, edit, commit and run approved commands in projects on your own Mac or Linux computers.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides 18 tools for repository snapshot, release readiness, secret scanning, and approval-gated file writes with backup and audit log.18MIT
- AlicenseAqualityBmaintenanceLocal-first Git hosting for AI coding agents. lgh serve turns any directory into an HTTP Git remote (127.0.0.1:9418) with push events, commit-status reporting, smart .gitignore generation, secret/large-file detection, and optional LAN sharing with auth. The MCP server exposes 10 tools covering repo registration, one-command backup (lgh up), server control, and event access.131MIT
- FlicenseAqualityDmaintenanceEnables inspecting local Git repositories and automating delivery tasks such as status checks, diffs, commits, pull requests, and deployments using git and GitHub CLI.6-
- AlicenseCqualityCmaintenanceEnables MCP clients to inspect and modify local git repositories by running commands such as status, log, diff, add, commit, branch, and stash. Push operations are not performed locally; instead diffs are sent to a configurable HTTP API that handles the upload, with all other remote git commands blocked.27MIT