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.
Before installing the PagerDuty MCP Server, ensure you have:
cd pagerduty-mcp-server
brew install uv
uv sync
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
pagerduty-mcp-server
uvx pagerduty-mcp-server
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
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>"
}
}
}
}
uv run path/to/repo/pagerduty-mcp-server/.venv/bin/pagerduty-mcp-server
All API responses follow this format:
{
"metadata": {
"count": 2,
"description": "List of incidents"
},
"incidents": [
{
"id": "ABC123",
"title": "Example incident"
},
{
"id": "XYZ456",
"title": "Another incident"
}
]
}
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"
}
}
The server enforces these validation rules:
triggered
, acknowledged
, or resolved
high
or low
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 resourcesteam_ids
and service_ids
cannot be used with current_user_context=True
team_ids
cannot be used with current_user_context=True
You can use the PagerDuty MCP Server to answer questions like:
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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