PagerDuty MCP Server
A server that exposes PagerDuty API functionality to LLMs with structured inputs and outputs, enabling management of incidents, services, teams, and users.
wpfleger96
Tools
list_escalation_policies
List existing escalation policies based on the given criteria. Args: current_user_context (bool): Whether to use the current user's ID/team IDs context (default: True, cannot be used with user_ids or team_ids) query (str): Filter escalation policies whose names contain the search query (optional) user_ids (List[str]): Filter results to only escalation policies that include the given user IDs (optional, cannot be used with current_user_context) team_ids (List[str]): Filter results to only escalation policies assigned to teams with the given IDs (optional, cannot be used with current_user_context) Returns: Dict[str, Any]: Dictionary containing metadata (count, description) and a list of escalation policies matching the specified criteria
show_escalation_policy
Show details about a given escalation policy. Args: policy_id (str): The ID of the escalation policy to show Returns: Dict[str, Any]: Escalation policy object with detailed information
show_team
Get detailed information about a given team. Args: team_id (str): The ID of the team to get Returns: Dict[str, Any]: Team object with detailed information
show_current_user
Get the current user's PagerDuty profile including their teams, contact methods, and notification rules. Returns: Dict[str, Any]: The user object containing profile information in the following format (note this is non-exhaustive): { "name": "John Doe", "email": "john.doe@example.com", "role": "user", "description": "John Doe is a user at Example Inc.", "job_title": "Software Engineer", "teams": [ { "id": "P123456", "summary": "Team Name 1" }, ... ], "contact_methods": [ { "id": "P123456", "summary": "Mobile" }, ... ], "notification_rules": [ { "id": "P123456", "summary": "0 minutes: channel XYZ" }, ... ], "id": "P123456" }
list_incidents
List PagerDuty incidents based on specified filters. Args: current_user_context (bool): Boolean, use the current user's team_ids and service_ids to filter (default: True, cannot be used with service_ids or team_ids) service_ids (List[str]): list of PagerDuty service IDs to filter by (optional, cannot be used with current_user_context) team_ids (List[str]): list of PagerDuty team IDs to filter by (optional, cannot be used with current_user_context) statuses (List[str]): list of status values to filter by (optional). Valid values are: - 'triggered' - The incident is currently active (included by default) - 'acknowledged' - The incident has been acknowledged by a user (included by default) - 'resolved' - The incident has been resolved (excluded by default) since (str): Start of date range in ISO8601 format (optional). Default is 1 month ago until (str): End of date range in ISO8601 format (optional). Default is now Returns: Dict[str, Any]: Dictionary containing metadata (count, description) and a list of incidents matching the specified criteria
show_incident
Get detailed information about a given incident. Args: incident_id (str): The ID or number of the incident to get Returns: Dict[str, Any]: Incident object with detailed information
list_oncalls
List the on-call entries during a given time range. Args: current_user_context (bool): Use the current user's ID to filter (default: True, cannot be used with user_ids or escalation_policy_ids) schedule_ids (List[str]): Return only on-calls for the specified schedule IDs (optional) user_ids (List[str]): Return only on-calls for the specified user IDs (optional, cannot be used with current_user_context) escalation_policy_ids (List[str]): Return only on-calls for the specified escalation policy IDs (optional, cannot be used with current_user_context) since (str): Start of date range in ISO8601 format (optional). Default is 1 month ago until (str): End of date range in ISO8601 format (optional). Default is now Returns: Dict[str, Any]: Dictionary containing metadata (count, description) and a list of on-call entries matching the specified criteria
list_schedules
List the on-call schedules. Args: query (str): Filter schedules whose names contain the search query (optional) Returns: Dict[str, Any]: Dictionary containing metadata (count, description) and a list of schedules matching the specified criteria
show_schedule
Show detailed information about a given schedule. Args: schedule_id (str): The ID of the schedule to get since (str): The start of the time range over which you want to search. Defaults to 2 weeks before until if an until is given. (optional) until (str): The end of the time range over which you want to search. Defaults to 2 weeks after since if a since is given. (optional) Returns: Dict[str, Any]: Schedule object with detailed information
list_services
List existing PagerDuty services. Args: current_user_context (bool): Use the current user's team IDs to filter (default: True, cannot be used with team_ids) team_ids (List[str]): Filter results to only services assigned to teams with the given IDs (optional, cannot be used with current_user_context) query (str): Filter services whose names contain the search query (optional) Returns: Dict[str, Any]: Dictionary containing metadata (count, description) and a list of services matching the specified criteria
show_service
Get details about a given service. Args: service_id (str): The ID of the service to get Returns: Dict[str, Any]: Service object with detailed information
list_teams
List teams in your PagerDuty account. Args: query (str): Filter teams whose names contain the search query (optional) Returns: Dict[str, Any]: Dictionary containing metadata (count, description) and a list of teams matching the specified criteria
list_users
List users in PagerDuty. Args: current_user_context (bool): Use the current user's team IDs to filter (default: True, cannot be used with team_ids) team_ids (List[str]): A list of team IDs to filter users (optional, cannot be used with current_user_context) query (str): A search query to filter users (optional) Returns: Dict[str, Any]: Dictionary containing metadata (count, description) and a list of users matching the specified criteria
show_user
Get detailed information about a given user. Args: user_id (str): The ID of the user to get Returns: Dict[str, Any]: User object with detailed information
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.
<a href="https://glama.ai/mcp/servers/@wpfleger96/pagerduty-mcp-server"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@wpfleger96/pagerduty-mcp-server/badge" alt="PagerDuty Server MCP server" /> </a>
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.
Installation
From PyPI
pip install pagerduty-mcp-server
From Source
# Clone the repository
git clone https://github.com/wpfleger96/pagerduty-mcp-server.git
cd pagerduty-mcp-server
# Install dependencies
brew install uv
uv sync
Requirements
- Python 3.13 or higher
- PagerDuty API key
Configuration
The PagerDuty MCP Server requires a PagerDuty API key to be set in the environment:
PAGERDUTY_API_KEY=your_api_key_here
Usage
As Goose Extension
{
"type": "stdio",
"enabled": true,
"args": [
"run",
"python",
"-m",
"pagerduty_mcp_server"
],
"commandInput": "uv run python -m pagerduty_mcp_server",
"timeout": 300,
"id": "pagerduty-mcp-server",
"name": "pagerduty-mcp-server",
"description": "pagerduty-mcp-server",
"env_keys": [
"PAGERDUTY_API_KEY"
],
"cmd": "uv"
}
As Standalone Server
uv run python -m pagerduty_mcp_server
Response Format
All API responses follow a consistent format:
{
"metadata": {
"count": <int>, // Number of results
"description": "<str>" // A short summary of the results
},
<resource_type>: [ // Always pluralized for consistency, even if one result is returned
{
...
},
...
],
"error": { // Only present if there's an error
"message": "<str>", // Human-readable error description
"code": "<str>" // Machine-readable error code
}
}
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 parameters must be valid PagerDuty resource IDs
- Date parameters must be valid ISO8601 timestamps
- List parameters (e.g.,
statuses
,team_ids
) must contain valid values - Invalid values in list parameters will be ignored
- Required parameters cannot be
None
or empty strings - For
statuses
inlist_incidents
, onlytriggered
,acknowledged
, andresolved
are valid values - For
urgency
in incidents, onlyhigh
andlow
are valid values - The
limit
parameter 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
limit
parameter can be used to control the number of results returned by list operations - If no limit is specified, the server will return up to {pagerduty_mcp_server.utils.RESPONSE_LIMIT} results by default
Example Usage
from pagerduty_mcp_server import incidents
from pagerduty_mcp_server.utils import RESPONSE_LIMIT
# List all incidents (including resolved) for the current user's teams
incidents_list = incidents.list_incidents()
# List only active incidents
active_incidents = incidents.list_incidents(statuses=['triggered', 'acknowledged'])
# List incidents for specific services
service_incidents = incidents.list_incidents(service_ids=['SERVICE-1', 'SERVICE-2'])
# List incidents for specific teams
team_incidents = incidents.list_incidents(team_ids=['TEAM-1', 'TEAM-2'])
# List incidents within a date range
date_range_incidents = incidents.list_incidents(
since='2024-03-01T00:00:00Z',
until='2024-03-14T23:59:59Z'
)
# List incidents with a limit on the number of results
limited_incidents = incidents.list_incidents(limit=10)
# List incidents with the default limit
default_limit_incidents = incidents.list_incidents(limit=RESPONSE_LIMIT)
User Context
Many functions accept a current_user_context
parameter (defaults to True
) which automatically filters results based on this context. When current_user_context
is True
, you cannot use certain filter parameters as they would conflict with the automatic filtering:
- For all resource types:
user_ids
cannot be used withcurrent_user_context=True
- For incidents:
team_ids
andservice_ids
cannot be used withcurrent_user_context=True
- For services:
team_ids
cannot be used withcurrent_user_context=True
- For escalation policies:
team_ids
cannot be used withcurrent_user_context=True
- For on-calls:
user_ids
cannot be used withcurrent_user_context=True
schedule_ids
can still be used to filter by specific schedules- The query will show on-calls for all escalation policies associated with the current user's teams
- This is useful for answering questions like "who is currently on-call for my team?"
- The current user's ID is not used as a filter, so you'll see all team members who are on-call
Development
Running Tests
Note that most tests require a real connection to PagerDuty API, so you'll need to set PAGERDUTY_API_KEY
in the environment before running the full test suite.
uv run pytest
To run only unit tests (i.e. tests that don't require PAGERDUTY_API_KEY
set in the environment):
uv run pytest -m unit
To run only integration tests:
uv run pytest -m integration
To run only parser tests:
uv run pytest -m parsers
To run only tests related to a specific submodule:
uv run pytest -m <client|escalation_policies|...>
Debug Server with MCP Inspector
npx @modelcontextprotocol/inspector uv run python -m pagerduty_mcp_server
Contributions
Releases
This project uses Conventional Commits for automated releases. Commit messages determine version bumps:
feat:
→ minor version (1.0.0 → 1.1.0)fix:
→ patch version (1.0.0 → 1.0.1)BREAKING CHANGE:
→ major version (1.0.0 → 2.0.0)
The CHANGELOG.md, GitHub releases, and PyPI packages are updated automatically.
Documentation
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), the resource they test (incidents, teams, etc.), and whether they test parsing functionality ("parsers" marker)
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

Linear MCP Server
A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.