Skip to main content
Glama
chenzhaoxuan0

pagerduty-mcp

README.md
# pagerduty-mcp

Dedalus MCP server for PagerDuty incident response. It exposes incident reads, incident acknowledgement and resolution, on-call lookup, and service listing.

## Tools

- `list_incidents` - List incidents with status, service, and time filters.
- `get_incident` - Fetch one incident by ID.
- `acknowledge_incident` - Acknowledge an incident.
- `resolve_incident` - Resolve an incident.
- `list_oncalls` - List on-call entries.
- `list_services` - List PagerDuty services.

## Safety Notes

`acknowledge_incident` and `resolve_incident` are high-impact incident-response writes. Acknowledging may change escalation behavior. Resolving may stop paging and incident follow-up. Require explicit user intent and a specific incident ID before calling either tool.

PagerDuty writes require a `From` email for auditability. Pass `from_email` or set `PAGERDUTY_FROM_EMAIL`.

Never commit API tokens, incident exports, escalation policy data, or user schedules.

## Authentication

This implementation targets Dedalus Type 3 DAuth API-token auth. It declares a connection named `pagerduty-mcp` with secret key `PAGERDUTY_API_TOKEN` and sends `Authorization: Token token=<token>` through the DAuth dispatch layer.

Environment variables:

```bash
PAGERDUTY_API_TOKEN=...
PAGERDUTY_FROM_EMAIL=oncall-admin@example.com
DEDALUS_AS_URL=https://as.dedaluslabs.ai
```

If your PagerDuty OAuth app is ready, configure OAuth variables in Dedalus and keep the same bearer-compatible connection model only after verifying the token header expected by your app.

## Run Locally

```bash
uv run python src/main.py
```

In another terminal:

```bash
MCP_SERVER_URL=http://127.0.0.1:8080/mcp uv run python src/_client.py
```

Set `PAGERDUTY_TEST_INCIDENT_ID` to a safe test incident. The client intentionally calls the write tools, so do not point it at a production incident unless that is the intended test.

## Deploy

Publish as `dedalus-labs/pagerduty-mcp`, configure `PAGERDUTY_API_TOKEN` as a required DAuth credential, deploy, then run:

```bash
DEDALUS_MCP_SERVER_ONLY=1 DEDALUS_MCP_SERVER=dedalus-labs/pagerduty-mcp uv run python src/_client.py
```