Sponsored by Deepsite.site

๐Ÿค– AI Code Review MCP Server

Created By
wn01011a year ago
pr ๋ถ„์„์„ ์ข€ ๋” ํŽธํ•˜๊ฒŒ ํ•˜๊ณ ์ž ๋ฏธ๋ฆฌ ์ž‘์„ฑํ•ด์ฃผ๋Š” mcp ์„œ๋ฒ„์ž…๋‹ˆ๋‹ค.
Content

๐Ÿค– 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 ๋ถ„์„

  1. ์ €์žฅ์†Œ ์ž…๋ ฅ: owner/repo ํ˜•์‹์œผ๋กœ ์ž…๋ ฅ
  2. PR ๋ฒˆํ˜ธ ์ž…๋ ฅ: ๋ถ„์„ํ•  PR ๋ฒˆํ˜ธ ์ž…๋ ฅ
  3. ์ปค๋ฐ‹ ํƒ€์ž… ์„ ํƒ: ์ ์ ˆํ•œ ์ปค๋ฐ‹ ํƒ€์ž… ์„ ํƒ
  4. ๋ถ„์„ ์‹คํ–‰: "PR ๋ถ„์„" ๋ฒ„ํŠผ ํด๋ฆญ

ํ†ตํ•ฉ ๋ฆฌ๋ทฐ ์ฒดํฌ

  1. PR ๋ถ„์„์ด ์™„๋ฃŒ๋œ ํ›„ "ํ†ตํ•ฉ ๋ฆฌ๋ทฐ ์ฒดํฌ" ๋ฒ„ํŠผ ํด๋ฆญ
  2. ๋ชจ๋‹ฌ์—์„œ ์ปค๋ฐ‹ ํƒ€์ž…๋ณ„ ๋ถ„์„ ๊ฒฐ๊ณผ ํ™•์ธ
  3. ํ†ตํ•ฉ ๋ฆฌ๋ทฐ ๊ฐ€์ด๋“œ ํ™•์ธ
  4. ์ฒดํฌ๋ฆฌ์ŠคํŠธ๋ฅผ ํ†ตํ•œ ๋ฆฌ๋ทฐ ์ง„ํ–‰

๐Ÿ”ง 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 ์„ค์ •

  1. GitHub ์ €์žฅ์†Œ โ†’ Settings โ†’ Webhooks
  2. Payload URL: https://your-domain.com/webhook
  3. Content type: application/json
  4. Events: Pull requests
  5. 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 = {}) {
  // ํ’ˆ์งˆ ์ ์ˆ˜ ๊ณ„์‚ฐ ๋กœ์ง ์ปค์Šคํ„ฐ๋งˆ์ด์ง•
}

๐Ÿšจ ๋ฌธ์ œ ํ•ด๊ฒฐ

์ผ๋ฐ˜์ ์ธ ๋ฌธ์ œ

  1. CLAUDE_API_KEY ์˜ค๋ฅ˜

    • Claude API ํ‚ค๊ฐ€ ์˜ฌ๋ฐ”๋ฅธ์ง€ ํ™•์ธ
    • ํ‚ค์˜ ๊ถŒํ•œ๊ณผ ์ž”์•ก ํ™•์ธ
  2. GITHUB_TOKEN ์˜ค๋ฅ˜

    • GitHub Personal Access Token ํ™•์ธ
    • repo ๊ถŒํ•œ์ด ์žˆ๋Š”์ง€ ํ™•์ธ
  3. PR ๋ถ„์„ ์‹คํŒจ

    • PR์ด ์กด์žฌํ•˜๋Š”์ง€ ํ™•์ธ
    • ์ €์žฅ์†Œ ์ ‘๊ทผ ๊ถŒํ•œ ํ™•์ธ

๋กœ๊ทธ ํ™•์ธ

# ๊ฐœ๋ฐœ ๋ชจ๋“œ์—์„œ ์ƒ์„ธ ๋กœ๊ทธ ํ™•์ธ
DEBUG=* npm run dev

# ํ”„๋กœ๋•์…˜ ๋กœ๊ทธ ํ™•์ธ
docker-compose logs ai-review

๐Ÿ“ ๊ธฐ์—ฌํ•˜๊ธฐ

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ ๋ผ์ด์„ ์Šค

MIT License - ์ž์„ธํ•œ ๋‚ด์šฉ์€ LICENSE ํŒŒ์ผ์„ ์ฐธ์กฐํ•˜์„ธ์š”.

๐Ÿ™ ๊ฐ์‚ฌ์˜ ๋ง


Made with โค๏ธ by ๊น€์ •๊ทœ

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Playwright McpPlaywright MCP server
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Tavily Mcp
ChatWiseThe second fastest AI chatbotโ„ข
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps้ซ˜ๅพทๅœฐๅ›พๅฎ˜ๆ–น MCP Server
Serper MCP ServerA Serper MCP Server
CursorThe AI Code Editor
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
WindsurfThe new purpose-built IDE to harness magic
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Baidu Map็™พๅบฆๅœฐๅ›พๆ ธๅฟƒAPI็Žฐๅทฒๅ…จ้ขๅ…ผๅฎนMCPๅ่ฎฎ๏ผŒๆ˜ฏๅ›ฝๅ†…้ฆ–ๅฎถๅ…ผๅฎนMCPๅ่ฎฎ็š„ๅœฐๅ›พๆœๅŠกๅ•†ใ€‚
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Howtocook McpๅŸบไบŽAnduin2017 / HowToCook ๏ผˆ็จ‹ๅบๅ‘˜ๅœจๅฎถๅš้ฅญๆŒ‡ๅ—๏ผ‰็š„mcp server๏ผŒๅธฎไฝ ๆŽจ่่œ่ฐฑใ€่ง„ๅˆ’่†ณ้ฃŸ๏ผŒ่งฃๅ†ณโ€œไปŠๅคฉๅƒไป€ไนˆโ€œ็š„ไธ–็บช้šพ้ข˜๏ผ› Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
DeepChatYour AI Partner on Desktop