github-vault-mcp
Indexes and searches the user's public and private GitHub repositories, syncing repository metadata, file trees, READMEs, and key manifests into a local SQLite FTS5 knowledge base for AI agents to query and reuse.
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., "@github-vault-mcp Search my repos for FastAPI JWT auth patterns and show the best example."
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.
github-vault-mcp
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.
Key Features
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.
Related MCP server: code-memory-rs
Architecture Overview
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 --> Domaindomain/: 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).
Installation & Initial Sync
Prerequisites
Python 3.12+
Authenticated GitHub CLI (
gh auth login) or aGITHUB_TOKENenvironment variable withreporead access
Setup
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 --forceRegistering with AI Coding Agents
Antigravity (agy)
Add 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"
]
}
}
}Claude Code CLI
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"
]
}
}
}MCP Tools & Prompt Reference
Primitive | Type | Parameters | Purpose |
| Tool |
| Weighted BM25 search across indexed repos, returning focused snippets |
| Tool |
| Returns metadata, file tree, full |
| Tool |
| Reads a specific 1-based line range from an indexed file |
| Tool |
| Runs incremental (or forced) GitHub sync and returns summary counts |
| Prompt |
| Guides the agent to search your vault, inspect top blueprints, cross-reference Context7/docs, and synthesize an aligned plan |
Indexing & Filtering Rules
Included Extensions:
.py,.ts,.tsx,.js,.go,.rs,.md,.toml,.yaml,.yml,.json,.sql,.shIncluded Exact Filenames:
Makefile,DockerfileExcluded Filenames:
uv.lock,package-lock.json,pnpm-lock.yaml,yarn.lock,poetry.lock,.gitignore,.DS_StoreExcluded Directories:
.git/,.venv/,venv/,node_modules/,__pycache__/,dist/,build/,.pytest_cache/,.ruff_cache/Max File Size:
150 KB(153,600bytes) per file
Environment Variables
Variable | Default | Description |
|
| Local SQLite FTS5 database path |
|
| Fallback token when |
|
| Default GitHub owner handle |
|
| Include forked repositories during sync |
|
| Hours before MCP startup triggers a background sync ( |
Development
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 artifactsLicense
This project is licensed under the MIT License.
Available Tools
4 toolsget_project_blueprintA
Retrieve the architectural blueprint of an indexed GitHub repository.
Call this tool right after finding a relevant repository via
search_my_repositories to understand its overall architecture,
dependencies, directory layout, README documentation, and build/tooling
conventions before reading individual implementation files.
Args: repo_name: Exact repository name (e.g. "karasu-eval", "python-template").
Inputs: repo_name (required). Returns: object
read_repository_fileA
Read a specific line range from a file indexed in the local repository vault.
Use this after search_my_repositories or get_project_blueprint to
inspect exact implementation details without loading entire large files
into the context window.
Args: repo_name: Exact repository name. file_path: Relative file path inside the repository. start_line: 1-based inclusive start line (default 1). end_line: 1-based inclusive end line (default 200).
Inputs: file_path (required), repo_name (required), end_line, start_line. Returns: object
search_my_repositoriesA
Search the user's personal GitHub repositories indexed in the local vault.
ALWAYS call this tool during architectural planning (plan-mode) whenever designing a feature, choosing a library, setting up project tooling, or solving a domain problem (for example: LLM evaluation, agents, CI gates, templates, MCP servers, or data pipelines) to check how the user already solved or structured similar problems in their own GitHub repositories, complementing external documentation such as Context7.
Args: query: Search terms (e.g. "karasu-eval", "ruff pyright makefile", "fastapi sqlite"). repo_filter: Optional exact repository name to restrict the search. file_extension: Optional file extension filter (e.g. ".py", ".md", "toml"). limit: Maximum number of ranked matches to return (default 8, max 50).
Inputs: query (required), limit, repo_filter, file_extension. Returns: object
sync_repositoriesA
Synchronize the user's GitHub repositories into the local SQLite FTS5 vault.
Uses incremental pushed_at comparison so unchanged repositories are
skipped unless force=True is passed.
Args:
force: When True, re-indexes all repositories even if pushed_at
matches the local database.
Inputs: force. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct step in a clear pipeline: sync the vault, search it, get a repository-wide blueprint, then read a specific file range. The descriptions explicitly sequence the tools (search -> blueprint -> read_repository_file), so an agent can tell exactly which one to pick. No two tools appear interchangeable.
All four names follow a consistent verb_noun snake_case pattern (search_my_repositories, get_project_blueprint, read_repository_file, sync_repositories). The wording is predictable and self-documenting.
Four tools is a tight, well-scoped surface for a read-only local repository vault: one ingestion tool and three retrieval tools. Each tool earns its place with no filler or near-duplicates.
The lifecycle from indexing to targeted retrieval is fully covered, including incremental sync. The main gap is the absence of a list-repositories or directory-listing tool, meaning the agent must already know exact repo names and file paths, though search_my_repositories partly compensates.
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Codebase memory for AI coding agents: files, lines, callers and tests for any public GitHub repo.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to chat with codebases by indexing local directories or GitHub repositories into a vector database for semantic search and code retrieval.15MIT
- FlicenseNot gradedqualityDmaintenanceEnables local semantic code search across repositories using natural language, with AST-aware chunking and hybrid vector/FTS5 retrieval.-
- AlicenseNot gradedqualityDmaintenanceProvides intelligent code indexing with 15 MCP tools for symbol extraction, hybrid search (FTS5+vector), call graphs, and incremental indexing of local folders and remote repos, enabling token-efficient code retrieval for AI agents.3MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to persist and retrieve project-scoped memories across sessions using local SQLite FTS5 keyword search.1MIT