Skip to main content
Glama

⚡ RepoContext

CI npm version License: MIT MCP Compatible TypeScript

AIコーディングエージェントとIDEのための次世代ASTコードベースマップ、トークン圧縮、コンテキストパッケージングエンジン。

English | 中文说明


🌟 RepoContextが必要な理由

コードベースを最新のAIコーディングアシスタント(Claude CodeCursorWindsurfOpenAI CodexAntigravityCline)に取り込む際、開発者は3つの重大なボトルネックに直面します:

  1. 💥 トークンの爆発とAPIコストの高騰:生のコードダンプはすぐにコンテキスト制限を超えたり、1クエリあたり数十ドルのコストがかかったりします。

  2. 📉 S/N比の低さ:行の80%は日常的な実装詳細です。LLMが必要とするのは意味論的なAPIサーフェス(シグネチャ、型、インターフェース、docstring)だけです。

  3. 🔓 セキュリティリーク.envの認証情報、APIキー、データベースURIがプロンプトに誤って露出する可能性があります。

RepoContextは、インテリジェントなASTアウトラインプルーニング、タスクに焦点を当てたセマンティックファイルランキング、自動認証情報の編集、ネイティブな**Model Context Protocol (MCP)**統合により、これら3つすべてを解決します。


Related MCP server: AtlasMemory

🚀 主な機能

  • ASTコードベースマップ&スケルトナイザー:ソースファイルを**70%〜85%**圧縮し、インターフェース、型、関数、JSDoc/docstringを100%保持します。

  • 🎯 タスク指向の関連性プルーニング:プロンプトクエリ(例:repocontext pack -q "Fix JWT auth token expiry")を渡すと、最も重要なファイルだけを自動的にランク付けしてパックします。

  • 🛡️ 自動シークレットスキャナー&編集:組み込みのエントロピーと正規表現スキャナーがOpenAIキー、GitHubトークン、AWSキー、JWT、データベースURIを検出してマスクします。

  • 🔌 ネイティブModel Context Protocol (MCP)サーバー:標準のMCPツールを介してClaude Desktop、Cursor、Windsurf、Antigravityと直接統合します。

  • 📑 マルチフォーマットエクスポート:ディレクトリツリー付きのクリーンなMarkdown、Claude最適化XML(<documents>)、または構造化JSONを生成します。

  • 📊 マルチモデルトークン&コスト分析:GPT-4o、GPT-5、Claude 3.5 Sonnet、Gemini 1.5 Proのコスト見積もり付きリアルタイムトークンカウンター。


📦 クイックスタート

1. npxでインストールせずに実行

# 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. グローバルインストール

npm install -g repocontext

🛠️ CLIの使用法とオプション

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)統合

RepoContextには組み込みのMCPサーバーサポートが含まれています。claude_desktop_config.jsonまたはCursor/WindsurfのMCP設定に追加してください:

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

公開されているMCPツール:

  • get_codebase_map:リポジトリのASTシンボルアウトラインマップを返します。

  • extract_relevant_context:コードベースをプルーニングし、プロンプトに必要なファイルのみを返します。

  • read_file_outline:単一ファイルの圧縮されたASTスケルトンを読み取ります。


📊 ベンチマークと比較

機能

生の連結

Repomix

RepoContext

ASTスケルトンプルーニング

❌ いいえ

❌ いいえ

はい(80%トークン節約)

タスク関連性ランカー

❌ いいえ

❌ いいえ

はい(クエリガイド付きプルーニング)

シークレット自動編集

❌ いいえ

⚠️ 基本

はい(10以上のセキュリティルール)

ネイティブMCPサーバー

❌ いいえ

❌ いいえ

はい(Claude / Cursor / Windsurf)

マルチモデルコスト見積もり

❌ いいえ

❌ いいえ

はい(GPT-4o/5、Claude、Gemini)


🤝 貢献

貢献、問題、機能リクエストを歓迎します!issuesページをチェックしてください。

📄 ライセンス

このプロジェクトはMITライセンスです。

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