devagent
多智能体开发自动化系统 — 智能体化 CI/CD 流水线
一个使用 FastAPI、Claude 驱动的智能体和模型上下文协议(MCP)的自动化智能体化 CI/CD 流水线,用于自动分析 GitHub 拉取请求、运行单元测试和检查文件。
项目架构
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 dependenciesRelated MCP server: code-review-mcp-server
功能与 MCP 工具
BaseAgent:使用 Anthropic API(Claude 3.5 Sonnet)执行工具调用循环,以递归收集代码库信息。
ReviewerAgent:对 PR 差异执行代码审查,查找正确性缺陷、安全漏洞和代码质量问题。
MCP 工具:
fetch_pr_diff:获取 GitHub PR 的变更文件和补丁。search_codebase:使用模式或文本搜索来搜索本地文件。run_tests:在目标仓库中使用 pytest 运行单元测试。lint_code:对目标文件运行 Ruff 检查器。
安装与设置
克隆仓库(推送到 GitHub 后)。
创建并激活虚拟环境:
python -m venv .venv # Windows: .venv\Scripts\activate # Linux/macOS: source .venv/bin/activate安装依赖:
pip install -r requirements.txt配置环境变量: 从模板创建
.env文件并填写你的密钥:cp .env.example .env添加你的
ANTHROPIC_API_KEY,并可选择添加GITHUB_TOKEN。
运行项目
运行 FastAPI 应用
uvicorn app.main:app --reload在 http://localhost:8000/docs 访问 API 文档。
运行 MCP 服务器
要直接运行 MCP 服务器:
python mcp_server/server.py运行测试
要运行所有测试并验证系统是否正常工作:
python -m pytestThis server cannot be deployed
Maintenance
Related MCP Connectors
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Create, deploy, and operate MCP servers directly from your GitHub repositories.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Free MCP tools: the only MCP linter, health checks, cost estimation, and trust evaluation.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables code review operations on GitHub and GitLab, including fetching pull/merge requests, viewing diffs, adding comments, analyzing code quality, and creating merge requests directly from your MCP client.156 npm4MIT
- AlicenseNot gradedqualityCmaintenanceEnables automated code review and GitHub PR commenting through MCP integration.281 npm9MIT
- AlicenseAqualityCmaintenanceProvides GitHub PR review capabilities to LLMs, enabling automated PR analysis, review submission, and inline commenting via MCP.145 npm1MIT
- AlicenseAqualityDmaintenanceProvides MCP tools to review git changes using OpenAI Codex CLI, enabling code review of unstaged, staged, or last-commit changes.38 npmMIT