wn01011/pr-review-mcp-server
If you are the rightful owner of pr-review-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
AI Code Review MCP Server is designed for AI-based code review and quality management using the Model Context Protocol.
π€ AI Code Review MCP Server
AI κΈ°λ° μ½λ 리뷰μ νμ§ κ΄λ¦¬λ₯Ό μν MCP(Model Context Protocol) μλ²μ λλ€.
β¨ μ£Όμ κΈ°λ₯
π AI μ½λ 리뷰
- μ»€λ° νμ λ³ λΆμ: feat, fix, refactor λ± νμ μ λ§λ λ§μΆ€ 리뷰
- νμ§ μ μ μ°μΆ: 볡μ‘λ, μ μ§λ³΄μμ±, 보μ λ± λ€κ°λ νκ°
- 보μ μ·¨μ½μ κ²μ¬: μ μ¬μ 보μ μ΄μ μλ νμ§
- μ±λ₯ μν₯ λΆμ: μ±λ₯μ λ―ΈμΉλ μν₯λ νκ°
π ν΅ν© 리뷰 μμ€ν
- μ»€λ° νμ λ³ λΆμ: κ° μ»€λ° νμ μ λ§λ κ°λ³ λΆμ
- ν΅ν© 리뷰 체ν¬: λͺ¨λ λΆμ κ²°κ³Όλ₯Ό ν λ²μ νμΈ
- 체ν¬λ¦¬μ€νΈ μ 곡: λμΉκΈ° μ¬μ΄ 리뷰 ν¬μΈνΈ 체ν¬
- λ§ν¬λ€μ΄ 리ν¬νΈ: μ’ ν© λ¦¬λ·° κ²°κ³Όλ₯Ό λ§ν¬λ€μ΄μΌλ‘ μμ±
π― 리뷰 κ°μ΄λ
- νμ λ³ κ°μ΄λ: μ»€λ° νμ μ λ§λ 리뷰 κ°μ΄λ μμ±
- λ² μ€νΈ νλν°μ€: κ° νμ λ³ κΆμ₯μ¬ν μ μ
- μ£Όμμ¬ν: μμ£Ό λ°μνλ λ¬Έμ μ μ¬μ μλ΄
π λΉ λ₯Έ μμ
1. νκ²½ μ€μ
# μ μ₯μ ν΄λ‘
git clone <repository-url>
cd ai-review-mcp-server
# μμ‘΄μ± μ€μΉ
npm install
# νκ²½ λ³μ μ€μ
cp .env.example .env
2. νκ²½ λ³μ ꡬμ±
# Claude API μ€μ
CLAUDE_API_KEY=sk-ant-api-03-xxx
# GitHub μ€μ
GITHUB_TOKEN=ghp_xxx
GITHUB_WEBHOOK_SECRET=your-webhook-secret
# μλ² μ€μ
PORT=3001
NODE_ENV=development
3. μλ² μμ
# κ°λ° λͺ¨λ (μλ μ¬μμ)
npm run dev
# νλ‘λμ
λͺ¨λ
npm run build
npm start
4. μΉ UI μ μ
λΈλΌμ°μ μμ http://localhost:3001
λ‘ μ μνμ¬ μΉ UIλ₯Ό μ¬μ©ν μ μμ΅λλ€.
π₯οΈ μΉ UI μ¬μ©λ²
PR λΆμ
- μ μ₯μ μ
λ ₯:
owner/repo
νμμΌλ‘ μ λ ₯ - PR λ²νΈ μ λ ₯: λΆμν PR λ²νΈ μ λ ₯
- μ»€λ° νμ μ ν: μ μ ν μ»€λ° νμ μ ν
- λΆμ μ€ν: "PR λΆμ" λ²νΌ ν΄λ¦
ν΅ν© 리뷰 체ν¬
- PR λΆμμ΄ μλ£λ ν "ν΅ν© 리뷰 체ν¬" λ²νΌ ν΄λ¦
- λͺ¨λ¬μμ μ»€λ° νμ λ³ λΆμ κ²°κ³Ό νμΈ
- ν΅ν© 리뷰 κ°μ΄λ νμΈ
- 체ν¬λ¦¬μ€νΈλ₯Ό ν΅ν 리뷰 μ§ν
π§ API μλν¬μΈνΈ
HTTP API
# PR λΆμ
POST /analyze
{
"repo": "owner/repo",
"pr_number": 123,
"commit_type": "feat",
"enable_split": true,
"deep_analysis": false
}
# 리뷰 κ°μ΄λ μμ±
POST /review-guide
{
"commit_type": "feat",
"file_changes": ["src/component.tsx"]
}
# νμ§ μ μ κ³μ°
POST /quality-score
{
"changes": [...],
"metrics": {}
}
# ν¬μ€ 체ν¬
GET /health
MCP Tools
// MCP ν΄λΌμ΄μΈνΈμμ μ¬μ©
{
"method": "tools/call",
"params": {
"name": "analyze_pr",
"arguments": {
"repo": "owner/repo",
"pr_number": 123,
"commit_type": "feat"
}
}
}
π³ Docker μ¬μ©
Docker λΉλ λ° μ€ν
# Docker μ΄λ―Έμ§ λΉλ
npm run docker:build
# Docker 컨ν
μ΄λ μ€ν
npm run docker:run
Docker Compose
# μ 체 μ€ν μ€ν
docker-compose up -d
# λ‘κ·Έ νμΈ
docker-compose logs -f ai-review
βοΈ GitHub Webhook μ€μ
- GitHub μ μ₯μ β Settings β Webhooks
- Payload URL:
https://your-domain.com/webhook
- Content type:
application/json
- Events:
Pull requests
- Secret:
.env
μGITHUB_WEBHOOK_SECRET
κ°
π μλ΅ νμ
PR λΆμ μλ΅
{
"success": true,
"pr_number": 123,
"repo": "owner/repo",
"analyzed_at": "2024-06-04T10:30:00Z",
"by_commit_type": {
"feat": {
"analysis": {
"summary": "μλ‘μ΄ κΈ°λ₯ λΆμ μμ½",
"quality_score": 87,
"review_points": ["...", "..."],
"suggestions": ["...", "..."],
"security_concerns": ["..."],
"performance_impact": ["..."]
},
"guide": {
"title": "μλ‘μ΄ κΈ°λ₯ κ°λ° 리뷰 κ°μ΄λ",
"checklist": ["...", "..."],
"focus_areas": ["...", "..."],
"common_issues": ["...", "..."],
"best_practices": ["...", "..."]
}
}
},
"summary_review": {
"markdown": "# π PR μ’
ν© λ¦¬λ·°\n\n..."
}
}
π οΈ μ»€μ€ν°λ§μ΄μ§
리뷰 ν νλ¦Ώ μμ
src/handlers/claude-client.ts
μμ ν둬ννΈ ν
νλ¦Ώμ μμ ν μ μμ΅λλ€:
private getCommitTypeGuidelines(commitType: string): string {
// μ»€λ° νμ
λ³ κ°μ΄λλΌμΈ 컀μ€ν°λ§μ΄μ§
}
νμ§ μ μ κΈ°μ€ μ‘°μ
src/handlers/pr-analyzer.ts
μμ νμ§ μ μ κ³μ° λ‘μ§μ μμ ν μ μμ΅λλ€:
async calculateQualityScore(changes: any[], metrics: any = {}) {
// νμ§ μ μ κ³μ° λ‘μ§ μ»€μ€ν°λ§μ΄μ§
}
π¨ λ¬Έμ ν΄κ²°
μΌλ°μ μΈ λ¬Έμ
-
CLAUDE_API_KEY μ€λ₯
- Claude API ν€κ° μ¬λ°λ₯Έμ§ νμΈ
- ν€μ κΆνκ³Ό μμ‘ νμΈ
-
GITHUB_TOKEN μ€λ₯
- GitHub Personal Access Token νμΈ
- repo κΆνμ΄ μλμ§ νμΈ
-
PR λΆμ μ€ν¨
- PRμ΄ μ‘΄μ¬νλμ§ νμΈ
- μ μ₯μ μ κ·Ό κΆν νμΈ
λ‘κ·Έ νμΈ
# κ°λ° λͺ¨λμμ μμΈ λ‘κ·Έ νμΈ
DEBUG=* npm run dev
# νλ‘λμ
λ‘κ·Έ νμΈ
docker-compose logs ai-review
π κΈ°μ¬νκΈ°
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
π λΌμ΄μ μ€
MIT License - μμΈν λ΄μ©μ νμΌμ μ°Έμ‘°νμΈμ.
π κ°μ¬μ λ§
- Anthropic - Claude API μ 곡
- Model Context Protocol - MCP νλ μμν¬
- GitHub - GitHub API μ 곡
Made with β€οΈ by κΉμ κ·