PagerDuty MCP server

Exposes PagerDuty API functionality to LLMs.
Back to servers
Setup instructions
Provider
Will Pfleger
Release date
Mar 21, 2025
Language
Python
Package
Stats
2 stars

The PagerDuty MCP Server provides a programmatic interface for LLMs to interact with PagerDuty's API functionality, enabling operations on incidents, services, teams, and users with structured inputs and outputs.

Installation

Prerequisites

Before installing the PagerDuty MCP Server, you'll need:

  • Python installed on your system
  • A valid PagerDuty API token

Installation Steps

  1. Initialize your local Python environment:
cd pagerduty-mcp-server
brew install uv
uv sync
  1. Set up your PagerDuty API token in your environment:
export PAGERDUTY_API_TOKEN=your_api_token_here

Usage

You can use the PagerDuty MCP Server either as a Goose extension or as a standalone server.

Using as a Goose Extension

  1. In Goose, navigate to Settings > Extensions > Add
  2. Set Type to StandardIO
  3. Enter the absolute path to the project's CLI:
uv run /path/to/mcp/pagerduty-mcp-server/.venv/bin/pagerduty-mcp-server
  1. Enable the extension and verify that Goose recognizes your tools

Running as a Standalone Server

To run the server independently:

uv run path/to/repo/pagerduty-mcp-server/.venv/bin/pagerduty-mcp-server

Response Format

All API responses follow this consistent structure:

{
  "metadata": {
    "count": 5,
    "description": "A short summary of the results"
  },
  "resources": [
    {
      "id": "example_id",
      "name": "example_name",
      "other_properties": "..."
    }
  ],
  "error": {
    "message": "Human-readable error description",
    "code": "MACHINE_READABLE_ERROR_CODE"
  }
}

The error object will only be present if an error occurred during processing.

Error Handling

When errors occur, the response includes an error object:

{
  "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, missing parameters, invalid parameter values, API failures, and response processing errors.

Parameter Validation

  • All ID parameters must be valid PagerDuty resource IDs
  • Date parameters must be ISO8601 timestamps
  • List parameters must contain valid values
  • Required parameters cannot be None or empty strings
  • For incident statuses, only triggered, acknowledged, and resolved are valid
  • For incident urgency, only high and low are valid
  • The limit parameter restricts the number of results returned

Rate Limiting and Pagination

  • The server respects PagerDuty's rate limits
  • Pagination is handled automatically
  • The limit parameter controls the number of results returned

User Context

Many functions accept a current_user_context parameter (defaults to True), which filters results based on the current user. When this is enabled, certain filter parameters cannot be used:

  • For all resources: user_ids cannot be used with current_user_context=True
  • For incidents: team_ids and service_ids cannot be used with current_user_context=True
  • For services: team_ids cannot be used with current_user_context=True
  • For escalation policies: team_ids cannot be used with current_user_context=True
  • For on-calls: user_ids cannot be used with current_user_context=True

This feature is useful for queries like "who is currently on-call for my team?"

Example Queries

The PagerDuty MCP Server can be used to answer queries such as:

  • Are there any incidents assigned to me currently in PagerDuty?
  • Do I have any upcoming on-call schedule in the next 2 weeks?
  • Who else is a member of the personalization team?

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "pagerduty-mcp-server" '{"command":"uv","args":["run","pagerduty-mcp-server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "pagerduty-mcp-server": {
            "command": "uv",
            "args": [
                "run",
                "pagerduty-mcp-server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "pagerduty-mcp-server": {
            "command": "uv",
            "args": [
                "run",
                "pagerduty-mcp-server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later