Local-first Model Context Protocol (MCP) server that indexes all public and private GitHub repositories of a user (carvalhocaio by default) into a local SQLite FTS5 knowledge base.
AI coding agents (Antigravity CLI, Claude Code CLI) can query your own repositories during planning and implementation to reuse established architectures, toolchains, CI gates, and domain patterns instead of reinventing them.
- Local-First SQLite FTS5 Search: Fast full-text search with safe query sanitization (handles hyphens like
karasu-eval, slashes, colons, and boolean keywords without syntax errors). - BM25 Column Weighting: Prioritizes matches in
repo_name(10.0),file_path(8.0),repo_description(5.0), andrepo_topics(5.0) over genericcontent(1.0), surfacingREADME.mdand domain-named repositories first. - Incremental GitHub Sync & Pruning: Compares each repository's
pushed_attimestamp against the local database, skips unchanged repositories unless--forceis passed, and automatically prunes repositories deleted on GitHub fromrepositories,files, andfiles_fts. - Automatic Background Sync: On MCP server startup, checks
last_global_sync_atand runs a non-blocking background sync if the configuredVAULT_AUTO_SYNC_HOURSTTL has elapsed (protected by a SQLite WAL lock so concurrent clients do not collide). - Concurrent Blob Ingestion: Fetches recursive git trees and downloads blobs concurrently with
httpx.AsyncClientandasyncio.Semaphore(10). - Zero-Friction Auth: Resolves your token via
gh auth tokenfirst, falling back toGITHUB_TOKEN. - Strict Noise Filtering: Indexes only code, docs, and config files under 150 KB while excluding lockfiles and build/cache directories.
flowchart LR
CLI["cli.py<br/>(stdio MCP or sync)"] --> MCP["interfaces/mcp/server.py<br/>(FastMCP tools & prompt)"]
CLI --> SyncSvc["application/sync_service.py"]
MCP --> SyncSvc
MCP --> Store["infrastructure/sqlite_store.py<br/>(SQLite + FTS5 BM25)"]
SyncSvc --> GH["infrastructure/github_client.py<br/>(gh CLI / GITHUB_TOKEN + httpx)"]
SyncSvc --> Store
SyncSvc --> Domain["domain/<br/>(models, filters, exceptions)"]
GH --> Domain
Store --> Domain
domain/: Immutable Pydantic models, domain exceptions, and pure file-filtering rules.infrastructure/: GitHub REST client (github_client.py) and SQLite FTS5 persistence (sqlite_store.py).application/: Incrementalpushed_atsynchronization orchestrator (sync_service.py).interfaces/mcp/:FastMCP(stdio) server exposing 4 tools and 1 planning prompt (server.py).
- Python 3.12+
uv- Authenticated GitHub CLI (
gh auth login) or aGITHUB_TOKENenvironment variable withreporead access
cd /home/clancy/www/github-vault-mcp
uv syncRun an initial repository index from your terminal (optional—the MCP server also triggers a background sync automatically on first startup):
uv run github-vault-mcp syncTo force a full re-index regardless of pushed_at timestamps:
uv run github-vault-mcp sync --forceAdd the server to your Antigravity MCP configuration (~/.gemini/config/mcp_config.json or project .mcp.json):
{
"mcpServers": {
"github-vault": {
"command": "uv",
"args": [
"--directory",
"/home/clancy/www/github-vault-mcp",
"run",
"github-vault-mcp"
]
}
}
}Register via CLI:
claude mcp add github-vault -- uv --directory /home/clancy/www/github-vault-mcp run github-vault-mcpOr add directly to ~/.claude.json:
{
"mcpServers": {
"github-vault": {
"command": "uv",
"args": [
"--directory",
"/home/clancy/www/github-vault-mcp",
"run",
"github-vault-mcp"
]
}
}
}| Primitive | Type | Parameters | Purpose |
|---|---|---|---|
search_my_repositories |
Tool | query, repo_filter?, file_extension?, limit=8 |
Weighted BM25 search across indexed repos, returning focused snippets |
get_project_blueprint |
Tool | repo_name |
Returns metadata, file tree, full README.md, and key manifests (pyproject.toml, package.json, Makefile, go.mod, Cargo.toml, Dockerfile) |
read_repository_file |
Tool | repo_name, file_path, start_line=1, end_line=200 |
Reads a specific 1-based line range from an indexed file |
sync_repositories |
Tool | force=False |
Runs incremental (or forced) GitHub sync and returns summary counts |
plan_with_personal_vault |
Prompt | task_description |
Guides the agent to search your vault, inspect top blueprints, cross-reference Context7/docs, and synthesize an aligned plan |
- Included Extensions:
.py,.ts,.tsx,.js,.go,.rs,.md,.toml,.yaml,.yml,.json,.sql,.sh - Included Exact Filenames:
Makefile,Dockerfile - Excluded Filenames:
uv.lock,package-lock.json,pnpm-lock.yaml,yarn.lock,poetry.lock,.gitignore,.DS_Store - Excluded Directories:
.git/,.venv/,venv/,node_modules/,__pycache__/,dist/,build/,.pytest_cache/,.ruff_cache/ - Max File Size:
150 KB(153,600bytes) per file
| Variable | Default | Description |
|---|---|---|
VAULT_DB_PATH |
~/.local/share/github-vault-mcp/vault.db |
Local SQLite FTS5 database path |
GITHUB_TOKEN |
None |
Fallback token when gh auth token is unavailable |
VAULT_GITHUB_USER |
carvalhocaio |
Default GitHub owner handle |
VAULT_INCLUDE_FORKS |
false |
Include forked repositories during sync |
VAULT_AUTO_SYNC_HOURS |
6.0 |
Hours before MCP startup triggers a background sync (0 disables auto-sync) |
make sync # Install runtime and dev dependencies
make check # Run ruff check, ruff format --check, pyright, and pytest
make lint-fix # Auto-fix ruff lint issues
make format # Format codebase with ruff
make audit # Run pip-audit vulnerability check
make clean # Remove caches and build artifactsThis project is licensed under the MIT License.