Skip to main content
Glama

멀티 에이전트 개발 자동화 시스템 — 에이전트 기반 CI/CD 파이프라인

FastAPI, Claude 기반 에이전트, Model Context Protocol(MCP)을 사용하여 GitHub Pull Request를 자동으로 분석하고 단위 테스트를 실행하며 파일을 린트하는 자동화된 에이전트 기반 CI/CD 파이프라인입니다.

프로젝트 아키텍처

devagent/
├── agents/             # Claude-powered agents
│   ├── base_agent.py      # Base agent with tool execution loop
│   ├── reviewer_agent.py  # Reviewer agent parsing PR diffs
│   └── prompts.py         # System prompts
├── app/                # FastAPI application
│   ├── api/routes/        # API endpoints (health)
│   ├── services/          # Claude integration service
│   ├── config.py          # Settings and environment config
│   └── main.py            # FastAPI main entrypoint
├── mcp_server/         # MCP Server
│   ├── server.py          # MCPServer registration and endpoints
│   └── tools/             # MCP tools (fetch_pr_diff, lint, run_tests, search)
├── tests/              # Test suite (pytest)
│   ├── test_agents.py
│   ├── test_health.py
│   └── test_mcp_tools.py
├── .env.example        # Environment template
├── .gitignore          # Git ignore files
└── requirements.txt    # Python dependencies

Related MCP server: code-review-mcp-server

기능 및 MCP 도구

  • BaseAgent: Anthropic API(Claude 3.5 Sonnet)를 사용하여 도구 호출 루프를 실행하고 코드베이스 정보를 재귀적으로 수집합니다.

  • ReviewerAgent: PR diff에 대한 코드 리뷰를 수행하여 정확성 버그, 보안 취약점, 코드 품질 문제를 찾습니다.

  • MCP 도구:

    • fetch_pr_diff: GitHub PR의 변경된 파일과 패치를 검색합니다.

    • search_codebase: 패턴 또는 텍스트 검색을 사용하여 로컬 파일을 검색합니다.

    • run_tests: 대상 저장소 내에서 pytest를 사용하여 단위 테스트를 실행합니다.

    • lint_code: 대상 파일에 Ruff 린터를 실행합니다.

설치 및 설정

  1. 저장소를 클론합니다 (GitHub에 푸시된 후).

  2. 가상 환경을 생성하고 활성화합니다:

    python -m venv .venv
    # Windows:
    .venv\Scripts\activate
    # Linux/macOS:
    source .venv/bin/activate
  3. 의존성을 설치합니다:

    pip install -r requirements.txt
  4. 환경 변수를 구성합니다: 템플릿에서 .env 파일을 만들고 키를 입력합니다:

    cp .env.example .env

    ANTHROPIC_API_KEY를 추가하고 선택적으로 GITHUB_TOKEN을 추가합니다.

프로젝트 실행

FastAPI 앱 실행

uvicorn app.main:app --reload

API 문서는 http://localhost:8000/docs에서 확인할 수 있습니다.

MCP 서버 실행

MCP 서버를 직접 실행하려면:

python mcp_server/server.py

테스트 실행

모든 테스트를 실행하고 시스템이 작동하는지 확인하려면:

python -m pytest

Related MCP Connectors

Related MCP Servers