# OnCallAlert MCP Server

The OnCallAlert Model Context Protocol (MCP) server allows AI assistants (such as Claude Desktop, Cursor, Claude Code, and autonomous coding agents) to interact directly with OnCallAlert to inspect, triage, acknowledge, and resolve incidents.

## Features

- **Read Operations**: Query active alerts, inspect alert details and timelines, look up who is currently on-call for any service or schedule.
- **Write Operations**: Acknowledge alerts, resolve alerts, escalate alerts to the next step, create new alerts, or add notes.
- **Strict Permission Scoping**: Uses an administrator or responder API token; actions are authenticated and audited under that identity.

## Configuring MCP Clients

Add the OnCallAlert MCP server configuration to your MCP configuration file (e.g., `claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "oncallalert": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e", "ONCALLALERT_URL=https://oncall.yourcompany.com",
        "-e", "ONCALLALERT_TOKEN=your-api-token",
        "oncallalert/mcp-server:latest"
      ]
    }
  }
}
```

## Available MCP Tools

| Tool Name | Parameters | Description |
|---|---|---|
| `list_alerts` | `status` (active, acknowledged, closed), `limit` | Lists active or recent incidents. |
| `get_alert` | `alert_id` | Retrieves full details, logs, and metadata for a specific alert. |
| `acknowledge_alert` | `alert_id` | Acknowledges an active incident to halt escalation cycles. |
| `resolve_alert` | `alert_id` | Marks an alert as resolved and closes incident. |
| `escalate_alert` | `alert_id` | Manually escalates alert to the next escalation policy tier. |
| `list_on_call` | `service_id` or `schedule_id` | Returns current on-call responders and contact info. |
| `create_alert` | `service_id`, `summary`, `details` | Triggers a new incident on a designated service. |
