GitLab PR Analysis MCP Server
GitLab PR分析MCPサーバー
このプロジェクトは、GitLabのマージリクエスト分析とConfluenceのドキュメントを統合するMCP(モデル制御プロトコル)サーバーを提供します。これにより、マージリクエストの詳細を取得し、コード変更を分析し、結果をConfluenceページに保存できます。
特徴
GitLabからマージリクエストの詳細を取得する
マージリクエストのコード変更を分析する
以下を含む詳細なレポートを生成します:
基本的なマージリクエスト情報
コード変更統計
ファイルタイプ分析
詳細なファイルの変更
分析結果をConfluenceに保存する
デバッグのための包括的なログ記録
Related MCP server: GitLab Code Review MCP
前提条件
Python 3.8以上
APIアクセス可能なGitLabアカウント
Confluence アカウント(オプション、分析結果の保存用)
必要な GitLab プロジェクトへのアクセス
インストール
リポジトリをクローンします。
git https://github.com/CodeByWaqas/MRConfluenceLinker-mcp-server.git
cd MRConfluenceLinker-mcp-server仮想環境を作成してアクティブ化します。
python -m venv .venv
source .venv/bin/activate # On Windows, use: .venv\Scripts\activate依存関係をインストールします:
pip install -r requirements.txtまたは
uv add "mcp[cli]" python-gitlab python-dotenv atlassian-python-api requests構成
サンプル環境ファイルをコピーします。
cp .env.example .env資格情報を使用して
.envファイルを編集します。
GITLAB_URL=https://gitlab.com
GITLAB_TOKEN=your_gitlab_token
GITLAB_PROJECT_ID=your_project_id
# Optional Confluence integration
CONFLUENCE_URL=your_confluence_url
CONFLUENCE_USERNAME=your_username
CONFLUENCE_TOKEN=your_confluence_token
CONFLUENCE_SPACE=your_space_key資格情報の取得
GitLab トークン: GitLab で
apiスコープを使用して個人アクセス トークンを生成するConfluenceトークン: Atlassianアカウント設定でAPIトークンを生成します
使用法
MCP サーバーを起動します。
python src/MRConfluenceLinker-mcp-server/server.pyまたは
Claude Desktopでのセットアップ
# claude_desktop_config.json
# Can find location through:
# Claude -> Settings -> Developer -> Edit Config
{
"mcpServers": {
"MRConfluenceLinker-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/<Absolute-path-to-folder>/MRConfluenceLinker-mcp-server/src/MRConfluenceLinker-mcp-server",
"run",
"server.py"
]
}
}
}
2. The server will listen for commands through stdin/stdout. You can interact with it using prompts like:
プロジェクト「my-project」からマージリクエスト #1 の詳細を取得できますか?プロジェクト「my-project」のマージリクエスト #1 のコード変更を分析できますか?プロジェクト「my-project」のマージリクエスト #1 の概要を Confluence に保存できますか?
## Available Tools
The server provides the following tools:
1. `fetch_mr_details`: Fetches details of a specific merge request or all merge requests
- Parameters:
- `project_id`: The GitLab project ID
- `mr_id` (optional): Specific merge request ID
2. `analyze_code_changes`: Analyzes code changes in a merge request
- Parameters:
- `project_id`: The GitLab project ID
- `mr_id`: The merge request ID to analyze
3. `store_in_confluence`: Stores analysis results in Confluence
- Parameters:
- `project_id`: The GitLab project ID
- `mr_id` (optional): Specific merge request ID
- `analysis` (optional): Analysis results to store
## Logging
The server generates detailed logs in `mcp_server.log` and outputs to stderr. This helps in debugging issues with:
- GitLab API access
- Confluence integration
- Code analysis
- Page creation and updates
## Error Handling
The server includes comprehensive error handling for:
- Missing environment variables
- API authentication issues
- Network connectivity problems
- Invalid project or merge request IDs
- Confluence permission issues
## Contributing
1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request
## License
This project is licensed under the MIT License - see the LICENSE file for details.
## Support
For support, please [create an issue](https://github.com/CodeByWaqas/MRConfluenceLinker-mcp-server/issues) or contact the maintainers.
## Project Structure
MRConfluenceLinker-mcp-server/ ├── src/ # ソースコードディレクトリ │ └── MRConfluenceLinker-mcp-server/ # メインサーバーパッケージ │ ├── resources/ # リソースモジュール │ │ ├── init .py │ │ ├── client.py # クライアント実装 / GitLab PR 統合 │ ├── server.py # メインサーバー実装 │ └── mcp_server.log # サーバーログ ├── pycache / # Python キャッシュファイル ├── .git/ # Git リポジトリ ├── .gitignore # Git 無視ルール ├── CONTRIBUTING.md # 貢献ガイドライン ├── LICENSE # プロジェクトライセンス ├── README.md # プロジェクトドキュメント ├── pyproject.toml # Python プロジェクト構成 ├── requirements.txt # プロジェクトの依存関係└── uv.lock # 依存関係ロックファイル
### Key Components
- **Source Code**: Located in the `src/MRConfluenceLinker-mcp-server/` directory
- `server.py`: Main MCP server implementation
- `resources/client.py`: Client-side implementation contains GitLab PR integration
- **Configuration Files**:
- `requirements.txt`: Python package dependencies
- `pyproject.toml`: Project metadata and build configuration
- `uv.lock`: Locked dependency versions
- `.env.example`: Environment variables template
- **Documentation**:
- `README.md`: Project overview and setup instructions
- `CONTRIBUTING.md`: Contribution guidelines
- `LICENSE`: Project license
- **Development**:
- `__pycache__/`: Python cache files
- `mcp_server.log`: Server logs for debuggingThis server cannot be deployed
Maintenance
Related MCP Connectors
Writes your daily standup from GitLab or GitHub merge request state: what's ready, blocked or waiting on your review, and why a pipeline is red, read from the failing job log. OAuth sign-in, no API keys; can post the note to Slack, Discord or Google Chat on a schedule.
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Connect to Atlassian Jira, Confluence, Loom, and more to search, create, and manage your work.
Agile project management over MCP: boards, epics, roadmap, retros, whiteboards, wiki, metrics
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to review GitLab merge requests by fetching changes, analyzing diffs, adding comments, and managing approvals through the GitLab API. Supports complete merge request analysis, file-specific reviews, and version comparisons.124MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to review GitLab merge requests by fetching diffs, analyzing code changes, adding comments, and managing approvals through the GitLab API. Supports comprehensive merge request analysis and version comparison for automated code review workflows.3MIT
- AlicenseNot gradedqualityDmaintenanceAutomatically 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.1MIT
- FlicenseAqualityCmaintenanceConnects AI assistants to GitLab to interact with merge requests, reviews, discussions, pipelines, and test results through natural language queries. Supports viewing MR details, responding to comments, checking test summaries, and analyzing job logs.122-