Personal RAG over your GitHub history (commits, code, reviews), served to Claude Code over MCP.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
You reviewed a permission check six months ago. Claude doesn't remember it. github-twin does β it indexes your commits and review comments, and surfaces them as retrieval hits whenever an agent writes or reviews new code in your style.
Try it now from Claude Code β drop this into ~/.claude.json and reload:
Your code stays on your box. Embeddings are computed locally (Ollama or sentence-transformers); only the LLM seam (
gt summarize,gt distill,gt eval) optionally calls a hosted provider, and even that's swappable to local Ollama. Thegeminiembedder is the one exception β opt-in only.
A personal RAG over your GitHub history, served to Claude Code (or any MCP client) as a stdio server. Two scopes, one codebase:
Retrieval is hybrid (BM25 + vector via RRF), AST-aware via tree-sitter for python/scala/javascript/typescript/go/rust, and contextually enriched at embed time with per-chunk headers + optional LLM-generated summaries.
The fastest path is uvx β no virtualenv to manage, isolated per-tool:
If you prefer a project-local install:
gt and github-twin are the same Typer app β use whichever fits your
muscle memory.
Pick whichever is least friction β github-twin tries them in this order:
gh install needed):
Token persists in the OS keyring (macOS Keychain / Linux Secret
Service / Windows Credential Manager) or, when unavailable, a 0600
file under your data dir.gh CLI: if you've already run gh auth login,
gt picks up the token via gh auth token β nothing to do.GITHUB_TOKEN env var: a classic PAT works too; useful for CI /
headless / docker. Required scopes: repo, read:org, user:email.The MCP server runs over stdio via github-twin serve (or gt serve).
Run uvx github-twin auth login once on the box that will host the
server.
Option A β via the Claude Code plugin marketplace (lowest-friction):
This registers the MCP server entry automatically; set
GT_PATHS__DATA_DIR in your environment (or in ~/.claude.json's
env block for this server) to point at the DB directory.
Option B β manual wiring: add an entry to ~/.claude.json (or
your mcp_servers.json):
If you'd rather not persist a token and instead supply it inline (CI,
ephemeral container), add "GITHUB_TOKEN": "ghp_..." to that env
block; it acts as the lowest-priority fallback.
Restart Claude Code; the find_*, predict_review_outcome,
summarize_review_patterns, and sync tools will be available.
Pick a directory to hold the SQLite DB, config, and ingested cache β everything per-data-dir lives under this one root:
gt sync is incremental on subsequent runs.
config.toml lives next to the DB at <data_dir>/config.toml and is
created on the first gt init --embed-backend ... call. Default
<data_dir> is $XDG_DATA_HOME/github-twin (or ~/.local/share/github-twin)
when GT_PATHS__DATA_DIR is unset.
The retrieval surface (find_*, predict_review_outcome) always runs locally on the SQLite index β no API call. LLM calls only happen in three places:
gt distill β clusters review comments / commits into rules.gt summarize β generates per-chunk NL summaries used by the embed-time
prefix.gt eval reviews / eval predictions β held-out RAG-vs-baseline scoring.Each picks a backend by precedence Claude β Gemini β Ollama (whichever API key is set), or you can force one explicitly.
| Provider | Env var | What it covers |
|---|---|---|
| Anthropic (Claude) | ANTHROPIC_API_KEY | Distill / summarize / eval LLM. Best quality. |
| Google (Gemini, API key) | GEMINI_API_KEY or GOOGLE_API_KEY | Distill / summarize / eval LLM. Free tier is generous. |
| Google (Gemini, Vertex / ADC) | GT_GEMINI_PROJECT (+ optional GT_GEMINI_LOCATION, default us-central1) | Same backends, but auth via gcloud auth application-default login β no key in your shell. API key wins if both are set. |
| Ollama (local) | OLLAMA_HOST (default http://127.0.0.1:11434) | Distill / summarize / eval LLM. Fully offline. |
The Vertex / ADC path needs the aiplatform.googleapis.com API enabled
on your project, and billing applies even for "free" Gemini models β
the AI Studio free tier does not extend to Vertex. Project IDs are not
secrets; the credential itself lives at
~/.config/gcloud/application_default_credentials.json and is refreshed
by gcloud.
We keep the embedder backend separate from the LLM backend. Choose one:
nomic-embed-text, 768-dim, ~50ms/chunk).
Requires a running Ollama daemon. Zero cost, fully local.uv add 'github-twin[st]',
pulls torch). Useful when an Ollama daemon isn't available or you
want a specific HuggingFace model. Local.gemini-embedding-001 at 3072-dim by
default). Uses the google-genai dep that's already installed; auth
via GEMINI_API_KEY / GOOGLE_API_KEY, or via GT_GEMINI_PROJECT
gcloud auth application-default login) to route through
Vertex AI without managing a key. Remote β this is the only
embedder that sends chunk text off-box. Pick it when you have Gemini
auth but no Ollama / [st] install, and your corpus is okay to
share with Google.The embedder is a per-DB commitment β sqlite-vec bakes the vector
dimension into the table at first creation. Stamp the choice into
<data_dir>/config.toml at init time so every subsequent command
picks it up:
Re-running with the same values is a no-op; running with different
values against an existing config.toml fails loud rather than
silently changing the corpus. GT_EMBED__* env vars still work for
one-off overrides and CI.
A "cloud-LLM only" setup either needs an embedder process (Ollama /
[st]) or has to opt into the remote Gemini embedder.
When you gt init, the GH client needs:
repo β private repos and PR comments on themuser:email β verified email addresses for the user-mode identity sweepread:org β org member listing and private org repo discoveryA fine-grained PAT works; classic tokens too.
Hybrid search by default: BM25 (SQLite FTS5) and vector similarity run in
parallel, then fuse via Reciprocal Rank Fusion (k=60). The vector leg
matches semantic intent; the BM25 leg catches exact identifiers
(getUserById, SQLITE_OPEN_READWRITE) that vector search routinely
misses. Design reference: Anthropic β Contextual
Retrieval.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/github-twin)<a href="https://allmcps.com/mcp/github-twin"><img src="https://allmcps.com/api/badge/github-twin?style=directory" alt="Github Twin on AllMCPs" /></a>