PagerDuty MCP Server

PagerDuty MCP Server

Enables AI agents to interact with PagerDuty services, incidents, schedules, and on-call management through natural language.

Category
访问服务器

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

  1. Clone the repository:
git clone <repository-url>
cd pagerduty-mcp
  1. Install dependencies:
npm install
  1. 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

  1. Log in to your PagerDuty account
  2. Go to ConfigurationAPI Access
  3. Click Create New API Key
  4. Provide a description and select appropriate permissions
  5. 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 IDs
  • user_ids (array, optional): Filter by assigned user IDs
  • priority_ids (array, optional): Filter by priority IDs
  • urgencies (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 date
  • until (string, optional): Show incidents created before this ISO 8601 date

3. create_incident

Create a new PagerDuty incident.

Parameters:

  • title (string, required): Incident title
  • service_id (string, required): ID of the service
  • from (string, required): Email of the user creating the incident
  • priority_id (string, optional): Priority ID
  • urgency (string, optional): Incident urgency (high, low)
  • incident_key (string, optional): Unique key for deduplication
  • details (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 update
  • from (string, required): Email of the user making the update
  • status (string, optional): New status (acknowledged, resolved)
  • priority_id (string, optional): New priority ID
  • assignee_ids (array, optional): User IDs to assign
  • escalation_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 IDs
  • user_ids (array, optional): Filter by user IDs
  • escalation_policy_ids (array, optional): Filter by escalation policy IDs
  • since (string, optional): Show on-calls since this ISO 8601 date
  • until (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 incident
  • message (string, required): Message to send to responders
  • from (string, required): Email of the user adding responders
  • requester_id (string, required): ID of the user requesting responders
  • responder_ids (array, optional): User IDs to add as responders
  • escalation_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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

For issues and questions:

  1. Check the PagerDuty API documentation
  2. Review the error messages in the console
  3. Ensure your API token has the necessary permissions
  4. 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

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选