PagerDuty MCP Server
PagerDuty MCP 서버
LLM에 PagerDuty API 기능을 제공하는 서버입니다. 이 서버는 구조화된 입력 및 출력을 통해 프로그래밍 방식으로 사용하도록 설계되었습니다.
개요
PagerDuty MCP 서버는 PagerDuty API와 상호 작용하기 위한 도구 세트를 제공합니다. 이러한 도구는 LLM이 인시던트, 서비스, 팀, 사용자 등 PagerDuty 리소스에 대한 다양한 작업을 수행하는 데 사용하도록 설계되었습니다.
Related MCP server: Logseq MCP Server
설치
PyPI에서
지엑스피1
출처에서
# Clone the repository
git clone https://github.com/wpfleger96/pagerduty-mcp-server.git
cd pagerduty-mcp-server
# Install dependencies
brew install uv
uv sync요구 사항
Python 3.13 이상
PagerDuty API 키
구성
PagerDuty MCP 서버에서는 PagerDuty API 키를 환경에 설정해야 합니다.
PAGERDUTY_API_KEY=your_api_key_here용법
구스 익스텐션으로
{
"type": "stdio",
"enabled": true,
"args": [
"run",
"python",
"-m",
"pagerduty_mcp_server"
],
"commandInput": "uv run python -m pagerduty_mcp_server",
"timeout": 300,
"id": "pagerduty-mcp-server",
"name": "pagerduty-mcp-server",
"description": "pagerduty-mcp-server",
"env_keys": [
"PAGERDUTY_API_KEY"
],
"cmd": "uv"
}독립형 서버로
uv run python -m pagerduty_mcp_server응답 형식
모든 API 응답은 일관된 형식을 따릅니다.
{
"metadata": {
"count": <int>, // Number of results
"description": "<str>" // A short summary of the results
},
<resource_type>: [ // Always pluralized for consistency, even if one result is returned
{
...
},
...
],
"error": { // Only present if there's an error
"message": "<str>", // Human-readable error description
"code": "<str>" // Machine-readable error code
}
}오류 처리
오류가 발생하면 응답에는 다음 구조의 오류 객체가 포함됩니다.
{
"metadata": {
"count": 0,
"description": "Error occurred while processing request"
},
"error": {
"message": "Invalid user ID provided",
"code": "INVALID_USER_ID"
}
}일반적인 오류 시나리오는 다음과 같습니다.
잘못된 리소스 ID(예: user_id, team_id, service_id)
필수 매개변수가 누락되었습니다
잘못된 매개변수 값
API 요청 실패
응답 처리 오류
매개변수 검증
모든 ID 매개변수는 유효한 PagerDuty 리소스 ID여야 합니다.
날짜 매개변수는 유효한 ISO8601 타임스탬프여야 합니다.
목록 매개변수(예:
statuses,team_ids)에는 유효한 값이 포함되어야 합니다.목록 매개변수의 잘못된 값은 무시됩니다.
필수 매개변수는
None또는 빈 문자열일 수 없습니다.list_incidents의statuses의 경우triggered,acknowledged및resolved만 유효한 값입니다.사건의
urgency대해서는high과low만 유효한 값입니다.limit매개변수는 목록 작업에서 반환되는 결과 수를 제한하는 데 사용할 수 있습니다.
속도 제한 및 페이지 매김
서버는 PagerDuty의 속도 제한을 준수합니다.
서버가 자동으로 페이지 매김을 처리합니다.
limit매개변수는 목록 작업에서 반환되는 결과 수를 제어하는 데 사용할 수 있습니다.제한이 지정되지 않으면 서버는 기본적으로 최대 {pagerduty_mcp_server.utils.RESPONSE_LIMIT}개의 결과를 반환합니다.
사용 예
from pagerduty_mcp_server import incidents
from pagerduty_mcp_server.utils import RESPONSE_LIMIT
# List all incidents (including resolved) for the current user's teams
incidents_list = incidents.list_incidents()
# List only active incidents
active_incidents = incidents.list_incidents(statuses=['triggered', 'acknowledged'])
# List incidents for specific services
service_incidents = incidents.list_incidents(service_ids=['SERVICE-1', 'SERVICE-2'])
# List incidents for specific teams
team_incidents = incidents.list_incidents(team_ids=['TEAM-1', 'TEAM-2'])
# List incidents within a date range
date_range_incidents = incidents.list_incidents(
since='2024-03-01T00:00:00Z',
until='2024-03-14T23:59:59Z'
)
# List incidents with a limit on the number of results
limited_incidents = incidents.list_incidents(limit=10)
# List incidents with the default limit
default_limit_incidents = incidents.list_incidents(limit=RESPONSE_LIMIT)사용자 컨텍스트
많은 함수가 current_user_context 매개변수(기본값: True )를 허용하며, 이 매개변수는 해당 컨텍스트를 기반으로 결과를 자동으로 필터링합니다. current_user_context 가 True 이면 자동 필터링과 충돌할 수 있으므로 특정 필터 매개변수를 사용할 수 없습니다.
모든 리소스 유형에 대해:
user_ids``current_user_context=True와 함께 사용할 수 없습니다.
사고의 경우:
team_ids및service_ids``current_user_context=True와 함께 사용할 수 없습니다.
서비스의 경우:
team_ids``current_user_context=True와 함께 사용할 수 없습니다.
에스컬레이션 정책의 경우:
team_ids``current_user_context=True와 함께 사용할 수 없습니다.
당직 근무자의 경우:
user_ids``current_user_context=True와 함께 사용할 수 없습니다.schedule_ids여전히 특정 일정을 필터링하는 데 사용할 수 있습니다.쿼리는 현재 사용자 팀과 관련된 모든 에스컬레이션 정책에 대한 대기 상태를 표시합니다.
이 기능은 "현재 우리 팀에서 대기 중인 사람은 누구인가?"와 같은 질문에 답하는 데 유용합니다.
현재 사용자의 ID는 필터로 사용되지 않으므로 대기 중인 모든 팀원이 표시됩니다.
개발
테스트 실행
대부분의 테스트에는 PagerDuty API에 대한 실제 연결이 필요하므로 전체 테스트 모음을 실행하기 전에 환경에서 PAGERDUTY_API_KEY 설정해야 합니다.
uv run pytest단위 테스트만 실행하려면(즉, 환경에서 PAGERDUTY_API_KEY 설정할 필요가 없는 테스트):
uv run pytest -m unit통합 테스트만 실행하려면:
uv run pytest -m integration파서 테스트만 실행하려면:
uv run pytest -m parsers특정 하위 모듈과 관련된 테스트만 실행하려면:
uv run pytest -m <client|escalation_policies|...>MCP Inspector를 사용한 디버그 서버
npx @modelcontextprotocol/inspector uv run python -m pagerduty_mcp_server기여
출시
이 프로젝트에서는 자동 릴리스를 위해 Conventional Commit을 사용합니다. 커밋 메시지에 따라 버전 상향 조정이 결정됩니다.
feat:→ 마이너 버전(1.0.0 → 1.1.0)fix:→ 패치 버전 (1.0.0 → 1.0.1)BREAKING CHANGE:→ 주요 버전(1.0.0 → 2.0.0)
CHANGELOG.md, GitHub 릴리스, PyPI 패키지는 자동으로 업데이트됩니다.
선적 서류 비치
도구 설명서 - 매개변수, 반환 유형, 예제 쿼리를 포함한 사용 가능한 도구에 대한 자세한 정보
컨벤션
모든 API 응답은 메타데이터, 리소스 목록 및 선택적 오류가 포함된 표준 형식을 따릅니다.
응답의 리소스 이름은 일관성을 위해 항상 복수형으로 표시됩니다.
단일 항목을 반환하는 모든 함수는 여전히 하나의 요소가 있는 목록을 반환합니다.
오류 응답에는 메시지와 코드가 모두 포함됩니다.
모든 타임스탬프는 ISO8601 형식입니다.
테스트는 테스트 유형(단위/통합), 테스트하는 리소스(인시던트, 팀 등), 구문 분석 기능("파서" 마커)을 테스트하는지 여부를 나타내는 pytest 마커로 표시됩니다.
Available Tools
12 toolsacknowledge_incidentB
Acknowledge a PagerDuty incident. This signals that someone is actively working on the incident.
Inputs: incident_id (required), include. Returns: object
add_incident_noteA
Add a note to a PagerDuty incident. Notes are used to record additional context, investigation progress, or resolution details.
Inputs: content (required), incident_id (required). Returns: object
build_user_contextA
Validate and build the current user's context into a dictionary with the following format: { "user_id": str, "team_ids": List[str], "service_ids": List[str], "escalation_policy_ids": List[str] } The MCP server tools use this user context to filter the following resources: - Escalation policies - Incidents - Oncalls - Services - Users
Inputs: no named parameters. Returns: object
get_escalation_policiesA
Get PagerDuty escalation policies by filters or get details for a specific policy ID.
Call patterns:
Default: omit filters (uses current user's policies/teams).
By IDs: pass
user_idsand/orteam_ids(impliescurrent_user_context=False, including overriding an explicit True).By name: pass
querywith the default context (limited to your teams/policies); do not setcurrent_user_context=Falsewith onlyquery.
Inputs: limit, query, include, team_ids, +3 more. Returns: object
get_incidentsA
Get PagerDuty incidents by filters or get details for a specific incident ID or number.
Call patterns:
List my/team incidents: omit ID filters (default
current_user_context=True).List by service/team: pass
service_idsand/orteam_ids(impliescurrent_user_context=False, including overriding an explicit True). Do not also setinclude_notes/include_past_incidents/include_related_incidentson this list call.Detail + notes: second call with only
incident_id(and optional include_* flags).Account-wide list:
all_visible=Truealone (not scoped to the current user).
Inputs: limit, since, until, include, +10 more. Returns: object
get_oncallsA
List on-call entries for schedules, policies, or time ranges.
Call patterns:
Default: omit exclusive filters (uses escalation policies the current user is a target of).
By schedule:
schedule_idsmay be used with the default context (intersection) or withcurrent_user_context=False.By user/policy IDs: pass
user_idsand/orescalation_policy_ids(impliescurrent_user_context=False, including overriding an explicit True).
Behavior varies by time parameters:
Without since/until: Returns current on-calls Example: get_oncalls(current_user_context=False, schedule_ids=["PSCHED123"])
With since/until: Returns all on-calls in range Example: get_oncalls(current_user_context=False, schedule_ids=["PSCHED123"], since="2024-03-20T00:00:00Z", until="2024-03-27T00:00:00Z")
Inputs: limit, since, until, include, +5 more. Returns: object
get_schedulesB
Get PagerDuty schedules by filters or get details for a specific schedule ID.
Inputs: limit, query, since, until, +2 more. Returns: object
get_servicesA
Get PagerDuty services by filters or get details for a specific service ID.
Call patterns:
Search by name:
query="Service Name"with the default context (omitcurrent_user_context; limited to your teams).By team: pass
team_ids(impliescurrent_user_context=False, including overriding an explicit True).Do not set
current_user_context=Falsewith onlyquery; that errors becauseteam_idsare required in False mode.
Inputs: limit, query, include, team_ids, +2 more. Returns: object
get_teamsA
Get PagerDuty teams by filters or get details for a specific team ID.
Inputs: limit, query, include, team_id. Returns: object
get_usersA
Get PagerDuty users by filters or get details for a specific user ID.
Call patterns:
Search by name:
query="Name"with the default context (omitcurrent_user_context; limited to your teams).By team: pass
team_ids(impliescurrent_user_context=False, including overriding an explicit True).Do not set
current_user_context=Falsewith onlyquery; that errors becauseteam_idsare required in False mode.
Inputs: limit, query, include, user_id, +2 more. Returns: object
list_users_oncallC
List the users on call for a schedule during the specified time range.
Inputs: schedule_id (required), since, until, include. Returns: object
resolve_incidentA
Resolve a PagerDuty incident. This marks the incident as resolved and stops any further escalations.
Inputs: incident_id (required), include. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools map cleanly to distinct PagerDuty resources or incident actions. The main ambiguity is between get_oncalls and list_users_oncall, and several get_* tools combine list and detail modes, though the descriptions make reasonable distinctions.
All tool names follow a consistent snake_case verb_noun pattern using get_, list_, acknowledge_, resolve_, add_, and build_. The use of get_ for both listing and fetching details is a minor semantic issue rather than a naming inconsistency.
Twelve tools is a well-scoped size for a PagerDuty incident-management MCP server. Each tool covers a distinct resource or action, with no obvious filler tools.
The surface covers core read operations plus acknowledge, resolve, and note actions, which supports incident triage and response. However, it lacks create/update incident operations, assignment or priority changes, and write operations for schedules, teams, and services, leaving notable lifecycle gaps.
Maintenance
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Related MCP Servers
- AlicenseBqualityDmaintenanceThis server facilitates the invocation of AI models from providers like Anthropic, OpenAI, and Groq, enabling users to manage and configure large language model interactions seamlessly.240 PyPI13MIT
- AlicenseBqualityBmaintenanceA server that enables LLMs to programmatically interact with Logseq knowledge graphs, allowing creation and management of pages and blocks.1047MIT
- AlicenseNot gradedqualityAmaintenanceA server that enables Large Language Models to discover and interact with REST APIs defined by OpenAPI specifications through the Model Context Protocol.12,706 npm302MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol Server that enables LLMs to interact with and execute REST API calls through natural language prompts, supporting GET/PUT/POST/PATCH operations on configured APIs.6Apache 2.0