dinesh-it/pagerduty-mcp-server
If you are the rightful owner of pagerduty-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Model Context Protocol (MCP) server for integrating AI agents with PagerDuty services, incidents, schedules, and on-call management.
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