repo-ctx
Indexes and searches Git repositories, extracting symbols, dependency graphs, and architecture metrics from repository contents.
Indexes GitHub repositories and organizations, enabling search, symbol extraction, dependency graph analysis, and architecture analysis across indexed GitHub code.
Indexes GitLab repositories, including private repositories via token configuration, enabling search, code analysis, and cross-repo architecture insights.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
repo-ctx
Give your AI assistant deep understanding of any codebase.
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.
Related MCP server: Grafyx
The Problem
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.
What Makes repo-ctx Different
1. Built for AI Assistants
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 answer2. Multi-Repo, Multi-Provider
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.
3. Deep Code Understanding
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
Quick Start
# 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 pythonMCP Setup
Add 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.
18 MCP Tools
Category | Tools |
Repository |
|
Code Analysis |
|
Architecture |
|
Export |
|
CPG (Joern) |
|
Full reference: MCP Tools Reference
Also Works As
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")Documentation
User Guide — usage, examples, configuration
Developer Guide — architecture, contributing
MCP Tools Reference — all 18 tools documented
Architecture Analysis Guide — DSM, cycles, metrics
License
Apache 2.0 — see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
GitHub Copilot MCP: code, repo, PR, workflow tools for AI assistants.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides code intelligence for AI coding agents by indexing repositories into a hybrid knowledge graph, enabling agents to query dependencies, impact, and context through 28 MCP tools.4Apache 2.0
- AlicenseAqualityCmaintenanceEnables AI coding assistants to understand codebase architecture in real time by parsing source code into a relationship graph and exposing call chains, dependencies, class hierarchies, and conventions via MCP tools.144MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to perform hybrid semantic and lexical code search across multiple repositories, retrieve symbol definitions and call hierarchies, and manage repository relations through MCP tools.Apache 2.0
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with Git repositories via MCP, supporting status checks, diffs, staging, commits, branch management, and log queries.12MIT