How to Add PagerDuty MCP to Claude Code

2 min read.
Tags: ai

If you just need the command:

claude-olx mcp add pagerduty -e PAGERDUTY_USER_API_KEY=YOUR_PAGERDUTY_API_KEY -- uvx pagerduty-mcp

Replace YOUR_PAGERDUTY_API_KEY with your PagerDuty User API Key. You can generate one from PagerDuty → User Settings → User Token REST API Keys.

The -e flag passes the key as an environment variable to the MCP server process. The -- separates Claude Code flags from the command that runs the server. uvx pagerduty-mcp fetches and runs the PagerDuty MCP package without a separate install step.

What PagerDuty MCP gives Claude

Claude can list incidents, check on-call schedules, view services, and look up escalation policies directly in your conversation. Useful when you want Claude to help triage an incident without manually copying context from PagerDuty.

Get a User API Key first

  1. Log into PagerDuty
  2. Go to your Profile → User Settings
  3. Scroll to User Token REST API Keys
  4. Click Create API User Token
  5. Copy the key — you only see it once

Verify it is active

claude-olx mcp list

pagerduty should appear. Restart Claude Code if it is not showing.

Test it:

What are the open incidents in PagerDuty?

If Claude returns incident data, it is connected.

Prerequisite: UV must be installed

The server runs via uvx, which is part of the UV Python package manager. Install it if you have not already:

brew install uv
# or
pip install uv

Conclusion

The PagerDuty MCP uses uvx to run a Python-based server. Pass your User API Key with -e, and Claude gets direct read access to your PagerDuty account in any conversation.

Related Posts