
MCP server exposing PagerDuty incidents, services, schedules, and on-calls to AI agents — read, acknowledge, resolve, with OAuth and API key auth
概览
A server that exposes PagerDuty API functionality to LLMs. This server is designed to be used programmatically, with structured inputs and outputs. The PagerDuty MCP Server provides a set of tools for interacting with the PagerDuty API. These tools are designed to be used by LLMs to perform various operations on PagerDuty resources such as incidents, services, teams, and users. 1. Initialize your local Python environment: 2. Configure authentication (see Authentication below). : X-PagerDuty-Token HTTP header > PAGERDUTY_API_TOKEN environment variable > OAuth 2.0 PKCE When running as part of a platform that injects per-request credentials, the server reads the X-PagerDuty-Token HTTP header. This takes highest priority and does not require any local configuration. Set the PAGERDUTY_API_TOKEN environment variable, or add it to a .env file in the project root. The server will automatically load environment variables from the .env file if present.
README
以下为原文 README 节选,完整内容请查看原文。
PagerDuty MCP Server
A server that exposes PagerDuty API functionality to LLMs. This server is designed to be used programmatically, with structured inputs and outputs.
Overview
The PagerDuty MCP Server provides a set of tools for interacting with the PagerDuty API. These tools are designed to be used by LLMs to perform various operations on PagerDuty resources such as incidents, services, teams, and users.
Getting Started
- Initialize your local Python environment:
cd pagerduty-mcp-server
brew install uv
uv sync
- Configure authentication (see Authentication below).
Authentication
Priority: X-PagerDuty-Token HTTP header > PAGERDUTY_API_TOKEN environment variable > OAuth 2.0 PKCE
Option 1: X-PagerDuty-Token Header (Platform Integration)
When running as part of a platform that injects per-request credentials, the server reads the X-PagerDuty-Token HTTP header. This takes highest priority and does not require any local configuration.
Option 2: API Token (Recommended for Most Users)
Set the PAGERDUTY_API_TOKEN environment variable, or add it to a .env file in the project root. The server will automatically load environment variables from the .env file if present.
Environment variable:
export PAGERDUTY_API_TOKEN=your_api_token_here
.env file (recommended):
echo "PAGERDUTY_API_TOKEN=your_api_token_here" > .env
Option 3: OAuth 2.0 PKCE (Local Interactive Use)
OAuth is available for local standalone usage. It opens a browser for authentication and stores tokens securely in the OS keyring. OAuth is opt-in — it only activates when PAGERDUTY_CLIENT_ID is set and no API token is present.
Setup:
- Register a PagerDuty OAuth application at Integrations → Developer Tools → My Apps.
- Set the required scope to
read write.
安装
uvx pagerduty-mcp-server配置
{
"mcpServers": {
"pagerduty-mcp-server": {
"command": "uvx",
"args": ["pagerduty-mcp-server"],
"env": {
"PAGERDUTY_API_TOKEN": "<PAGERDUTY_API_TOKEN>"
}
}
}
}