Your AI assistant can only help with code it can see. repo-ctx gives it searchable access to any Git repository — with real symbol extraction, dependency graphs, and architecture analysis across 12+ languages. Set up in one command.
AI coding assistants are powerful — but blind. They only know what's in the current file or what you paste in. When you need help understanding a dependency, navigating an unfamiliar codebase, or analyzing architecture across repositories, you're on your own.
repo-ctx solves this. It indexes Git repositories and exposes them to AI assistants through the Model Context Protocol (MCP), giving tools like Claude Code, Cursor, and VS Code Copilot real, structured access to codebases.
repo-ctx isn't a code browser you query manually. It's an MCP server — your AI assistant calls its tools directly when it needs to understand code.
You: "How does the authentication flow work in our API?"
Claude (using repo-ctx):
→ ctx-search "authentication" across 3 indexed repos
→ ctx-analyze auth_service.py → extracts 12 symbols, 4 dependencies
→ ctx-graph ./src/auth → maps the full dependency chain
→ Gives you a complete, accurate answer
Index everything in one place. GitHub, GitLab, and local repositories — search across all of them.
repo-ctx index ./my-project # Local repo
repo-ctx index fastapi/fastapi # GitHub
repo-ctx index my-company/backend # GitLab
repo-ctx index --group my-org # Entire GitHub orgThen your AI assistant can search, analyze, and cross-reference all of them simultaneously.
Not just text search — real structural analysis:
- Symbol extraction — functions, classes, methods, interfaces across Python, Java, JavaScript, TypeScript, Kotlin, Go, Rust, C/C++, Ruby, PHP, C#, Bash
- Dependency graphs — who calls what, import chains, coupling analysis
- Architecture analysis — Design Structure Matrix, cycle detection, layer identification, complexity metrics
- Joern CPG — optional deep analysis with call graphs, data flow tracking, and CPGQL queries
# Install
pip install repo-ctx
# Index a repository
repo-ctx index fastapi/fastapi
# Search it
repo-ctx search "middleware"
# Analyze code locally
repo-ctx analyze ./src --language pythonAdd to your MCP configuration (~/.config/claude/mcp.json for Claude Code):
{
"mcpServers": {
"repo-ctx": {
"command": "uvx",
"args": ["repo-ctx", "-m"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}Works immediately with local and public GitHub repos — no tokens required for those.
For private repos: set GITHUB_TOKEN or GITLAB_TOKEN + GITLAB_URL.
| Category | Tools |
|---|---|
| Repository | ctx-index, ctx-list, ctx-search, ctx-docs |
| Code Analysis | ctx-analyze, ctx-symbol, ctx-symbols, ctx-graph |
| Architecture | ctx-dsm, ctx-cycles, ctx-layers, ctx-architecture, ctx-metrics |
| Export | ctx-llmstxt, ctx-dump |
| CPG (Joern) | ctx-query, ctx-export, ctx-status |
Full reference: MCP Tools Reference
CLI — standalone searching, indexing, and analysis from the terminal.
Python library — embed repo-ctx in your own tools and workflows.
from repo_ctx.client import RepoCtxClient
async with RepoCtxClient() as client:
await client.index_repository("fastapi/fastapi", provider="github")
results = await client.search("middleware")- User Guide — usage, examples, configuration
- Developer Guide — architecture, contributing
- MCP Tools Reference — all 18 tools documented
- Architecture Analysis Guide — DSM, cycles, metrics
Apache 2.0 — see LICENSE.