bitbucket-automatic-pr-reviewer
🤖 Automated PR reviews using Claude CLI with Bitbucket webhooks. Features sequential processing, MCP integration, Prometheus metrics, and secure webhook validation. Perfect for teams wanting AI-powered code reviews without API costs.
claude mcp add --transport stdio tintinwinata-bitbucket-automatic-pr-reviewer docker compose up -d \ --env WORKSPACE="yourworkspace" \ --env WEBHOOK_SECRET="your-webhook-secret"
How to use
This MCP server provides a Docker-based PR automation service that listens for Bitbucket pull request webhooks and processes each PR using Claude CLI (not the API). When a PR is opened, the service validates the webhook signature, ensures the repository is cloned under the configured projects directory, updates the repository if needed, and then runs Claude CLI to generate a text-based code review. The workflow supports webhook validation, workspace scoping, and optional template-driven reviews, with results logged to the console and exportable metrics via Prometheus integration. You can extend functionality to post comments or release notes based on Claude’s output.
How to install
Prerequisites:
- Docker and Docker Compose installed on the host
- Bitbucket repository with webhook access and credentials
- Node.js environment previously used for setup (optional, since this is Docker-based)
Installation steps:
-
Clone the repository: git clone https://github.com/<org>/<repo>.git cd <repo>
-
Copy the example environment file and tailor it to your environment: cp .env.example .env
Edit .env to set WORKSPACE and WEBHOOK_SECRET and any other needed vars
-
Build and run with Docker Compose: docker-compose up -d
-
Optional: Run an initial setup to configure Claude CLI in the container (if applicable): npm install npm run setup
-
Verify the server is running: curl http://localhost:3000/health
Notes:
- The service uses Claude CLI installed inside the Docker image; there is no external API key required for Claude API usage.
- Ensure your Bitbucket webhook is configured to point to http://your-server:3000/webhook/bitbucket/pr and that firewall rules allow inbound traffic on port 3000.
If you modify configuration or templates, restart the service with: docker-compose restart pr-automation
Additional notes
Tips and common issues:
- Ensure the WORKSPACE value matches your intended workspace for Bitbucket scope restrictions.
- If webhook validation fails, confirm the webhook secret matches the one configured in your Bitbucket webhook and in the environment variable WEBHOOK_SECRET.
- The repository will be cloned under /app/projects inside the container (adjust volume mapping in docker-compose if you need persistence on the host).
- Claude CLI is used with the --dangerously-skip-permissions flag; be mindful of the security implications and ensure proper workspace restrictions.
- If you want to extend functionality to post PR comments, you can wire the Claude output back to Bitbucket using the existing webhook handling code path.
- Prometheus metrics can be enabled to monitor queue length, processing times, and error rates by exposing /metrics in the Express server.
Related MCP Servers
ai-guide
程序员鱼皮的 AI 资源大全 + Vibe Coding 零基础教程,分享大模型选择指南(DeepSeek / GPT / Gemini / Claude)、最新 AI 资讯、Prompt 提示词大全、AI 知识百科(RAG / MCP / A2A)、AI 编程教程、AI 工具用法(Cursor / Claude Code / OpenClaw / TRAE / Lovable / Agent Skills)、AI 开发框架教程(Spring AI / LangChain)、AI 产品变现指南,帮你快速掌握 AI 技术,走在时代前沿。本项目为开源文档版本,已升级为鱼皮 AI 导航网站
better-chatbot
Just a Better Chatbot. Powered by Agent & MCP & Workflows.
ai-dev-tools-zoomcamp
AI Dev Tools Zoomcamp is a free course that helps you use AI tools to write better code, faster. We're starting the first cohort of this course on November 18, 2025! Sign up here to join us 👇🏼
yutu
A fully functional MCP server and CLI for YouTube
apple-mail
MCP server giving AI assistants full access to Apple Mail - read, search, compose, organize & analyze emails via natural language
review-flow
Automated AI code reviews powered — webhook-driven, real-time dashboard, MCP integration, smart queue with deduplication, multi-agent audits, and iterative follow-up reviews for GitLab MRs and GitHub PRs