코드 분석 MCP 서버
AI 모델이 자연어 대화를 통해 코드베이스를 이해하고 분석할 수 있도록 하는 MCP(모델 컨텍스트 프로토콜) 서버입니다.
✨ 하이라이트
자연스러운 코드 탐색 : 코드베이스에 대한 고급 질문하기
지엑스피1
심층 코드 이해 : 데이터 모델 및 시스템 아키텍처에 대한 통찰력 추출
"How does the user authentication flow work from frontend to database?"동적 분석 : 데이터 흐름을 추적하고 시스템 관계를 이해합니다.
"Show me all the places where we calculate transaction fees"
Related MCP server: MCP-Python
제한 사항
이 도구는 Aider 와 같은 보다 정교한 코드 분석 도구/부조종 도구보다 더 간단한 대안입니다. Aider와 같은 도구의 고급 코드 분석 기능과 견고성은 부족하지만, 이미 Claude Pro 구독을 보유하고 있다면 코드베이스 탐색을 위한 가벼운 솔루션을 제공합니다. 주요 장점은 다음과 같습니다.
비용 효율성 : 기존 Claude Pro 구독을 사용하면 대규모 코드베이스를 분석할 때 비용이 많이 들 수 있는 도구와 달리 추가 API 비용이 발생하지 않습니다.
간단한 설정 : 최소한의 구성으로 빠르게 시작 가능
기본 분석 : 고급 코드 이해 및 탐색에 유용함
코드 분석에 대한 접근 방식이 더 간단하기 때문에 더 전문적인 도구에 비해 오류가 더 많거나 제공되는 통찰력이 부족할 수 있습니다.
🚀 빠른 시작
서버를 설치하세요:
git clone https://github.com/saiprashanths/code-analysis-mcp.git
cd code-analysis-mcpClaude Desktop App을 설치하세요. Claude Desktop App을 사용하여 MCP 서버를 설정하는 방법에 대한 자세한 내용은 문서를 참조하세요.
Claude Desktop의 구성 파일에서 서버를 구성합니다.
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"code-analysis": {
"command": "uv",
"args": [
"--directory",
"/PATH/TO/YOUR/REPO",
"run",
"code_analysis.py"
]
}
}
}Claude Desktop을 다시 시작하고 코드 분석을 시작하세요!
도구가 올바르게 설정되었는지 확인하세요
도구 아이콘을 클릭하면
code-analysis도구가 표시됩니다.통합 버튼을 클릭하면
analyze_code_repository프롬프트가 표시됩니다.
💡 사용 예시
복잡한 코드베이스를 이해하기 위해 도구를 사용하는 방법은 다음과 같습니다.
아래에 표시된 analyze_code_repository 프롬프트를 클릭하여 시작하세요. 그러면 저장소를 초기화하고 시작하는 과정이 안내됩니다.
You: How does the transaction processing work in this system?
Claude: Let me analyze the data flow for transactions.
Looking at the codebase, I can see that transaction processing happens through several key components:
1. Raw transaction data is captured in the `TransactionEvent` model with fields for:
- Payment status
- Amount
- Fee calculations
- Processing timestamps
2. This data is then processed through the PaymentSummary model, which:
- Validates payment provider responses
- Calculates processing fees
- Records transaction status
Would you like me to explain any part of this in more detail?
You: What are the key database tables involved?
Claude: The main tables in the transaction processing pipeline are:
1. transaction_events: Stores raw payment events
2. payment_summary: Processed transaction records
3. payment_providers: Provider configuration
4. merchant_accounts: Account-specific settings
Let me know if you'd like to see the schema for any of these tables!🔧 사용 가능한 도구
저장소 초기화
분석을 위해 코드 저장소를 초기화합니다.
initialize_repository("/path/to/repo")
# Output: Successfully initialized code repository at: /path/to/repoget_repo_info
초기화된 저장소에 대한 정보를 검색합니다.
get_repo_info()
# Output:
# Code Repository Information:
# Path: /path/to/repo
# Exists: True
# Is Directory: True
# Found .gitignore fileget_repo_structure
저장소 파일 구조를 살펴보세요.
get_repo_structure(depth=2)
# Output:
# 📁 src/
# 📁 api/
# 📄 routes.py
# 📄 models.py
# 📁 utils/
# 📄 helpers.py
# 📄 main.py읽기_파일
특정 파일을 읽고 분석합니다.
read_file("src/api/models.py")
# Output:
# File: src/api/models.py
# Language: python
# Size: 2.3 KB
#
# [File contents...]⚙️ 기술 세부 사항
기본 스캐닝 깊이: 3단계
최대 파일 크기: 1MB
파일당 최대 줄 수: 1000
.gitignore에 나열된 경로를 무시합니다.
로컬 파일 시스템 액세스만 가능
디렉토리 탐색을 방지하기 위해 파일 경로를 검증합니다.
📝 라이센스
이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여되었습니다. 자세한 내용은 라이선스 파일을 참조하세요.