Skip to main content
Glama

⚡ RepoContext

CI npm version License: MIT MCP Compatible TypeScript

AI 코딩 에이전트와 IDE를 위한 차세대 AST 코드베이스 맵, 토큰 압축, 컨텍스트 패키징 엔진.

English | 中文说明


🌟 왜 RepoContext인가?

현대 AI 코딩 어시스턴트(Claude Code, Cursor, Windsurf, OpenAI Codex, Antigravity, Cline)에 코드베이스를 입력할 때 개발자는 세 가지 중요한 병목 현상에 직면합니다:

  1. 💥 토큰 폭증 및 높은 API 비용: 원시 코드 덤프는 빠르게 컨텍스트 한도를 초과하거나 쿼리당 수십 달러의 비용이 발생합니다.

  2. 📉 낮은 신호 대 잡음비: 줄의 80%는 일상적인 구현 세부 사항입니다. LLM은 의미론적 API 표면(시그니처, 타입, 인터페이스, docstring)만 필요로 합니다.

  3. 🔓 보안 유출: 프롬프트에서 .env 자격 증명, API 키, 데이터베이스 URI가 실수로 노출됩니다.

RepoContext는 지능형 AST 아웃라인 프루닝, 작업 중심의 의미론적 파일 랭킹, 자동 자격 증명 마스킹, 네이티브 Model Context Protocol (MCP) 통합을 통해 이 세 가지를 모두 해결합니다.


Related MCP server: AtlasMemory

🚀 핵심 기능

  • AST 코드베이스 맵 및 스켈레톤 생성기: 인터페이스, 타입, 함수, JSDoc/docstring의 100%를 유지하면서 소스 파일을 70%~85% 압축합니다.

  • 🎯 작업 지향 관련성 프루닝: 프롬프트 쿼리(예: repocontext pack -q "Fix JWT auth token expiry")를 전달하여 가장 중요한 파일만 자동으로 순위를 매기고 패킹합니다.

  • 🛡️ 자동 비밀 스캐너 및 마스킹: 내장된 엔트로피 및 정규식 스캐너가 OpenAI 키, GitHub 토큰, AWS 키, JWT, 데이터베이스 URI를 감지하고 마스킹합니다.

  • 🔌 네이티브 Model Context Protocol (MCP) 서버: 표준 MCP 도구를 통해 Claude Desktop, Cursor, Windsurf, Antigravity와 직접 통합됩니다.

  • 📑 다중 형식 내보내기: 디렉터리 트리, Claude 최적화 XML(<documents>), 구조화된 JSON을 포함한 깔끔한 Markdown을 생성합니다.

  • 📊 멀티 모델 토큰 및 비용 분석: 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)


🤝 기여

기여, 이슈, 기능 요청을 환영합니다! 이슈 페이지를 자유롭게 확인하세요.

📄 라이선스

이 프로젝트는 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