code-context MCP server
2026년 10월 25일 커밋AST 기반의 코드베이스 인텔리전스, 심볼 추출 및 순환 복잡도 분석을 제공하여 AI 코딩 에이전트의 컨텍스트 효율성을 향상합니다.
다른 이름 jitendrakumar-ai/code-context-mcp
- 스타
- 1
- Tools
- 5
- 다운로드, 30일
- —
- 최신 버전
- —
- 마지막 커밋
- 2026년 10월 25일
- 라이선스
- MIT
code-context MCP란?
AST 기반의 코드베이스 인텔리전스, 심볼 추출 및 순환 복잡도 분석을 제공하여 AI 코딩 에이전트의 컨텍스트 효율성을 향상합니다. 5개 도구를 제공합니다. 예: summarize_repository_architecture, extract_python_ast_symbols, analyze_cyclomatic_complexity.
프로젝트 README에서 생성된 요약
code-context MCP server 정보
이 server는 가공되지 않은 파일을 그대로 전달하는 대신 구조화된 인텔리전스를 제공함으로써, AI 코딩 에이전트에게 정밀한 코드 컨텍스트를 제공합니다. Claude Code, Cursor, Windsurf, Codex와 같은 도구를 사용하는 개발자가 Python 코드베이스에서 필요한 구조적 정보만 추출하여 토큰 사용량을 줄일 수 있도록 돕습니다. 파일 전체를 전송하는 대신 Abstract Syntax Tree 표현을 제공하여 컨텍스트 윈도우를 효율적으로 유지합니다.
사용자는 stdio를 통해 이 server를 로컬에서 실행하며, 이는 외부 API key나 텔레메트리 없이 완전히 오프라인으로 작동함을 의미합니다. 고수준의 저장소 요약부터 상세한 심볼 추출 및 복잡도 분석으로 이어지는 3단계 워크플로우를 통해 기능합니다. extract_python_ast_symbols 및 analyze_cyclomatic_complexity와 같은 특정 도구를 사용하면, AI 에이전트가 과도한 토큰을 소비하지 않고도 클래스 정의, 메서드 시그니처 및 리팩터링 필요 사항을 이해할 수 있습니다.
활용 사례
- 1저장소 구조 매핑AI에게 파일 트리와 모듈 엔트리 포인트에 대한 고수준 개요를 요청합니다.
- 2특정 코드 심볼 추출특정 Python 파일의 클래스, 메서드 및 docstring에 대한 상세 개요를 요청합니다.
- 3리팩터링 대상 식별순환 복잡도가 높아 모듈화가 필요한 함수를 찾습니다.
프로젝트의 README를 바탕으로 작성되었습니다. 모든 활용 사례는 해당 내용의 인용문과 대조하여 확인합니다.
code-context MCP 도구 5
README에서 감지됨summarize_repository_architectureextract_python_ast_symbolsanalyze_cyclomatic_complexityget_refactoring_contextsearch_code_todos_and_hotspots
| summarize_repository_architecture | — | |
| extract_python_ast_symbols | — | |
| analyze_cyclomatic_complexity | — | |
| get_refactoring_context | — | |
| search_code_todos_and_hotspots | — |
자동 검사
2026년 11월 14일에 실행됨전체 보고서 →아직 인증되지 않았습니다. 서버는 80점 이상의 점수, 심각한 결함 없음, 그리고 검사에 충분한 데이터를 갖추어야 합니다. 검사 방식 · 점수를 높이기 위해 수정할 항목
- 소스 저장소 연결 및 접근 가능jitendrakumar-ai/code-context-mcp is public and reachablegithub.com/jitendrakumar-ai/code-context-mcp ↗통과
- 패키지가 이 저장소를 소스로 명시검사되지 않음
- 빌드 출처(Sigstore 증명)검사되지 않음
- 오픈 소스 라이선스 (OSI)MITspdx.org/licenses/MIT.html ↗통과
- 최근 1년 내 커밋 또는 릴리스Last commit or release 2026-10-25github.com/jitendrakumar-ai/code-context-mcp ↗통과
- OpenSSF Scorecard검사되지 않음
- 패키지 이름이 인기 패키지와 유사하지 않음검사되지 않음
- 패키지 및 해당 종속성에 중요한 보안 권고 없음검사되지 않음
- 모델에 대한 숨겨진 지침 없음5 tool descriptions and the README read; no override phrases, credential paths or hidden characters통과
- 파괴적인 도구에 라벨 표시됨No tool named like delete, drop or exec통과
- 원격 엔드포인트가 MCP 핸드셰이크에 응답검사되지 않음
README
GitHub에서 보기<
AST Codebase Intelligence, Symbol Extraction, Cyclomatic Complexity & Refactoring Analysis for LLMs & AI Coding Agents.
💡 Why This Exists & Token Efficiency
Traditional AI coding assistants dump entire raw source files into context windows, wasting tens of thousands of tokens on boilerplate, imports, and irrelevant functions. code-context-mcp introduces a claude-mem style 3-layer workflow that provides surgical code context before editing.
🚀 Quick Start
Multi-IDE Quick Start
Claude Code
Add to your ~/.claude.json:
{
"mcpServers": {
"code-context-mcp": {
"command": "python3",
"args": ["/path/to/code_context_mcp.py"]
}
}
}
Cursor
Go to Settings > Features > MCP and add:
- Name:
code-context-mcp - Type:
stdio - Command:
python3 /path/to/code_context_mcp.py
Codex
Add to codex.config.toml:
[mcp.servers.code-context-mcp]
command = "python3"
args = ["/path/to/code_context_mcp.py"]
Antigravity
Add to .antigravity/mcp_config.json:
{
"mcpServers": {
"code-context-mcp": {
"command": "python3",
"args": ["/path/to/code_context_mcp.py"]
}
}
}
OpenCode
Add to opencode.json:
{
"mcpServers": {
"code-context-mcp": {
"command": "python3",
"args": ["/path/to/code_context_mcp.py"]
}
}
}
Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"code-context-mcp": {
"command": "python3",
"args": ["/path/to/code_context_mcp.py"]
}
}
}
🛠️ How It Works
code-context-mcp runs as a standard Model Context Protocol (MCP) server communicating over stdio. It builds an Abstract Syntax Tree (AST) representation of Python source code locally and computes function metrics without sending data externally.
🧬 3-Layer Workflow
Layer 1: Repository Architecture Summary
# Call tool: summarize_repository_architecture
response = summarize_repository_architecture(root_dir=".")
print(response)
# Returns file tree, line counts, extension distribution, and module entry points.
Layer 2: AST Symbol Outline
# Call tool: extract_python_ast_symbols
response = extract_python_ast_symbols(file_path="code_context_mcp.py")
print(response)
# Returns class definitions, method signatures, decorator usages, and docstrings.
Layer 3: Cyclomatic Complexity & Refactoring Insights
# Call tool: analyze_cyclomatic_complexity
response = analyze_cyclomatic_complexity(file_path="code_context_mcp.py", threshold=10)
print(response)
# Identifies high-complexity methods and recommends specific modular refactorings.
🔧 MCP Tools
| Tool | Parameters | Description |
|---|---|---|
summarize_repository_architecture |
root_dir (str) |
High-level repository structure & file metrics. |
extract_python_ast_symbols |
file_path (str) |
AST symbol tree (Classes, Functions, Imports). |
analyze_cyclomatic_complexity |
file_path (str), threshold (int) |
Complexity metrics & actionable refactoring prompts. |
get_refactoring_context |
file_path (str), symbol_name (str) |
Targeted code extraction for surgical AI code edits. |
🏗️ Architecture
+-------------------------------------------------------+
| AI Coding Agent |
| (Claude Code / Cursor / Codex / Antigravity / etc.) |
+---------------------------+---------------------------+
| MCP (stdio)
v
+-------------------------------------------------------+
| code-context-mcp |
| |
| +--------------------+ +--------------------+ |
| | AST Parser Engine | | Cyclomatic Engine | |
| +--------------------+ +--------------------+ |
| | Symbol Extractor | | Refactor Context | |
| +--------------------+ +--------------------+ |
+-------------------------------------------------------+
🛡️ Security
code-context-mcp works 100% offline and locally. Zero telemetry, zero external API requests. See SECURITY.md for vulnerability disclosure policy.
📄 License
Distributed under the MIT License. See LICENSE for more details.--26-7928CA?style=for-the-badge" alt="MCP Spec" />
AST Codebase Intelligence, Symbol Extraction, Cyclomatic Complexity & Refactoring Analysis for LLMs & AI Coding Agents.
💡 Why This Exists & Token Efficiency
Traditional AI coding assistants dump entire raw source files into context windows, wasting tens of thousands of tokens on boilerplate, imports, and irrelevant functions. code-context-mcp introduces a claude-mem style 3-layer workflow that provides surgical code context before editing.
⚡ 3-Layer Context Workflow
- Layer 1: Structural Scan (
summarize_repository_architecture) — High-level file structure, line counts, and extensions map. - Layer 2: AST Symbol Outline (
extract_python_ast_symbols) — Class definitions, method signatures, docstrings, and line ranges without dumping raw code. - Layer 3: Targeted Analysis (
analyze_cyclomatic_complexity&search_code_todos_and_hotspots) — Cyclomatic complexity scores and TODO/FIXME hotspot discovery to pinpoint refactoring targets.
📊 Token Savings Comparison
| Approach | Context Injected | Token Usage | Accuracy | Savings |
|---|---|---|---|---|
| Naive Raw File Dumping | Entire source files | ~45,000 tokens | Moderate | 0% |
| Naive Grep Search | Raw line matches | ~18,000 tokens | Low | ~60% |
code-context-mcp AST Workflow |
Exact AST symbols & complexity | ~6,500 tokens | High | ~85% Savings 🚀 |
🏗️ Architecture Diagram
flowchart TD
A[AI Coding Agent / LLM] -->|1. Request Repo Summary| B[summarize_repository_architecture]
A -->|2. Extract AST Symbols| C[extract_python_ast_symbols]
A -->|3. Analyze Complexity| D[analyze_cyclomatic_complexity]
A -->|4. Scan Hotspots| E[search_code_todos_and_hotspots]
subgraph MCP Server Engine: code-context-mcp
B --> F[AST & Static Code Parser]
C --> F
D --> F
E --> F
end
F -->|Compact Structural Context| A
🛠️ Tools Included
summarize_repository_architecture: Scans directory paths, generates file structure breakdown by extension, and computes total lines of code.extract_python_ast_symbols: Parses Python files into Abstract Syntax Trees (AST) to extract classes, base classes, methods, docstrings, function signatures, and line markers.analyze_cyclomatic_complexity: Calculates cyclomatic complexity scores for all functions/methods to identify refactoring candidates and branch depth.search_code_todos_and_hotspots: Detects code comments containingTODO,FIXME,HACK, andXXXacross the codebase with exact file and line references.
🚀 Quick Start (1-Click & 1-Command Setup)
1. Claude Code CLI
claude mcp add code-context-mcp -- python -m code_context_mcp
2. Cursor (.cursor/mcp.json)
{
"mcpServers": {
"code-context-mcp": {
"command": "python",
"args": ["-m", "code_context_mcp"]
}
}
}
3. OpenAI Codex CLI (~/.codex/config.toml)
[mcp_servers.code-context-mcp]
command = "python"
args = ["-m", "code_context_mcp"]
4. Google Antigravity IDE (mcp_config.json)
{
"mcpServers": {
"code-context-mcp": {
"command": "python",
"args": ["-m", "code_context_mcp"]
}
}
}
5. Windsurf / Cline
{
"mcpServers": {
"code-context-mcp": {
"command": "python",
"args": ["-m", "code_context_mcp"]
}
}
}
code-context MCP 질문
code-context MCP는 어떤 도구를 제공하나요?
5개 도구를 제공합니다. 예: summarize_repository_architecture, extract_python_ast_symbols, analyze_cyclomatic_complexity, get_refactoring_context, search_code_todos_and_hotspots.
이 MCP server를 사용하려면 API key가 필요한가요?
아니요, 이 server는 외부 API key 없이 작동합니다.
제 코드가 외부 서버로 전송되나요?
아니요, 이 server는 텔레메트리나 외부 API 요청 없이 완전히 오프라인 및 로컬 환경에서 작동합니다.
토큰 효율성을 어떻게 개선하나요?
파일 전체를 그대로 전달하는 대신, AST 심볼 및 복잡도 지표와 같은 정밀한 컨텍스트를 제공하는 3단계 워크플로우를 사용하여 토큰 사용량을 최대 85%까지 절감합니다.