Navigation
PagerDuty MCP Server: Smart Automation & Downtime Elimination - MCP Implementation

PagerDuty MCP Server: Smart Automation & Downtime Elimination

Boost IT resilience with PagerDuty MCP Server—seamlessly integrate LLM agents to automate smarter incident responses, eliminate downtime, and supercharge your ops!

Developer Tools
4.9(188 reviews)
282 saves
131 comments

Users create an average of 23 projects per month with this tool

About PagerDuty MCP Server

What is PagerDuty MCP Server: Smart Automation & Downtime Elimination?

Imagine a tool that bridges the gap between your PagerDuty incident management workflows and AI-driven automation. The PagerDuty MCP Server acts as an intermediary, exposing PagerDuty’s API capabilities to language models (LLMs) in a structured way. Think of it as your smart automation engine that ensures zero unplanned downtime by enabling programmatic control over incidents, services, and teams. Instead of manual API calls, this server handles the heavy lifting with built-in error handling and rate limiting.

How to Use PagerDuty MCP Server: Smart Automation & Downtime Elimination?

Getting started is straightforward. First, install via PyPI with pip install pagerduty-mcp-server. Then, set your PagerDuty API key in the environment. For quick wins, run it as a standalone server with uv run python -m pagerduty_mcp_server. Need deeper integration? Configure it as a Goose extension using the provided JSON snippet. The server automatically handles pagination and rate limits, so you can focus on building logic like filtering incidents by status or service IDs without worrying about the plumbing.

PagerDuty MCP Server Features

Key Features of PagerDuty MCP Server: Smart Automation & Downtime Elimination?

This isn’t just another API wrapper. Key innovations include:

  • Context-Aware Filtering – Automatically scopes results to the current user’s permissions, eliminating manual access checks
  • Fail-Safe Responses – Structured error objects with both human-readable messages and machine-actionable codes
  • ISO8601 Precision – Date parameters validated down to the millisecond for accurate temporal filtering
  • LLM-Friendly Design – Consistent response formats with pluralized resource lists for easy parsing

Use Cases of PagerDuty MCP Server: Smart Automation & Downtime Elimination?

Imagine using this server to:

  • Automate incident acknowledgment workflows using NLP-driven decisions
  • Create real-time dashboards showing triggered incidents across multiple services
  • Generate compliance reports by filtering resolved incidents within specific date ranges
  • Build escalation bots that analyze team availability before routing alerts

PagerDuty MCP Server FAQ

FAQ from PagerDuty MCP Server: Smart Automation & Downtime Elimination?

Q: How does it prevent API abuse?
The server enforces PagerDuty’s rate limits and gracefully handles throttling responses.

Q: Can I customize error handling?
While the core error structure is fixed for consistency, you can parse error codes programmatically for custom recovery logic.

Q: What Python versions are supported?
Requires Python 3.13+ to leverage modern async patterns and type hints for better developer safety.

Q: Does it work with cloud-based setups?
Absolutely! Designed for server environments, it plays nicely with containerization and orchestration tools.

Content

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.

PyPI Downloads Python Versions GitHub Contributors PyPI version License

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 in list_incidents, only triggered, acknowledged, and resolved are valid values
  • For urgency in incidents, only high and low are valid values

Rate Limiting and Pagination

  • The server respects PagerDuty's rate limits
  • The server automatically handles pagination for you

Example Usage

from pagerduty_mcp_server import incidents

# 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'
)

User Context

Many functions support automatic filtering based on the current user's context. When current_user_context=True (default), results are filtered to only show resources the current user has access to:

  • Incidents for teams the user belongs to
  • Services the user has access to
  • Teams the user belongs to
  • Escalation policies the user is part of

When using current_user_context=True (default), you cannot use user_ids, team_ids, or service_ids parameters as they would conflict with the automatic filtering.

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 python -m integration

To run only parser tests:

uv run python -m parsers

To run only tests related to a specific submodule:

uv run python -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)

Related MCP Servers & Clients