Repo Therapist
Repo Therapist 🛋️
압박 속에서도 코드베이스가 스스로를 설명합니다
이 MCP 서버는 전적으로 Cursor를 사용하여 구축되었습니다
Repo Therapist는 모든 저장소를 쿼리 가능하고 설명 가능한 지식으로 바꾸는 MCP(Model Context Protocol) 서버입니다. Cursor를 통해 코드베이스에 대해 질문하고 구조화된 통찰력 있는 답변을 얻으세요.
기능
Cursor에게 다음과 같이 질문할 수 있습니다:
"이 서비스는 왜 이렇게 구조화되어 있나요?"
"이것을 제거하면 무엇이 깨질까요?"
"이 저장소의 어떤 부분이 걱정되나요?"
Repo Therapist는 내부적으로 다음을 수행합니다:
저장소 구조 및 파일 읽기
git 기록 및 커밋 패턴 분석
코드와 변경 빈도 상관관계 분석
복잡성 핫스팟 및 위험 식별
Related MCP server: Code Understanding MCP Server
사용 가능한 도구
도구 | 설명 |
| 저장소 분석 - 가장 먼저 실행하세요 |
| 저장소의 정적 스냅샷(기초 데이터) 가져오기 |
| git 기록 분석 가져오기 (시간 차원) |
| 특정 파일이 왜 그렇게 되어 있는지 설명 |
| 분석된 저장소에 대해 질문하기 |
| 상위 수준의 개요 가져오기 |
| 위험 평가 보고서 생성 |
기초 데이터: 스냅샷
analyze_repo를 실행하면 Repo Therapist는 저장소에 대한 권위 있는 진실의 원천인 정적 스냅샷을 생성합니다. 이 스냅샷에는 다음이 포함됩니다:
{
"files": [...], // Every file with path, language, line count
"languages": {...}, // Language breakdown with percentages
"entryPoints": [...], // Detected entry points with confidence levels
"configs": {...}, // Parsed package.json, tsconfig, Dockerfile, CI configs
"directories": [...] // Directory structure with inferred purposes
}중요성: LLM은 추측하지 말고 이 스냅샷 데이터를 인용해야 합니다. "이 저장소는 어떤 언어를 사용하나요?"라고 물으면 LLM이 가정하는 것이 아니라 스냅샷에서 답변이 나옵니다.
get_snapshot을 사용하여 특정 섹션을 검색하세요:
get_snapshot(section: "files")- 메타데이터가 포함된 모든 파일get_snapshot(section: "languages")- 언어 통계get_snapshot(section: "entryPoints")- 감지된 진입점get_snapshot(section: "configs")- 파싱된 설정 파일get_snapshot(section: "directories")- 디렉토리 구조get_snapshot()- 전체 요약
Git Historian: 시간 차원
Git Historian은 커밋 기록을 분석하여 코드가 왜 그렇게 되어 있는지 설명합니다. 여기서부터는 단순한 분석을 넘어섭니다.
{
"fileChurn": { "auth.ts": { "totalCommits": 47, "churnScore": 85 } },
"authors": { "auth.ts": ["alice", "bob", "charlie"] },
"fragileFiles": [{ "path": "auth.ts", "reasons": ["high-churn", "many-authors"] }],
"hotPaths": [...],
"stableCore": [...]
}이를 통해 다음 질문에 답할 수 있습니다:
"이게 왜 이상한가요?" → "6개월 동안 12번이나 다시 작성되었기 때문입니다."
"이 파일의 소유자는 누구인가요?" → "불분명합니다 - 4명이 수정했지만, 30% 이상 기여한 사람은 없습니다."
"무엇을 조심해야 하나요?" → "이 5개의 파일은 취약하고 버그가 발생하기 쉽습니다."
get_history를 사용하여 특정 측면을 검색하세요:
get_history(section: "churn")- 파일 변경 빈도 및 변동성get_history(section: "authors")- 기여자 통계get_history(section: "fragile")- 문제를 일으킬 가능성이 있는 파일get_history(section: "hotPaths")- 핫 경로 vs 안정적인 코어get_history(section: "timeline")- 주요 이벤트 및 커밋 패턴get_history(section: "ownership")- 소유권 정보get_history()- 전체 요약
특정 파일 분석에는 why_is_this_weird를 사용하세요:
Use why_is_this_weird on "src/auth/login.ts"인용문과 함께 자세한 설명을 반환합니다:
# Why is "src/auth/login.ts" the way it is?
## Change History
- Total commits: 47
- Authors: 5 (alice, bob, charlie, dave, eve)
- Churn score: 85 ⚠️ HIGH
## 🔍 Why It's Unusual
**Heavily modified:** This file has been changed 47 times...
**Many hands:** 5 different people have modified this file...설정
1. 의존성 설치
cd repo-therapist
npm install2. 프로젝트 빌드
npm run build3. Cursor에 추가
Cursor 설정 → MCP → 새 MCP 서버 추가:
{
"mcpServers": {
"repo-therapist": {
"command": "node",
"args": ["/FULL/PATH/TO/repo-therapist/dist/index.js"]
}
}
}중요: /FULL/PATH/TO/를 repo-therapist 폴더의 실제 절대 경로로 바꾸세요.
예시:
{
"mcpServers": {
"repo-therapist": {
"command": "node",
"args": ["/Users/saar/Projects/private/repo-therapist/dist/index.js"]
}
}
}4. Cursor 재시작
MCP 설정을 추가한 후, 변경 사항을 적용하려면 Cursor를 재시작하세요.
FAQ
repo-therapist를 별도로 실행해야 하나요?
아니요. Cursor가 자동으로 MCP 서버를 시작하고 관리합니다. Cursor의 MCP 설정에 구성을 추가하면 Cursor는 다음을 수행합니다:
필요할 때
node dist/index.js프로세스 시작백그라운드에서 계속 실행 유지
stdio(표준 입출력)를 통해 통신
한 번 빌드(npm run build)하고, 설정을 추가하고, Cursor를 재시작하기만 하면 됩니다. 끝입니다.
질문은 어디서 하나요?
일반 Cursor 채팅 (Cmd+L 또는 채팅 패널)에서 합니다. 차이점은 질문하는 방식입니다:
MCP 없이: "이 저장소는 무엇을 하나요?" → Cursor가 내장 도구 사용
Repo Therapist와 함께: "
/path/to/repo에서analyze_repo를 사용해" → Cursor가 MCP 도구 호출
Cursor에게 repo-therapist 도구를 사용하도록 명시적으로 지시합니다. Cursor는 이를 사용할 수 있는 추가 기능으로 인식합니다.
일반 Cursor 채팅과의 차이점은 무엇인가요?
일반 Cursor 채팅 | Repo Therapist와 함께 |
필요할 때 파일 읽기 | 전체 저장소 구조 사전 분석 |
git 기록 인식 없음 | 커밋 패턴 및 변경 빈도 분석 |
읽은 내용을 바탕으로 답변 | 구조화된 분석을 바탕으로 답변 |
위험 감지 없음 | 복잡성 핫스팟 식별 |
일반적인 코드 이해 | 도메인별 통찰력 ("무엇이 걱정되나요?") |
핵심 차이점: Repo Therapist는 사전에 구조화된 분석을 수행하고 저장하므로, "어떤 파일이 가장 자주 변경되나요?" 또는 "위험 요소는 무엇인가요?"와 같은 질문에 Cursor가 매번 파악할 필요 없이 미리 계산된 데이터로 답변할 수 있습니다.
Cursor는 똑똑하지만 반응형입니다. Repo Therapist는 Cursor가 참조할 수 있는 코드베이스에 대한 "브리핑 문서"를 제공한다고 생각하세요.
사용법
설정 후 Cursor 채팅에서 Repo Therapist를 사용할 수 있습니다:
1단계: 저장소 분석
먼저 탐색하려는 저장소를 분석하세요:
Use analyze_repo to analyze /path/to/some/repo2단계: 질문하기
이제 질문할 수 있습니다:
Use ask_repo to answer: "What does this repo do?"Use ask_repo to answer: "Which parts of this repo scare you?"Use ask_repo to answer: "What will break if I remove the auth module?"3단계: 보고서 받기
요약 받기:
Use repo_summary to show me an overview위험 평가 받기:
Use risk_report to identify potential issues질문 예시
"이 저장소는 무엇을 하나요?"
"코드는 어떻게 구조화되어 있나요?"
"어떤 기술 스택이 사용되고 있나요?"
"의존성을 보여줘"
"가장 큰 파일은 무엇인가요?"
"어떤 파일이 가장 자주 변경되나요?"
"기여자는 누구인가요?"
"최근 커밋은 무엇인가요?"
"어떤 부분이 걱정되나요?"
"X를 변경하면 무엇이 깨질까요?"
개발
개발 모드에서 실행
npm run dev프로덕션용 빌드
npm run build테스트 실행
npm test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage report테스트 가이드라인
참고: 새로운 기능을 구현할 때는 항상 단위 테스트를 추가하세요.
테스트는 tests/에 위치하며 Vitest를 사용합니다. 테스트 구조는 소스 구조를 반영합니다:
tests/
├── fixtures/ # Test utilities and mock repos
│ └── setup.ts # Helper functions for creating test repos
├── scanner/ # Scanner module tests
├── historian/ # Historian module tests
├── tools/ # Tool tests
└── cache.test.ts # Cache tests새 기능을 추가할 때:
적절한
tests/하위 디렉토리에 테스트 생성git 관련 테스트에는
fixtures/setup.ts의createTestRepo()사용afterAll에서cleanupTestRepo()로 테스트 저장소 정리커밋하기 전에
npm test를 실행하여 모든 테스트 통과 확인
프로젝트 구조
repo-therapist/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── cache.ts # In-memory repo cache
│ ├── types.ts # TypeScript interfaces
│ ├── scanner/ # Static snapshot engine (Step 2)
│ │ ├── index.ts # Scanner exports
│ │ ├── types.ts # Snapshot type definitions
│ │ └── scan-repo.ts # Repository scanner
│ ├── historian/ # Git history analyzer (Step 3)
│ │ ├── index.ts # Historian exports
│ │ ├── types.ts # History type definitions
│ │ └── analyze-history.ts # Git history analysis
│ └── tools/
│ ├── analyze-repo.ts # Repository analyzer (orchestrates all)
│ ├── get-snapshot.ts # Snapshot retrieval (ground truth)
│ ├── get-history.ts # History retrieval (time dimension)
│ ├── ask-repo.ts # Question answering
│ ├── repo-summary.ts # Summary generator
│ └── risk-report.ts # Risk assessment
├── tests/ # Unit tests
│ ├── fixtures/ # Test utilities
│ ├── scanner/ # Scanner tests
│ ├── historian/ # Historian tests
│ └── tools/ # Tool tests
├── package.json
├── tsconfig.json
├── vitest.config.ts # Test configuration
└── README.md기술 스택
TypeScript - 타입 안전 코드베이스
@modelcontextprotocol/sdk - MCP 서버 구현
simple-git - Git 기록 분석
ts-morph - TypeScript/JavaScript AST 파싱 (계획 중)
glob - 파일 패턴 매칭
로드맵
[ ] ts-morph를 사용한 AST 기반 코드 분석
[ ] 분석 결과를 JSON/SQLite에 영구 저장
[ ] 의존성 그래프 시각화
[ ] 보안 취약점 탐지
[ ] 테스트 커버리지 분석
[ ] 사용자 정의 질문 핸들러
라이선스
MIT
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceAn MCP server that transforms codebases into intelligent, queryable knowledge bases, enabling AI assistants to perform semantic search, explore architecture, and analyze code relationships.166
- AlicenseCqualityDmaintenanceAn MCP server that analyzes local or remote GitHub repositories, providing intelligent code context and structure to AI coding assistants.1013MIT
- AlicenseAqualityCmaintenanceAn MCP server that extracts complete knowledge from any codebase — architecture, patterns, dependencies, API surface. Combines static analysis with AI-powered deep interpretation.8MIT
- AlicenseNot gradedqualityCmaintenanceA production-grade MCP server for local git repositories that provides tools for code search, git history analysis, complexity metrics, test discovery, and dependency management.MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that gives your AI access to the source code and docs of all public github repos
Scan any public GitHub MCP-server repo for security issues. 37 MCP-specific L1 rules, 8 languages.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/salman-arefin74/repo-therapist'
If you have feedback or need assistance with the MCP directory API, please join our Discord server