devflow-mcp
一个生产就绪的 Model Context Protocol 服务器,为 AI 助手提供深入的 GitHub 开发者工具——PR 分析、代码审查、变更日志生成、依赖审计、提交摘要和重构建议。
功能特性
6 个 MCP 工具,涵盖完整的开发者工作流
启发式分析 —— 无需外部 LLM 调用,快速且确定
OSV.dev 集成,获取真实的漏洞数据(npm 和 PyPI)
带 TTL 的 LRU 缓存,最大限度减少 GitHub API 调用
令牌桶限流器,确保在 GitHub 的限制范围内运行
零
any—— 全程严格的 TypeScript≥80% 测试覆盖率,使用 MSW 模拟 HTTP
要求
Node.js 18+
具有
repo作用域的 GitHub 个人访问令牌
安装
npm install -g devflow-mcp或者直接使用 npx 运行:
npx devflow-mcp或者克隆并构建:
git clone https://github.com/yourorg/devflow-mcp
cd devflow-mcp
npm install
npm run buildClaude Desktop 配置
添加到你的 claude_desktop_config.json 中:
{
"mcpServers": {
"devflow": {
"command": "npx",
"args": ["devflow-mcp"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}配置文件位置:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
工具
analyze_pr
分析 GitHub 拉取请求的风险、安全发现和合并就绪情况。
参数:
名称 | 类型 | 必需 | 描述 |
| string | 是 | 仓库所有者 |
| string | 是 | 仓库名称 |
| number | 是 | 拉取请求编号 |
| string[] | 否 | 限制分析范围: |
返回: risk_score (0-100), risk_level, findings[], change_summary, merge_recommendation
review_code
审查代码片段的质量、安全问题和改进机会。
参数:
名称 | 类型 | 必需 | 描述 |
| string | 是 | 要审查的源代码 |
| string | 是 | 编程语言 |
| string | 否 | 关于代码功能的额外上下文 |
返回: overall_score (1-10), issues[] (包含严重程度和修复建议), positive_observations[], refactor_priority
generate_changelog
根据提交历史生成两个 Git 引用之间的变更日志。
参数:
名称 | 类型 | 必需 | 描述 |
| string | 是 | 仓库所有者 |
| string | 是 | 仓库名称 |
| string | 是 | 基础引用 (标签、SHA、分支) |
| string | 是 | 目标引用 |
| string | 否 |
|
| string | 否 |
|
| boolean | 否 | 包含作者姓名 (默认: true) |
返回: changelog 字符串, commit_count, 每个类别的 stats, breaking_changes[]
audit_dependencies
根据 OSV 漏洞数据库审计项目依赖项。
参数:
名称 | 类型 | 必需 | 描述 |
| string | 是 | 仓库所有者 |
| string | 是 | 仓库名称 |
| string | 是 |
|
| string | 否 | 报告的最低严重程度: |
返回: vulnerabilities[] (包含 CVE ID、修复版本和修复命令); audit_passed, 每个严重级别的 stats, osv_query_timestamp
summarize_commits
将分支上的近期提交总结为人类可读的摘要。
参数:
名称 | 类型 | 必需 | 描述 |
| string | 是 | 仓库所有者 |
| string | 是 | 仓库名称 |
| string | 否 | 分支名称 (默认: 仓库默认分支) |
| string | 否 | ISO 日期或相对时间 ( |
| number | 否 | 最大提交数 (默认: 50) |
| string | 否 |
|
返回: summary 字符串, categories (功能/修复/文档/重构/杂务/其他), authors[], commit_count
suggest_refactor
分析代码的重构机会,并按影响与工作量比率进行排序。
参数:
名称 | 类型 | 必需 | 描述 |
| string | 是 | 要分析的源代码 |
| string | 是 | 编程语言 |
| string[] | 否 | 关注领域: |
返回: suggestions[] (包含理由和工作量估算), priority_order[], original_complexity_score
开发
# Install dependencies
npm install
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Type-check and build
npm run build
# Lint
npm run lint
# Format
npm run format
# Start the server (after build)
npm start项目结构
src/
index.ts # Entry point
server.ts # MCP server registration
tools/ # Tool handlers (one per tool)
github/ # GitHub API clients
lib/ # Shared utilities
cache.ts # LRU cache with TTL
rate-limiter.ts # Token-bucket rate limiter
commit-parser.ts # Conventional commit parser
diff-parser.ts # Git diff parser
risk-scorer.ts # PR risk scoring heuristics
errors.ts # Typed MCP errors
providers/
osv.ts # OSV.dev vulnerability API
tests/
integration/ # Full MCP server tests via InMemoryTransport
tools/ # Unit tests per tool handler
lib/ # Unit tests for utilities测试策略
单元测试:每个工具处理程序和库都使用
vi.mock进行模拟集成测试:通过
InMemoryTransport进行完整的 MCP 客户端↔服务器往返测试,HTTP 请求由 MSW 拦截HTTP 模拟:MSW v2 (
msw/node) — 测试中无真实网络调用覆盖率:要求 ≥80% 分支覆盖率 (
npm run test:coverage)
贡献
Fork 本仓库
创建功能分支
为新行为添加测试
确保
npm run build && npm run test:coverage && npm run lint全部通过提交拉取请求
许可证
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/boranesn/devflow-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
