# Notifications and coding agents

> Send alerts to Slack, Microsoft Teams, Google Chat, Discord, PagerDuty or email, connect context from your tools, and let MCP coding agents fix findings for you.

## Slack, Microsoft Teams and Google Chat

There are two ways to bring MergeHarbor into chat:

- **Apps** for [Slack](https://mergeharbor.com/docs/slack), [Microsoft Teams](https://mergeharbor.com/docs/microsoft-teams), [Google Chat](https://mergeharbor.com/docs/google-chat) and [Discord](https://mergeharbor.com/docs/discord): ask about pull requests in threads, get review summaries and finding explanations, open fix pull requests behind a confirm button, and receive alerts with **Explain**, **Open fix PR** and **Mute 24h** buttons.
- **Incoming webhooks**: the simple option when you only want alerts in a channel. Nothing to install in the workspace and no buttons.

To set up a webhook, open **Integrations** in the console, pick the chat service, add a destination, then add a rule that chooses what to send there.

| Destination              | What you need                                                                                                  |
| ------------------------ | -------------------------------------------------------------------------------------------------------------- |
| Slack (incoming webhook) | A `https://hooks.slack.com/services/…` incoming webhook URL                                                    |
| Slack (bot token)        | A bot token (`xoxb-…`) with `chat:write`, and the channel to post in                                           |
| Microsoft Teams          | An incoming webhook or Workflows URL                                                                           |
| Google Chat              | A space's incoming webhook URL (`https://chat.googleapis.com/v1/spaces/…/messages…`)                           |
| Discord                  | A channel webhook URL (`https://discord.com/api/webhooks/…`)                                                   |
| PagerDuty                | An Events API v2 integration key for a PagerDuty service; see [PagerDuty](https://mergeharbor.com/docs/pagerduty#alerts-to-pagerduty) |
| Email                    | Up to 20 addresses, under **Settings → Alerts & webhooks** (self-hosted installations need SMTP configured)    |

Rules apply to every repository or to one, with a minimum severity (major and above by default). You can send:

- **Findings posted**: a review found issues at or above the minimum severity.
- **Reviews paused**: the plan allowance, overage limit or budget stopped reviews.
- **Indexing failed**: a repository could not be indexed and needs attention. A temporary problem that MergeHarbor retries by itself is not sent; it is sent if the automatic retries do not fix it.
- **Review failed**: a review could not be completed.
- **Code host connection unhealthy**: a token expired, the app was uninstalled, or a permission was lost.
- **Webhooks stopped arriving**: an active repository has stopped receiving webhooks from its code host.
- **Weekly digest**: every Monday, the week's reviews, issues caught, findings accepted, spend and top open findings.

Each event is sent once per destination, with automatic retries. Webhook URLs and tokens are encrypted and never shown again; MergeHarbor only calls Slack, Microsoft, Google Chat, Discord and PagerDuty hosts. PagerDuty destinations start turned off. Use **Send test** to check a destination.

The same destinations receive [automations](https://mergeharbor.com/docs/automations): digests, incident suspects, triage and nudges on a schedule or when something happens.

## Docs, issue trackers, observability, CI and support

Connect these in **Integrations** so reviews know what a pull request is meant to do, where production is failing, why CI failed and what customers report. [Context connectors](https://mergeharbor.com/docs/connectors) explains what each one adds and what it reads.

- **Docs and knowledge**: [Notion](https://mergeharbor.com/docs/notion), [Confluence](https://mergeharbor.com/docs/jira), [Google Drive](https://mergeharbor.com/docs/google-drive), [OneDrive and SharePoint](https://mergeharbor.com/docs/onedrive).
- **Issue tracking**: [Jira](https://mergeharbor.com/docs/jira), [Azure Boards](https://mergeharbor.com/docs/azure-boards), [Linear](https://mergeharbor.com/docs/linear), [Asana](https://mergeharbor.com/docs/asana), [ClickUp](https://mergeharbor.com/docs/clickup), [Trello](https://mergeharbor.com/docs/trello).
- **Observability**: [Sentry](https://mergeharbor.com/docs/sentry), [Datadog](https://mergeharbor.com/docs/datadog), [PagerDuty](https://mergeharbor.com/docs/pagerduty), [AWS CloudWatch Logs](https://mergeharbor.com/docs/cloudwatch), [Google Cloud Logging](https://mergeharbor.com/docs/google-cloud-logging).
- **Design**: [Figma](https://mergeharbor.com/docs/figma).
- **CI and builds**: [GitHub Actions, GitLab CI, CircleCI, Jenkins and Buildkite](https://mergeharbor.com/docs/ci).
- **Customer support**: [Zendesk](https://mergeharbor.com/docs/zendesk), [Intercom](https://mergeharbor.com/docs/intercom).

MergeHarbor reads only what a pull request (or its linked issue) references, what you pin, the log groups, services and tags you map, and the failed CI jobs of the head commit. Nothing is crawled.

## One switch per integration

Every card in **Integrations** has one switch, and it does what you would expect:

- **Not connected, switch on**: connecting starts right away. You go to the service to sign in, or fill in the token form on the card, and come back with the card on.
- **On, switch off**: the integration pauses. Its credentials, settings and repository choices stay. For a code host, MergeHarbor ignores its webhooks and stops reviewing and indexing its repositories. Nothing is replayed later, so the next push or comment after you turn it back on starts reviews again. Local reviews from the CLI keep working. For other integrations, reviews, PR chat, CI explanations, triage, automations and issue comments stop using it. For a chat app, the app replies that it is paused and sends no alerts.
- **Paused, switch on**: MergeHarbor checks the credentials first. A sign-in that is about to expire is renewed. A token is checked with one quick call. If the service rejected them, you go straight to signing in again (or the token form opens). If the service does not answer, the integration turns on and shows a short warning, and MergeHarbor checks again in the background.

MergeHarbor also renews sign-ins before they expire. When a service rejects them for good (access revoked, password changed, app removed), the card says **Sign in again** and admins get one notification. Click it, or turn the switch on, to sign in.

**Manage** shows the details: the accounts connected, what each can see, **Connect another account** where the service allows it, and **Remove**. Remove deletes the stored tokens. For a code host it also removes the webhooks MergeHarbor registered, and the repositories it brought are deleted after the grace period (7 days by default) unless you connect the same code host again.

## Coding agents (MCP)

MergeHarbor is a [Model Context Protocol](https://modelcontextprotocol.io) server. Your coding agent can find what is left to fix on the branch you are on, get a ready-to-apply patch for each suggested change, and mark findings addressed when it is done. It can also read your team's rules and propose new ones for an admin to approve.

| Tool                                                                  | What it does                                                                    |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `list_unaddressed`                                                    | Open findings on a pull request, found from your repository and branch          |
| `fix_all_plan`                                                        | Every open finding in one ordered plan, grouped by file                         |
| `apply_fix`                                                           | A patch for a suggested change, re-anchored onto your copy of the file          |
| `mark_addressed`                                                      | Marks the findings you fixed as addressed                                       |
| `get_pr_review`, `list_findings`, `get_finding`, `resolve_finding`    | Read reviews and findings; dismiss a finding with a reason                      |
| `get_change_risk`                                                     | A pull request's change risk: score, level and the reasons behind it            |
| `list_rules`, `add_rule`                                              | Read team rules; propose a new one                                              |
| `list_knowledge_bases`, `get_knowledge_page`, `search_knowledge_base` | Read and search the [generated docs](https://mergeharbor.com/docs/knowledge-base) of your repositories |
| `get_change_history`                                                  | Past reverts, rollbacks, hotfixes and incident fixes in a repository            |

The merge gate and Shipyard tools, and whether each tool reads or changes data, are listed on the [Claude connector](https://mergeharbor.com/docs/claude-connector#tools) page.

### Sign in as yourself

Add the server URL to your agent and sign in when it asks: you choose the organization and approve the agent in the MergeHarbor console. The agent works with your permissions, and your organization's single sign-on and session rules still apply. You can sign agents out under **Your coding agent (account menu)**.

Claude Code:

```bash
claude mcp add --transport http mergeharbor https://<your MergeHarbor host>/mcp
```

Then run `/mcp` and choose **Authenticate**.

Claude on the web, desktop and mobile: add a custom connector with the server URL. See [Claude connector](https://mergeharbor.com/docs/claude-connector).

Cursor (`.cursor/mcp.json`):

```json
{ "mcpServers": { "mergeharbor": { "url": "https://<your MergeHarbor host>/mcp" } } }
```

VS Code (`.vscode/mcp.json`):

```json
{ "servers": { "mergeharbor": { "type": "http", "url": "https://<your MergeHarbor host>/mcp" } } }
```

Codex CLI (`~/.codex/config.toml`), then `codex mcp login mergeharbor`:

```toml
[mcp_servers.mergeharbor]
url = "https://<your MergeHarbor host>/mcp"
```

In a terminal, install the [command-line client](https://mergeharbor.com/docs/cli) and run `mh login --url https://<your MergeHarbor host>`. Agents that only start local servers (Claude Desktop, Windsurf) can then run `mh mcp`.

### Or use an API key

For shared machines and automation, create an organization API key under **Settings → API keys** and send it as `Authorization: Bearer <key>`. Windsurf (`~/.codeium/windsurf/mcp_config.json`):

```json
{
  "mcpServers": {
    "mergeharbor": {
      "serverUrl": "https://<your MergeHarbor host>/mcp",
      "headers": { "Authorization": "Bearer ${env:MERGEHARBOR_API_KEY}" }
    }
  }
}
```

**Settings → Coding agents → Organization setup** in the console has these snippets with your address filled in.

Then ask your agent something like _"Fix what MergeHarbor found on my branch"_. Everything an agent changes is recorded in the audit log.
