Skip to main content
Glama

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), and repo_topics (5.0) over generic content (1.0), surfacing README.md and domain-named repositories first.

  • Incremental GitHub Sync & Pruning: Compares each repository's pushed_at timestamp against the local database, skips unchanged repositories unless --force is passed, and automatically prunes repositories deleted on GitHub from repositories, files, and files_fts.

  • Automatic Background Sync: On MCP server startup, checks last_global_sync_at and runs a non-blocking background sync if the configured VAULT_AUTO_SYNC_HOURS TTL 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.AsyncClient and asyncio.Semaphore(10).

  • Zero-Friction Auth: Resolves your token via gh auth token first, falling back to GITHUB_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 --> 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/: Incremental pushed_at synchronization 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+

  • uv

  • Authenticated GitHub CLI (gh auth login) or a GITHUB_TOKEN environment variable with repo read access

Setup

cd /home/clancy/www/github-vault-mcp
uv sync

Run 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 sync

To force a full re-index regardless of pushed_at timestamps:

uv run github-vault-mcp sync --force

Registering 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-mcp

Or 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

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

Indexing & Filtering Rules

  • 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,600 bytes) per file

Environment Variables

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)

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 artifacts

License

This project is licensed under the MIT License.

Available Tools

4 tools
get_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

    A4.1/5.0

    Scored across 4 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables local semantic code search across repositories using natural language, with AST-aware chunking and hybrid vector/FTS5 retrieval.
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides 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.
      3
      MIT