PagerDuty MCP Server
PagerDuty MCP Server exposes PagerDuty API functionality as structured tools for LLMs, supporting read and write operations on PagerDuty resources.
Read/list and fetch details for escalation policies, incidents, on-call entries, schedules, services, teams, and users.
Filter queries by IDs, names, status, urgency, time ranges, teams, services, users, schedules, and escalation policies, with optional current-user scoping or account-wide incident visibility.
Use
includeto return only selected fields and reduce token usage.List users on call for a schedule and build the current authenticated user's context.
Acknowledge incidents, resolve incidents, and add notes to incidents.
Benefit from automatic pagination, rate-limit handling, parameter validation, and consistent metadata/error responses.
Provides tools for interacting with the PagerDuty API, enabling operations on incidents, services, teams, and users. Supports listing, filtering, and managing PagerDuty resources with automatic context-based filtering.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@PagerDuty MCP Server show me the currently triggered incidents"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: Logseq MCP Server
Getting Started
Initialize your local Python environment:
cd pagerduty-mcp-server
brew install uv
uv syncConfigure 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" > .envOption 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.Set the redirect URI to
http://localhost:5173/oauth/pagerduty(default port).Set the
PAGERDUTY_CLIENT_IDenvironment variable to your application's client ID.
Optional configuration:
Set
PAGERDUTY_CLIENT_SECRETto enable token refresh (confidential client).Set
PAGERDUTY_OAUTH_CALLBACK_PORTto override the default callback port (5173).
Usage
Claude/Cursor
{
"mcpServers": {
"pagerduty-mcp-server": {
"command": "uvx",
"args": ["pagerduty-mcp-server"],
"env": {
"PAGERDUTY_API_TOKEN": "<PAGERDUTY_API_TOKEN>"
}
}
}
}As Standalone Server
uv run pagerduty-mcp-serverAvailable Tools
Read Tools
get_escalation_policies— List or get details for escalation policiesget_incidents— List or get details for incidents (supports filtering by status, urgency, service, team, and time range)get_oncalls— List on-call entries for a time rangeget_schedules— List or get details for schedulesget_services— List or get details for servicesget_teams— List or get details for teamsget_users— List or get details for userslist_users_oncall— List users on call for a specific schedulebuild_user_context— Build a context object for the current authenticated user
Write Tools
acknowledge_incident— Acknowledge an incident (signals active investigation)resolve_incident— Resolve an incident (stops further escalations)add_incident_note— Add a note to an incident (for recording investigation progress or context)
The include Parameter
Most read tools accept an optional include parameter — a list of field names to return. When specified, only those fields are included in each response object, which reduces token usage in LLM contexts.
# Return only id, title, and status for each incident
get_incidents(include=["id", "title", "status"])
# Return only id and name for each service
get_services(include=["id", "name"])See the tool documentation for the full list of available fields per tool.
Response Format
All API responses follow a consistent format:
{
"metadata": {
"count": "<int>",
"description": "<str>"
},
"<resource_type>": [
{
"...": "..."
}
],
"error": {
"message": "<str>",
"code": "<str>"
}
}The error field is only present when an error occurs. Resource names in responses are always pluralized for consistency, even when a single item is returned.
Error Handling
When an error occurs, the response will include an error object with the following structure:
{
"metadata": {
"count": 0,
"description": "Error occurred while processing request"
},
"error": {
"message": "Invalid user ID provided",
"code": "INVALID_USER_ID"
}
}Common error scenarios include:
Invalid resource IDs (e.g., user_id, team_id, service_id)
Missing required parameters
Invalid parameter values
API request failures
Response processing errors
Parameter Validation
All ID values (single-ID parameters and list filters such as
team_ids) must contain only ASCII letters and digits; any other value returns an errorDate parameters must be valid ISO8601 timestamps
List parameters (e.g.,
statuses,team_ids) must contain valid valuesIn ID list filters, surrounding whitespace is stripped and blank IDs are ignored
Required parameters cannot be
Noneor empty stringsFor
statusesinget_incidents, onlytriggered,acknowledged, andresolvedare valid valuesFor
urgencyin incidents, onlyhighandloware valid valuesThe
limitparameter can be used to restrict the number of results returned by list operations
Rate Limiting and Pagination
The server respects PagerDuty's rate limits
The server automatically handles pagination for you
The
limitparameter can be used to control the number of results returned by list operationsIf no limit is specified, the server will return up to
pagerduty_mcp_server.utils.RESPONSE_LIMITresults by default
User Context
Many functions accept a current_user_context parameter (defaults to True) which automatically filters results based on this context.
Providing exclusive ID filters with real IDs implies current_user_context=False, including when True was set explicitly. Blank-only exclusive ID lists error instead of falling back to the caller's own teams.
For incidents:
Passing
team_idsand/orservice_idsimpliescurrent_user_context=FalsePass
all_visible=Trueto list incidents across the whole account that the API token can see, not scoped to the current user; this also impliescurrent_user_context=False
For services:
Passing
team_idsimpliescurrent_user_context=FalseName
querywith the default context searches only the current user's teams
For escalation policies:
Passing
user_idsand/orteam_idsimpliescurrent_user_context=FalseName
querywith the default context searches only the current user's policies/teams
For users:
Passing
team_idsimpliescurrent_user_context=FalseName
querywith the default context searches only the current user's teams
For on-calls:
Passing
user_idsand/orescalation_policy_idsimpliescurrent_user_context=Falseschedule_idscan still be used with the default context to filter by specific schedulesThe default query shows on-calls for the escalation policies the current user is a target of
If the current user is not a target of any escalation policy and no
schedule_idsare given, the tool returns an error; pass exclusive filters orschedule_idsinstead
Development
Running Tests
The test suite includes both unit tests and integration tests. Integration tests require a real connection to the PagerDuty API, while unit tests can run without API access.
The pytest-cov args are optional, use them to include a test coverage report in the output.
To run all tests (integration tests will be automatically skipped if PAGERDUTY_API_TOKEN is not set):
uv run pytest [--cov=src --cov-report=term-missing]To run only unit tests (no API token required):
uv run pytest -m unit [--cov=src --cov-report=term-missing]To run only integration tests (requires PAGERDUTY_API_TOKEN set in environment):
uv run pytest -m integration [--cov=src --cov-report=term-missing]To run only tests related to a specific submodule:
uv run pytest -m <client|escalation_policies|...> [--cov=src --cov-report=term-missing]Debug Server with MCP Inspector
npx @modelcontextprotocol/inspector uv run pagerduty-mcp-serverDocumentation
Tool Documentation - Detailed information about available tools including parameters, return types, and example queries
Conventions
All API responses follow the standard format with metadata, resource list, and optional error
Resource names in responses are always pluralized for consistency
All functions that return a single item still return a list with one element
Error responses include both a message and a code
All timestamps are in ISO8601 format
Tests are marked with pytest markers to indicate their type (unit/integration) and the resource they test (incidents, teams, etc.)
Example Queries
Are there any incidents assigned to me currently in pagerduty?
Do I have any upcoming on call schedule in next 2 weeks?
Who else is a member of the personalization team?
Available Tools
12 toolsacknowledge_incidentB
Acknowledge a PagerDuty incident. This signals that someone is actively working on the incident.
Inputs: incident_id (required), include. Returns: object
add_incident_noteA
Add a note to a PagerDuty incident. Notes are used to record additional context, investigation progress, or resolution details.
Inputs: content (required), incident_id (required). Returns: object
build_user_contextA
Validate and build the current user's context into a dictionary with the following format: { "user_id": str, "team_ids": List[str], "service_ids": List[str], "escalation_policy_ids": List[str] } The MCP server tools use this user context to filter the following resources: - Escalation policies - Incidents - Oncalls - Services - Users
Inputs: no named parameters. Returns: object
get_escalation_policiesA
Get PagerDuty escalation policies by filters or get details for a specific policy ID.
Call patterns:
Default: omit filters (uses current user's policies/teams).
By IDs: pass
user_idsand/orteam_ids(impliescurrent_user_context=False, including overriding an explicit True).By name: pass
querywith the default context (limited to your teams/policies); do not setcurrent_user_context=Falsewith onlyquery.
Inputs: limit, query, include, team_ids, +3 more. Returns: object
get_incidentsA
Get PagerDuty incidents by filters or get details for a specific incident ID or number.
Call patterns:
List my/team incidents: omit ID filters (default
current_user_context=True).List by service/team: pass
service_idsand/orteam_ids(impliescurrent_user_context=False, including overriding an explicit True). Do not also setinclude_notes/include_past_incidents/include_related_incidentson this list call.Detail + notes: second call with only
incident_id(and optional include_* flags).Account-wide list:
all_visible=Truealone (not scoped to the current user).
Inputs: limit, since, until, include, +10 more. Returns: object
get_oncallsA
List on-call entries for schedules, policies, or time ranges.
Call patterns:
Default: omit exclusive filters (uses escalation policies the current user is a target of).
By schedule:
schedule_idsmay be used with the default context (intersection) or withcurrent_user_context=False.By user/policy IDs: pass
user_idsand/orescalation_policy_ids(impliescurrent_user_context=False, including overriding an explicit True).
Behavior varies by time parameters:
Without since/until: Returns current on-calls Example: get_oncalls(current_user_context=False, schedule_ids=["PSCHED123"])
With since/until: Returns all on-calls in range Example: get_oncalls(current_user_context=False, schedule_ids=["PSCHED123"], since="2024-03-20T00:00:00Z", until="2024-03-27T00:00:00Z")
Inputs: limit, since, until, include, +5 more. Returns: object
get_schedulesB
Get PagerDuty schedules by filters or get details for a specific schedule ID.
Inputs: limit, query, since, until, +2 more. Returns: object
get_servicesA
Get PagerDuty services by filters or get details for a specific service ID.
Call patterns:
Search by name:
query="Service Name"with the default context (omitcurrent_user_context; limited to your teams).By team: pass
team_ids(impliescurrent_user_context=False, including overriding an explicit True).Do not set
current_user_context=Falsewith onlyquery; that errors becauseteam_idsare required in False mode.
Inputs: limit, query, include, team_ids, +2 more. Returns: object
get_teamsA
Get PagerDuty teams by filters or get details for a specific team ID.
Inputs: limit, query, include, team_id. Returns: object
get_usersA
Get PagerDuty users by filters or get details for a specific user ID.
Call patterns:
Search by name:
query="Name"with the default context (omitcurrent_user_context; limited to your teams).By team: pass
team_ids(impliescurrent_user_context=False, including overriding an explicit True).Do not set
current_user_context=Falsewith onlyquery; that errors becauseteam_idsare required in False mode.
Inputs: limit, query, include, user_id, +2 more. Returns: object
list_users_oncallC
List the users on call for a schedule during the specified time range.
Inputs: schedule_id (required), since, until, include. Returns: object
resolve_incidentA
Resolve a PagerDuty incident. This marks the incident as resolved and stops any further escalations.
Inputs: incident_id (required), include. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools map cleanly to distinct PagerDuty resources or incident actions. The main ambiguity is between get_oncalls and list_users_oncall, and several get_* tools combine list and detail modes, though the descriptions make reasonable distinctions.
All tool names follow a consistent snake_case verb_noun pattern using get_, list_, acknowledge_, resolve_, add_, and build_. The use of get_ for both listing and fetching details is a minor semantic issue rather than a naming inconsistency.
Twelve tools is a well-scoped size for a PagerDuty incident-management MCP server. Each tool covers a distinct resource or action, with no obvious filler tools.
The surface covers core read operations plus acknowledge, resolve, and note actions, which supports incident triage and response. However, it lacks create/update incident operations, assignment or priority changes, and write operations for schedules, teams, and services, leaving notable lifecycle gaps.
Maintenance
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Related MCP Servers
- AlicenseBqualityDmaintenanceThis server facilitates the invocation of AI models from providers like Anthropic, OpenAI, and Groq, enabling users to manage and configure large language model interactions seamlessly.240 PyPI13MIT
- AlicenseBqualityBmaintenanceA server that enables LLMs to programmatically interact with Logseq knowledge graphs, allowing creation and management of pages and blocks.1047MIT
- AlicenseNot gradedqualityAmaintenanceA server that enables Large Language Models to discover and interact with REST APIs defined by OpenAPI specifications through the Model Context Protocol.12,706 npm302MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol Server that enables LLMs to interact with and execute REST API calls through natural language prompts, supporting GET/PUT/POST/PATCH operations on configured APIs.6Apache 2.0