PagerDuty MCP Server
Enables AI agents to interact with PagerDuty services, incidents, schedules, and on-call management through natural language.
README
PagerDuty MCP Server
A Model Context Protocol (MCP) server for PagerDuty integration that allows AI agents to interact with PagerDuty services, incidents, schedules, and on-call management.
Features
- List Services: Browse and filter PagerDuty services
- Incident Management:
- List incidents with advanced filtering (status, assignee, priority, service, date range)
- Create new incidents
- Update incidents (acknowledge, resolve, change priority, escalate)
- Add responders to incidents
- On-Call Management: View current on-call schedules and users
- Schedule Management: List and browse schedules
Prerequisites
- Node.js v18.0.0 or higher
- A PagerDuty account with API access
- PagerDuty API token
Installation
- Clone the repository:
git clone <repository-url>
cd pagerduty-mcp
- Install dependencies:
npm install
- Build the server:
npm run build
Configuration
Environment Variables
Create a .env file in the root directory (use .env.example as a template):
# Required: Your PagerDuty API token
PAGERDUTY_API_TOKEN=your_api_token_here
# Optional: PagerDuty API URL (defaults to https://api.pagerduty.com)
PAGERDUTY_API_URL=https://api.pagerduty.com
Getting Your PagerDuty API Token
- Log in to your PagerDuty account
- Go to Configuration → API Access
- Click Create New API Key
- Provide a description and select appropriate permissions
- Copy the generated token
Usage
Running the Server
npm start
Using with Claude Desktop
Add the following configuration to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"pagerduty": {
"command": "node",
"args": ["/path/to/pagerduty-mcp/build/index.js"],
"env": {
"PAGERDUTY_API_TOKEN": "your_api_token_here",
"PAGERDUTY_API_URL": "https://api.pagerduty.com"
}
}
}
}
Available Tools
1. list_services
List PagerDuty services with optional filtering.
Parameters:
limit(number, optional): Maximum number of services to return (1-100, default: 25)offset(number, optional): Number of services to skip (default: 0)query(string, optional): Filter services by name or description
2. list_incidents
List incidents with comprehensive filtering options.
Parameters:
limit(number, optional): Maximum number of incidents (1-100, default: 25)offset(number, optional): Number of incidents to skip (default: 0)statuses(array, optional): Filter by status (triggered,acknowledged,resolved)service_ids(array, optional): Filter by service IDsuser_ids(array, optional): Filter by assigned user IDspriority_ids(array, optional): Filter by priority IDsurgencies(array, optional): Filter by urgency (high,low)sort_by(string, optional): Sort by field (incident_number,created_at,updated_at)since(string, optional): Show incidents created after this ISO 8601 dateuntil(string, optional): Show incidents created before this ISO 8601 date
3. create_incident
Create a new PagerDuty incident.
Parameters:
title(string, required): Incident titleservice_id(string, required): ID of the servicefrom(string, required): Email of the user creating the incidentpriority_id(string, optional): Priority IDurgency(string, optional): Incident urgency (high,low)incident_key(string, optional): Unique key for deduplicationdetails(string, optional): Incident body/details
4. update_incident
Update an existing incident (acknowledge, resolve, change priority, etc.).
Parameters:
incident_id(string, required): ID of the incident to updatefrom(string, required): Email of the user making the updatestatus(string, optional): New status (acknowledged,resolved)priority_id(string, optional): New priority IDassignee_ids(array, optional): User IDs to assignescalation_policy_id(string, optional): New escalation policy ID
5. list_oncalls
List current on-call schedules and users.
Parameters:
schedule_ids(array, optional): Filter by schedule IDsuser_ids(array, optional): Filter by user IDsescalation_policy_ids(array, optional): Filter by escalation policy IDssince(string, optional): Show on-calls since this ISO 8601 dateuntil(string, optional): Show on-calls until this ISO 8601 date
6. list_schedules
List PagerDuty schedules.
Parameters:
limit(number, optional): Maximum number of schedules (1-100, default: 25)offset(number, optional): Number of schedules to skip (default: 0)query(string, optional): Filter schedules by name
7. add_responders
Add responders to an existing incident.
Parameters:
incident_id(string, required): ID of the incidentmessage(string, required): Message to send to respondersfrom(string, required): Email of the user adding respondersrequester_id(string, required): ID of the user requesting respondersresponder_ids(array, optional): User IDs to add as respondersescalation_policy_ids(array, optional): Escalation policy IDs to add
Example Usage with Claude
Once configured, you can use natural language with Claude to interact with PagerDuty:
- "Show me all triggered incidents from the last 24 hours"
- "List all services that contain 'web' in their name"
- "Create a high priority incident for the API service with title 'Database Connection Issue'"
- "Who is currently on-call for the infrastructure team?"
- "Acknowledge incident #12345 and assign it to user ABC123"
- "Add responders to incident #67890 with message 'Need immediate assistance with database issue'"
Development
Build
npm run build
Development Mode (with watch)
npm run dev
Clean Build Directory
npm run clean
Error Handling
The server includes comprehensive error handling for:
- Invalid PagerDuty API tokens
- Network connectivity issues
- Invalid parameters
- PagerDuty API rate limits
- Missing required fields
All errors are properly formatted and returned as MCP-compliant error responses.
Security
- API tokens are loaded from environment variables only
- All API requests include proper authentication headers
- Input validation is performed on all parameters
- Sensitive information is never logged
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
- Check the PagerDuty API documentation
- Review the error messages in the console
- Ensure your API token has the necessary permissions
- Verify your environment configuration
Changelog
v1.0.0
- Initial release
- Full PagerDuty API integration
- MCP compliance
- Comprehensive incident management
- Service and schedule browsing
- On-call management
- Advanced filtering and search capabilities
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。