MCP Merge Request Summarizer
Automatically generates comprehensive merge request summaries from git logs, analyzing commit history and categorizing changes into structured descriptions. Provides tools to analyze git repositories, compare branches, and create detailed summaries with change categorization, impact analysis, and review time estimates.
README
MCP Merge Request Summarizer
An MCP (Model Context Protocol) tool that automatically generates comprehensive merge request summaries from git logs. This tool analyzes commit history, categorizes changes, and produces structured summaries suitable for merge request descriptions.
🚀 Features
- Automatic Commit Analysis: Analyzes git logs between branches to understand changes
- Smart Categorization: Categorizes commits by type (features, bug fixes, refactoring, etc.)
- Comprehensive Summaries: Generates detailed merge request descriptions with:
- Overview and statistics
- Key changes and significant commits
- Categorized changes (features, bug fixes, refactoring)
- Breaking changes detection
- File categorization and impact analysis
- Estimated review time
- Multiple Output Formats: Supports both Markdown and JSON output
- Flexible Integration: Works standalone or as MCP server
- Cross-Platform: Compatible with Windows, macOS, and Linux
📦 Installation
🚀 Quick Start (Recommended)
-
Clone the repository:
git clone https://github.com/yourusername/mcp-merge-request-summarizer.git cd mcp-merge-request-summarizer -
Run the installation script:
- Windows: Double-click
install.bator runinstall.batin PowerShell - Mac/Linux: Run
chmod +x install.sh && ./install.sh
- Windows: Double-click
-
Configure your editor:
- See
QUICK_START.mdfor 30-second setup instructions - Or check
configs/README.mdfor detailed configuration options
- See
Manual Installation
git clone https://github.com/yourusername/mcp-merge-request-summarizer.git
cd mcp-merge-request-summarizer
pip install -e .
From PyPI
pip install mcp-merge-request-summarizer
Note: This package is not yet published to PyPI. For now, use the installation scripts or manual installation.
🔧 Usage
As a Standalone Tool
# Basic usage (compares current branch against develop)
python -m mcp_mr_summarizer.cli
# Specify different branches
python -m mcp_mr_summarizer.cli --base main --current feature/new-feature
# Output to file
python -m mcp_mr_summarizer.cli --output mr_summary.md
# JSON output
python -m mcp_mr_summarizer.cli --format json --output summary.json
# Help
python -m mcp_mr_summarizer.cli --help
As an MCP Server
-
Configure your MCP client (e.g., Claude Desktop, Cursor, VSCode):
{ "mcp.servers": { "merge-request-summarizer": { "command": "python", "args": ["-m", "mcp_mr_summarizer.server"] } } } -
Set up working directory context (recommended):
# Set your working directory so repo_path="." works correctly await set_working_directory("/path/to/your/git/repo") -
Use the tools and resources through your MCP client interface:
Tools (Actions)
set_working_directory: Set the agent's working directory contextget_working_directory: Get the current working directory contextgenerate_merge_request_summary: Creates full MR summariesanalyze_git_commits: Provides detailed commit analysis
Resources (Data)
git://repo/status: Current repository status and informationgit://commits/{base_branch}..{current_branch}: Commit history between branchesgit://branches: List of all repository branchesgit://files/changed/{base_branch}..{current_branch}: Files changed between branches
📊 Example Output
# feat: 4 new features and improvements
## Overview
This merge request contains 9 commits with 35 files changed (1543 insertions, 1485 deletions).
## Key Changes
- Refactor mappers in MLB, NBA, NHL, and NFL to use object initializer syntax (bdf5d9c) - 3028 lines changed
- Refactor season stats services to use base class and improve dependency injection (30de323) - 1976 lines changed
### 🚀 New Features (4)
- Add soccer metrics extraction methods and register soccer season stats service (176930f)
- Update services to use constructor injection for dependencies (29f1c46)
- Update CbStatsDaemon and CbStatsFeedPublicApi to use async host run methods (22c1202)
- Refactor PoolSeasonStatsController and related services (3a28ab4)
### 🔧 Refactoring (3)
- Refactor mappers in MLB, NBA, NHL, and NFL to use object initializer syntax (bdf5d9c)
- Refactor season stats services to use base class and improve dependency injection (30de323)
- Refactor logging in season stats services to use consistent casing (fd7b8b9)
### 📊 Summary
- **Total Commits:** 9
- **Files Changed:** 35
- **Lines Added:** 1543
- **Lines Removed:** 1485
- **Estimated Review Time:** 1h 15m
🛠️ Configuration
Quick Configuration (Recommended)
For VSCode/Cursor:
- Open Settings (Ctrl/Cmd + ,)
- For VSCode: Search for "mcp" and click "Edit in settings.json"
- For Cursor: Go to Tools & Integrations → New MCP Server
- Add this configuration:
VSCode (settings.json):
{
"mcp.servers": {
"merge-request-summarizer": {
"command": "python",
"args": ["-m", "mcp_mr_summarizer.server"]
}
}
}
Cursor (GUI or settings.json):
- Name:
merge-request-summarizer - Command:
python - Arguments:
["-m", "mcp_mr_summarizer.server"]
Cursor (alternative JSON format):
{
"mcpServers": {
"merge-request-summarizer": {
"command": "python",
"args": ["-m", "mcp_mr_summarizer.server"]
}
}
}
For Claude Desktop:
- Go to Settings → MCP Servers
- Add new server with this configuration:
{
"mcpServers": {
"merge-request-summarizer": {
"command": "python",
"args": ["-m", "mcp_mr_summarizer.server"]
}
}
}
Ready-to-Use Config Files
Copy the appropriate configuration from the configs/ folder:
configs/vscode_settings.json- For VSCodeconfigs/cursor_settings.json- For Cursorconfigs/claude_desktop_config.json- For Claude Desktop
See configs/README.md for detailed setup instructions.
🎯 Customization
Adding Custom Commit Categories
Extend the categorization by modifying the categorize_commit method:
def categorize_commit(self, commit: CommitInfo) -> List[str]:
categories = []
message_lower = commit.message.lower()
# Add your custom patterns
if any(word in message_lower for word in ['security', 'vulnerability']):
categories.append('security')
# ... existing patterns ...
return categories
Customizing File Categories
Add custom file type categories:
def _categorize_files(self, files: set) -> Dict[str, List[str]]:
categories = {
'Services': [],
'Models': [],
'Controllers': [],
'Tests': [],
'Configuration': [],
'Documentation': [],
'CustomCategory': [], # Add your custom category
'Other': []
}
for file in files:
if 'CustomPattern' in file: # Add your custom pattern
categories['CustomCategory'].append(file)
# ... existing patterns ...
return categories
🧪 Testing
# Run tests
python -m pytest tests/
# Run with coverage
python -m pytest tests/ --cov=mcp_mr_summarizer --cov-report=html
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for your changes
- Run the test suite
- Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- Built for the Model Context Protocol (MCP) ecosystem
- Inspired by the need for better merge request documentation
- Thanks to all contributors and users
📞 Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki
Made with ❤️ for developers who want better merge request summaries
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。