Skip to main content
This guide will help you quickly set up the PagerDuty MCP Server and start using it with VS Code.

Prerequisites

Before you begin, you’ll need:
  1. Python 3.12 installed on your system
  2. A PagerDuty account with access to create API tokens
  3. An MCP-enabled client (we’ll use VS Code in this guide)

Create a PagerDuty User API Token

The PagerDuty MCP Server requires a User API Token to authenticate with your account.
1

Navigate to User Settings

Click on your user profile icon in PagerDuty, then select My ProfileUser Settings.
For Freemium accounts, permissions for generating User API tokens are limited to the user role as defined in the PagerDuty documentation.
2

Access the API Access section

In your user settings, locate the API Access section.
3

Create the token

Click the Create API User Token button and follow the prompts to generate a new token.
4

Save the token securely

Copy the generated token and store it securely. You’ll need this token in the next steps.
Keep your API token secure! It has the same permissions as your user account. Never commit it to version control or share it publicly.
Use of the PagerDuty User API Token is subject to the PagerDuty Developer Agreement.

Installation

The easiest way to use the PagerDuty MCP Server is via uvx, which automatically manages the Python environment:
uvx pagerduty-mcp
That’s it! The uvx command will download and run the server without requiring manual installation.
For other installation methods (pip, from source), see the Installation Guide.

Configure VS Code

Now let’s configure VS Code to use the PagerDuty MCP Server.
1

Install VS Code with MCP support

Ensure you’re using a recent version of VS Code that supports MCP.
2

Open VS Code Settings

Open VS Code settings:
  • macOS: Cmd+,
  • Windows/Linux: Ctrl+,
Or go to FilePreferencesSettings
3

Enable MCP

Search for “mcp” and ensure “Mcp: Enabled” is checked under FeaturesChat.
4

Configure the server

Click “Edit in settings.json” under “Mcp > Discovery: Servers”.Add the following configuration to your settings.json:
settings.json
{
    "mcp": {
        "inputs": [
            {
                "type": "promptString",
                "id": "pagerduty-api-key",
                "description": "PagerDuty API Key",
                "password": true
            }
        ],
        "servers": {
            "pagerduty-mcp": { 
                "type": "stdio",
                "command": "uvx",
                "args": [
                    "pagerduty-mcp"
                ],
                "env": {
                    "PAGERDUTY_USER_API_KEY": "${input:pagerduty-api-key}",
                    "PAGERDUTY_API_HOST": "https://api.pagerduty.com"
                }
            }
        }
    }
}
If your PagerDuty account is in the EU region, update PAGERDUTY_API_HOST to https://api.eu.pagerduty.com
5

Restart VS Code

Restart VS Code for the changes to take effect.

Try Your First Command

Now let’s test the integration!
1

Open VS Code Chat

Open the Chat view in VS Code:
  • Go to ViewChat
  • Or use the keyboard shortcut
2

Enable Agent mode

Make sure Agent mode is selected in the Chat view. You can enable or disable specific tools by clicking the 🛠️ icon.
3

Enter your API key

When prompted, enter the PagerDuty API token you created earlier.
4

Run a command

Try one of these example commands:
Show me the latest incident
Who is on-call right now?
List my event orchestrations
The PagerDuty MCP Server will use the appropriate tools to fetch the information from your PagerDuty account.
By default, the server runs in read-only mode, so you can safely query your PagerDuty data without risk of accidental changes.

Enable Write Operations (Optional)

To enable write operations like creating incidents or schedule overrides, add the --enable-write-tools flag to your configuration:
settings.json
{
    "mcp": {
        "servers": {
            "pagerduty-mcp": { 
                "type": "stdio",
                "command": "uvx",
                "args": [
                    "pagerduty-mcp",
                    "--enable-write-tools"  // Add this line
                ],
                "env": {
                    "PAGERDUTY_USER_API_KEY": "${input:pagerduty-api-key}",
                    "PAGERDUTY_API_HOST": "https://api.pagerduty.com"
                }
            }
        }
    }
}
Write operations can modify your PagerDuty account. Use this flag carefully and ensure you understand what each command will do before confirming.
With write tools enabled, you can:
  • Create incidents: Create a new incident for the API service
  • Add notes: Add a note to incident #123 saying "Still investigating"
  • Create schedule overrides: Override the on-call schedule for tomorrow
  • Manage teams: Add [email protected] to the platform team
  • And much more!

Managing the Server

You can manage your MCP servers using the VS Code command palette:
  1. Open the command palette (Cmd+Shift+P or Ctrl+Shift+P)
  2. Search for “MCP: List Servers”
  3. You’ll see the PagerDuty MCP Server listed
  4. You can start, stop, or restart the server from here
If you encounter any issues, try restarting the server from the command palette.

Next Steps

You’re all set! Here are some resources to help you get the most out of the PagerDuty MCP Server:

Installation Guide

Explore other installation methods and troubleshooting

Available Tools

Browse all 60+ available tools

Other Clients

Configure Cursor, Claude Desktop, and other clients

Usage Guides

Learn common workflows and best practices

Build docs developers (and LLMs) love