PagerDuty MCP Server
Enables AI assistants to manage PagerDuty incidents, view alerts, and check on-call schedules with both read-only and write operations.
README
PagerDuty MCP Server
Model Context Protocol server for PagerDuty incident management
Integrate PagerDuty with AI assistants (Claude Desktop, Claude Code) for intelligent incident management and on-call support.
🎯 Features
Incident Management (9 Tools)
list_incidents- List incidents with filters (status, urgency, team)get_incident- Get detailed incident informationget_my_incidents- Get incidents assigned to youacknowledge_incident- Mark incident as acknowledgedresolve_incident- Resolve incident with notesadd_incident_note- Add investigation notesget_incident_alerts- Get all alerts for an incidentget_incident_timeline- View incident activity historyget_oncall- Check current on-call schedules
Read-Only by Default
- List, query, and analyze incidents
- View alerts and timelines
- Check on-call schedules
Write Operations (Controlled)
- Acknowledge/resolve incidents (requires confirmation)
- Add investigation notes
- Secure: Uses From-email header for audit trail
🚀 Quick Start
Prerequisites
- Python 3.10+
- PagerDuty account with API access
- Claude Desktop or Claude Code
1. Get PagerDuty API Token
- Login to PagerDuty: https://your-company.pagerduty.com
- User Icon → My Profile
- User Settings → API Access
- Click "Create API User Token"
- Description:
MCP-Integration - Copy token (starts with
u+ory1_)
2. Install Dependencies
cd pagerduty-mcp-server
# Using uv (recommended)
uv sync
# Or using pip
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -e .
3. Set Environment Variable
# Linux/macOS
export PAGERDUTY_API_TOKEN="u+your-token-here"
# Or add to ~/.bashrc
echo 'export PAGERDUTY_API_TOKEN="u+your-token-here"' >> ~/.bashrc
source ~/.bashrc
4. Test the Server
# Run server (stdio mode)
uv run python main.py
# Or with pip
python main.py
⚙️ MCP Configuration
Claude Desktop
Config file: ~/.config/mcp/mcpServers.json (Linux) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS)
{
"mcpServers": {
"pagerduty": {
"command": "uv",
"args": [
"--directory",
"/path/to/pagerduty-mcp-server",
"run",
"python",
"main.py"
],
"env": {
"PAGERDUTY_API_TOKEN": "${PAGERDUTY_API_TOKEN}"
}
}
}
}
Claude Code (VS Code)
Config file: ~/.config/Code/User/mcp.json
{
"mcpServers": {
"pagerduty": {
"command": "uv",
"args": [
"--directory",
"/path/to/pagerduty-mcp-server",
"run",
"python",
"main.py"
],
"env": {
"PAGERDUTY_API_TOKEN": "${PAGERDUTY_API_TOKEN}"
}
}
}
}
Restart Claude Desktop/Code after config changes.
📚 Tool Usage Examples
List Active Incidents
"List all triggered PagerDuty incidents"
Claude will use: list_incidents(status="triggered")
Check Your Incidents
"Show me my assigned PagerDuty incidents"
Claude will use: get_my_incidents()
Investigate Incident
"Get details for PagerDuty incident Q26N8MQQHA6R0P"
Claude will use: get_incident(incident_id="Q26N8MQQHA6R0P")
View Alerts
"Show all alerts for this incident"
Claude will use: get_incident_alerts(incident_id="...")
Acknowledge Incident
"Acknowledge incident Q26N8MQQHA6R0P with note: Investigating database slowdown"
Claude will use: acknowledge_incident(incident_id="...", note="Investigating database slowdown")
Check On-Call
"Who is on-call right now?"
Claude will use: get_oncall()
🔧 Advanced Configuration
Environment Variables
| Variable | Required | Description |
|---|---|---|
PAGERDUTY_API_TOKEN |
Yes | API User Token from PagerDuty |
PYTHONUNBUFFERED |
No | Set to 1 for proper logging (recommended) |
Custom Filters
# List high-urgency triggered incidents
list_incidents(status="triggered", urgency="high", limit=50)
# List incidents for specific team
list_incidents(team_ids=["P5KZERF"], status="acknowledged")
🛠️ Development
Project Structure
pagerduty-mcp-server/
├── main.py # Entry point
├── src/
│ ├── server_mcp.py # MCP server with 9 tools
│ └── helpers/
│ ├── pagerduty_client.py # Async API client
│ ├── utils.py # Formatting utilities
│ └── constants.py # API constants
├── pyproject.toml
├── uv.lock
└── README.md
Adding New Tools
- Implement in
src/server_mcp.py - Add helper functions to
src/helpers/if needed - Test with Claude
📖 API Reference
Incident Statuses
triggered- New incident, not acknowledgedacknowledged- Someone is working on itresolved- Incident fixed
Urgencies
high- High urgency (pages on-call)low- Low urgency (notification only)
Common Fields
incident_id- PagerDuty incident ID (e.g.,Q26N8MQQHA6R0P)incident_number- Human-readable number (e.g.,2914407)service- Affected serviceassigned_to- List of assigned usershtml_url- Link to incident in PagerDuty web UI
🔒 Security
API Token Security
- ✅ Store token in environment variable (NOT in code)
- ✅ Use
.gitignoreto prevent token commits - ✅ Token has same permissions as your PagerDuty user
- ✅ Audit trail: All actions logged with your email
Read-Only Tools
Safe to use without confirmation:
list_incidentsget_incidentget_my_incidentsget_incident_alertsget_incident_timelineget_oncall
Write Tools (Require Confirmation)
acknowledge_incident- Marks incident as acknowledgedresolve_incident- Closes incidentadd_incident_note- Adds investigation notes
🐛 Troubleshooting
"Missing PAGERDUTY_API_TOKEN"
# Check environment variable
echo $PAGERDUTY_API_TOKEN
# If empty, set it
export PAGERDUTY_API_TOKEN="u+your-token-here"
source ~/.bashrc
"Authentication failed"
- Token expired or invalid
- Get new token from PagerDuty User Settings
- Verify token starts with
u+ory1_
"No incidents found"
- Check filters (status, urgency)
- Verify you have access to incidents
- Try without filters:
list_incidents(limit=10)
MCP Server Not Loading
- Restart Claude Desktop/Code
- Check config file path
- Verify
uvis installed:uv --version - Check logs:
tail -f ~/.config/Claude/logs/mcp*.log
🎯 Use Cases
1. Morning Incident Check
"Show me all active PagerDuty incidents from the last 24 hours"
2. On-Call Handoff
"Who is currently on-call? Show all open incidents."
3. Incident Investigation
"Get incident Q26N8MQQHA6R0P details, alerts, and timeline"
4. Alert Analysis
"Show all alerts for incident XYZ and summarize the root cause"
5. Team Status
"List all triggered incidents for my team"
🚀 Integration with ServiceNow (Future)
Planned feature: Create ServiceNow incidents from PagerDuty alerts
PagerDuty Incident
↓
Claude AI (parses alert)
↓
ServiceNow MCP (create incident)
↓
Link PagerDuty ↔ ServiceNow
🤝 Contributing
See CONTRIBUTING.md.
📄 License
Apache License 2.0 - see LICENSE file.
Last updated: 2026-03-11
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。