Make sure you have completed the Prerequisites before continuing.
Installation
Configure environment variables
.env and fill in the required variables:| Variable | Required | Description |
|---|---|---|
GITHUB_APP_ID | Yes | The numeric ID of your GitHub App |
GITHUB_PRIVATE_KEY | Yes | RSA private key for authenticating as the GitHub App (or use GITHUB_PRIVATE_KEY_FILE to point to a .pem file) |
GITHUB_WEBHOOK_SECRET | Yes | HMAC secret for validating webhook payloads |
GITHUB_CLIENT_ID | Yes | OAuth client ID from your GitHub App (used by the dashboard for sign-in) |
GITHUB_CLIENT_SECRET | Yes | OAuth client secret from your GitHub App |
NEXTAUTH_SECRET | Yes | Random 32-byte secret for signing dashboard sessions (generate with openssl rand -base64 32) |
ANTHROPIC_API_KEY | If LLM_PROVIDER=anthropic | API key from console.anthropic.com |
LLM_PROVIDER | No | Default: anthropic. Options: anthropic, litellm, bedrock, ollama |
LLM_MODEL | Yes for anthropic / litellm / ollama | Model ID. For Anthropic, use a native model ID like claude-sonnet-4-20250514 — the built-in defaults are Bedrock inference profile IDs and only work for LLM_PROVIDER=bedrock. |
DASHBOARD_URL | No | Public URL of the dashboard (e.g., https://dashboard.example.com). Used as the NEXTAUTH_URL for session callbacks. Defaults to http://localhost:3001. |
DATABASE_URL | No | Set automatically by docker-compose (Postgres sidecar) |
PORT | No | Default: 3000 |
Start MergeWatch
- mergewatch — the Express server on port 3000 (handles GitHub webhooks)
- dashboard — the Next.js dashboard on port 3001 (browser UI)
- db — PostgreSQL 16 database
Register your webhook URL
MergeWatch listens for GitHub webhooks at Set the webhook URL in GitHub Settings > Developer settings > GitHub Apps > Your App > Webhook URL.
/webhook on port 3000. Configure your GitHub App’s webhook URL to:Running locally? Use ngrok or Cloudflare Tunnel to expose port 3000 to the internet so GitHub can deliver webhooks.Use the generated
https://...ngrok-free.app/webhook URL as your webhook URL.Install the GitHub App on your repositories
- Go to GitHub Settings > Developer settings > GitHub Apps
- Find your MergeWatch app and click Install App
- Choose All repositories or select specific ones
- Click Install
Your first pull request
Open a pull request against any installed repository. MergeWatch picks it up automatically. What to expect:- The Express server receives the
pull_request.openedwebhook event - The review pipeline fetches the diff and sends it to your LLM provider
- A review comment appears on the pull request within 15—50 seconds (typical range; larger diffs and cold starts take longer)
- A summary of the changes
- File-by-file findings posted as inline review comments on changed lines
- A 1–5 merge readiness score indicating how safe the PR is to merge
Next steps
LLM Providers
Switch from Anthropic to LiteLLM, Bedrock, or Ollama.
Platform Guides
Deploy to Google Cloud Run, AWS ECS, Azure, Fly.io, Railway, or bare metal.
Configure review behavior
Tune sensitivity, ignored paths, and review focus areas.
Upgrading
Keep MergeWatch up to date with the latest features and fixes.