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
7 stars

The PagerDuty MCP Server enables programmatic access to PagerDuty's API functionality for LLMs, with structured inputs and outputs for managing incidents, services, teams, and users.

Installation

Prerequisites

Before installing the PagerDuty MCP Server, ensure you have:

  • Python installed
  • A valid PagerDuty API token

Setting Up the Server

  1. Initialize your Python environment:
cd pagerduty-mcp-server
brew install uv
uv sync
  1. Configure your PagerDuty API token using one of these methods:

Using an environment variable:

export PAGERDUTY_API_TOKEN=your_api_token_here

Using a .env file (Recommended):

echo "PAGERDUTY_API_TOKEN=your_api_token_here" > .env

Usage Options

Integrating with Goose Desktop

  1. Navigate to Settings > Advanced Settings > Extensions > Add custom extension
  2. Configure the extension:
    • Name: pagerduty-mcp-server
    • Type: StandardIO
    • Command: uvx pagerduty-mcp-server
  3. Save and enable the extension

Configuring with Goose CLI

Add this configuration to your Goose CLI setup:

pagerduty:
  args:
    - pagerduty-mcp-server
  bundled: null
  cmd: uvx
  description: ''
  enabled: true
  env_keys:
    - PAGERDUTY_API_TOKEN
  envs: {}
  name: pagerduty
  timeout: 300
  type: stdio

Setting Up with Claude/Cursor

Add this to your Claude/Cursor configuration:

{
  "mcpServers": {
    "pagerduty-mcp-server": {
      "command": "uvx",
      "args": ["pagerduty-mcp-server"],
      "env": {
          "PAGERDUTY_API_TOKEN": "<YOUR_PAGERDUTY_API_TOKEN>"
      }
    }
  }
}

Running as Standalone Server

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

Response Format and Features

Standard Response Structure

All API responses follow this format:

{
  "metadata": {
    "count": 2,
    "description": "List of incidents"
  },
  "incidents": [
    {
      "id": "ABC123",
      "title": "Example incident"
    },
    {
      "id": "XYZ456",
      "title": "Another incident"
    }
  ]
}

Error Response Format

When errors occur, you'll receive a response like:

{
  "metadata": {
    "count": 0,
    "description": "Error occurred while processing request"
  },
  "error": {
    "message": "Invalid user ID provided",
    "code": "INVALID_USER_ID"
  }
}

Parameter Validation

The server enforces these validation rules:

  • ID parameters must be valid PagerDuty resource IDs
  • Date parameters must be valid ISO8601 timestamps
  • List parameters must contain valid values
  • Required parameters cannot be empty
  • Status values must be one of: triggered, acknowledged, or resolved
  • Urgency values must be either high or low

User Context

Many functions support a current_user_context parameter (default: True) which filters results based on the current user. When enabled, certain filter parameters cannot be used:

  • user_ids conflicts with current_user_context=True for all resources
  • For incidents, team_ids and service_ids cannot be used with current_user_context=True
  • For services and escalation policies, team_ids cannot be used with current_user_context=True

Example Queries

You can use the PagerDuty MCP Server to answer questions like:

  • 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