How to Add PagerDuty MCP to Claude Code

4 min read.
Tags: ai

If you came here for the command, use this.

Quick command

claude mcp add --transport stdio --env PAGERDUTY_USER_API_KEY=YOUR_PAGERDUTY_USER_API_KEY pagerduty -- uvx pagerduty-mcp

Replace YOUR_PAGERDUTY_USER_API_KEY with a PagerDuty User API Key. The alias is pagerduty, so that is the name you will see in claude mcp list and /mcp.

This command runs the PagerDuty MCP server locally through uvx. Claude Code starts the server over stdio, passes your token as an environment variable, and then talks to PagerDuty through that local process.

If uvx is not installed yet:

brew install uv
# or
pip install uv

Get a PagerDuty token

Create a User API Key before adding the MCP server:

  1. Log in to PagerDuty.
  2. Open Profile -> User Settings.
  3. Go to User Token REST API Keys.
  4. Create a new API user token.
  5. Copy it somewhere safe. PagerDuty only shows it once.

Treat the token like a password. Do not paste it into a repo, issue, screenshot, or shared Claude transcript.

What Claude can do with PagerDuty

Once it is connected, Claude Code can use PagerDuty context without you copying incident details by hand. Common asks are:

  • list open incidents
  • inspect incident details
  • check who is on call
  • look up escalation policies
  • inspect services and teams

The local server is read-only by default. That is the right starting point for most setups because Claude can help investigate without being able to change PagerDuty state.

Verify the setup

After adding the server, check that Claude Code registered it:

claude mcp list

Inside Claude Code, you can also run:

/mcp

The pagerduty server should show up there. If it does not, restart Claude Code and check again.

Then ask a small PagerDuty question:

What are the open incidents in PagerDuty?

If Claude returns your PagerDuty data, the setup worked. If it connects but comes back empty, check the token user first. The command may be fine, but the user behind the token may not have access to the incidents, services, teams, or schedules you asked about.

EU accounts

For PagerDuty EU accounts, pass the EU API host as another environment variable:

claude mcp add --transport stdio \
  --env PAGERDUTY_USER_API_KEY=YOUR_PAGERDUTY_USER_API_KEY \
  --env PAGERDUTY_API_HOST=https://api.eu.pagerduty.com \
  pagerduty -- uvx pagerduty-mcp

If your server connects but cannot find data you know exists, the API host is one of the first things to check.

Optional: allow write tools

PagerDuty MCP can expose write tools, but you have to opt in. Only do this if you are comfortable letting Claude Code create or update PagerDuty resources from your session.

claude mcp add --transport stdio \
  --env PAGERDUTY_USER_API_KEY=YOUR_PAGERDUTY_USER_API_KEY \
  pagerduty -- uvx pagerduty-mcp --enable-write-tools

For incident response, I would start read-only and add write tools later if the workflow actually needs them.

Optional: use PagerDuty's hosted MCP server

PagerDuty also offers a hosted MCP endpoint. Use this when you do not want Claude Code to run a local Python package with uvx.

export PAGERDUTY_API_KEY=YOUR_PAGERDUTY_USER_API_KEY

claude mcp add-json pagerduty \
  '{"type":"http","url":"https://mcp.pagerduty.com/mcp","headers":{"Authorization":"Token token=${PAGERDUTY_API_KEY}"}}'

For EU accounts, use:

https://mcp.eu.pagerduty.com/mcp

The hosted setup needs PAGERDUTY_API_KEY in the environment where Claude Code starts. If you only export it in one terminal tab, Claude Code launched somewhere else may not see it.

Troubleshooting

If uvx is missing, install uv and run the add command again.

If pagerduty appears in claude mcp list but Claude Code cannot use it, restart Claude Code.

If tool calls return authorization errors, create a fresh User API Key and confirm that the PagerDuty user has access to the data you are asking for.

If EU data is missing, confirm that you used PAGERDUTY_API_HOST=https://api.eu.pagerduty.com for the local server or the EU hosted endpoint for the remote server.

If the setup flow changes, follow PagerDuty's docs. MCP support is moving quickly enough that small command details can change.

References

Final check

Most setups should start with the local uvx command and a read-only User API Key. Add the EU host only if your account is in PagerDuty EU, and enable write tools only when you have a clear reason.