Skip to main content
Glama

⚡ RepoContext

CI npm version License: MIT MCP Compatible TypeScript

Die Engine der nächsten Generation für AST-Codebase-Maps, Token-Komprimierung und Kontext-Packaging für KI-Codierungsagenten und IDEs.

English | 中文说明


🌟 Warum RepoContext?

Wenn Entwickler Codebasen in moderne KI-Codierungsassistenten (Claude Code, Cursor, Windsurf, OpenAI Codex, Antigravity, Cline) einspeisen, stehen sie vor drei kritischen Engpässen:

  1. 💥 Token-Explosion & hohe API-Kosten: Rohe Code-Dumps überschreiten schnell die Kontextlimits oder kosten pro Abfrage dutzende Dollar.

  2. 📉 Niedriges Signal-Rausch-Verhältnis: 80 % der Zeilen sind routinemäßige Implementierungsdetails. LLMs benötigen nur die semantische API-Oberfläche (Signaturen, Typen, Schnittstellen, Docstrings).

  3. 🔓 Sicherheitslecks: Versehentliche Offenlegung von .env-Zugangsdaten, API-Schlüsseln und Datenbank-URIs in Prompts.

RepoContext löst alle drei Probleme durch intelligentes AST-Outline-Pruning, aufgabenorientiertes semantisches Datei-Ranking, automatische Schwärzung von Zugangsdaten und die native Integration des Model Context Protocol (MCP).


Related MCP server: AtlasMemory

🚀 Kernfunktionen

  • AST Codebase Map & Skeletonizer: Komprimiert Quelldateien um 70 % bis 85 %, während 100 % der Schnittstellen, Typen, Funktionen und JSDoc/Docstrings erhalten bleiben.

  • 🎯 Aufgabenorientiertes Relevanz-Pruning: Übergib deine Prompt-Abfrage (z. B. repocontext pack -q "Fix JWT auth token expiry"), um automatisch nur die wichtigsten Dateien zu bewerten und zu packen.

  • 🛡️ Automatischer Secret-Scanner & Schwärzung: Integrierter Entropie- und Regex-Scanner erkennt und maskiert OpenAI-Schlüssel, GitHub-Tokens, AWS-Schlüssel, JWTs und Datenbank-URIs.

  • 🔌 Nativer Model Context Protocol (MCP)-Server: Integriert sich direkt in Claude Desktop, Cursor, Windsurf und Antigravity über standardmäßige MCP-Tools.

  • 📑 Multi-Format-Export: Erzeugt sauberes Markdown mit Verzeichnisbäumen, Claude-optimiertes XML (<documents>) oder strukturiertes JSON.

  • 📊 Multi-Modell-Token- & Kostenanalysen: Echtzeit-Token-Zähler mit Kostenschätzungen für GPT-4o, GPT-5, Claude 3.5 Sonnet und Gemini 1.5 Pro.


📦 Schnellstart

1. Ohne Installation per npx ausführen

# Pack entire repository into an optimized Markdown prompt
npx repocontext pack

# Pack only files relevant to a specific task prompt
npx repocontext pack -q "Implement Stripe payment webhook handler" -o prompt.md

# Generate lightweight AST skeleton map (75%+ token reduction)
npx repocontext map -o codebase-map.md

2. Globale Installation

npm install -g repocontext

🛠️ CLI-Nutzung & Optionen

repocontext pack [dir] [options]

Options:
  -m, --mode <mode>         Packing mode: full | ast | relevant | hybrid (default: "full")
  -q, --query <query>       Filter and rank files relevant to a coding task prompt
  -f, --format <format>     Output format: markdown | xml | json (default: "markdown")
  -o, --output <file>       Output file path (default: "repocontext-output.md")
  -t, --max-tokens <number> Maximum token budget ceiling (default: 80000)
  --no-security             Disable secret scanning and auto-redaction
  -h, --help                Display help for command

🔌 Model Context Protocol (MCP)-Integration

RepoContext verfügt über integrierte MCP-Server-Unterstützung. Füge es zu deiner claude_desktop_config.json oder den MCP-Einstellungen von Cursor/Windsurf hinzu:

{
  "mcpServers": {
    "repocontext": {
      "command": "npx",
      "args": ["-y", "repocontext", "mcp"]
    }
  }
}

Verfügbare MCP-Tools:

  • get_codebase_map: Gibt die AST-Symbol-Gliederungskarte des Repositorys zurück.

  • extract_relevant_context: Reduziert die Codebase und gibt nur die für einen Prompt benötigten Dateien zurück.

  • read_file_outline: Liest das komprimierte AST-Skelett für eine einzelne Datei.


📊 Benchmark & Vergleich

Funktion

Rohe Verkettung

Repomix

RepoContext

AST-Skelett-Pruning

❌ Nein

❌ Nein

Ja (80 % Token-Ersparnis)

Task-Relevanz-Ranker

❌ Nein

❌ Nein

Ja (Query-gesteuertes Pruning)

Automatische Secret-Schwärzung

❌ Nein

⚠️ Basis

Ja (10+ Sicherheitsregeln)

Nativer MCP-Server

❌ Nein

❌ Nein

Ja (Claude / Cursor / Windsurf)

Multi-Modell-Kostenschätzung

❌ Nein

❌ Nein

Ja (GPT-4o/5, Claude, Gemini)


🤝 Mitwirken

Beiträge, Issues und Feature-Anfragen sind willkommen! Schau gerne auf der Issues-Seite vorbei.

📄 Lizenz

Dieses Projekt ist unter der MIT-Lizenz lizenziert.

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Provides intelligent code context and analysis through semantic compression, AST parsing, and multi-language support. Offers 60-80% token reduction while enabling AI assistants to understand codebases through local analysis, OpenAI-enhanced insights, and GitHub repository integration.
    6
    12
    3
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Turn any codebase into an AI-readable neural map — with proof. Every claim linked to code anchors (line + SHA-256 hash), every context window optimized with greedy token budgeting, every session protected by drift detection. Tree-sitter indexing across 11 languages, cross-session learning, AI enrichment, and 28 MCP tools. Zero config — just connect and your AI agent remembers everything.
    45
    13
    GPL 3.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    Make any LLM a codebase expert instantly. Provides deep code intelligence through semantic search, architecture mapping, security analysis, and smart context that fits perfectly in token windows.
    MIT

View all related MCP servers

Related MCP Connectors

  • Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.

  • Give your AI agent a persistent map of your project's structure, dependencies, and bugs.

  • Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ILoveMyJay/repocontext'

If you have feedback or need assistance with the MCP directory API, please join our Discord server