PagerDuty MCP Server
PagerDuty MCP サーバー
PagerDuty API機能をLLMに公開するサーバー。このサーバーは、構造化された入出力を用いてプログラム的に使用できるように設計されています。
概要
PagerDuty MCPサーバーは、PagerDuty APIと連携するためのツールセットを提供します。これらのツールは、LLMがインシデント、サービス、チーム、ユーザーなどのPagerDutyリソースに対してさまざまな操作を実行するために使用できるように設計されています。
Related MCP server: Logseq MCP Server
インストール
PyPIから
pip install pagerduty-mcp-serverソースから
# 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の場合、自動フィルタリングと競合するため、特定のフィルタパラメータは使用current_user_contextません。
すべてのリソース タイプの場合:
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 Commitsを使用しています。コミットメッセージによってバージョンアップが決定されます。
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レスポンスは、メタデータ、リソースリスト、およびオプションのエラーを含む標準形式に従います。
応答内のリソース名は一貫性を保つために常に複数形になります
単一の項目を返すすべての関数は、1つの要素を持つリストを返します。
エラー応答にはメッセージとコードの両方が含まれます
すべてのタイムスタンプはISO8601形式です
テストには、そのタイプ(ユニット/統合)、テスト対象のリソース(インシデント、チームなど)、解析機能をテストするかどうか(「パーサー」マーカー)を示す pytest マーカーが付けられます。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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.213MIT
- AlicenseBqualityBmaintenanceA server that enables LLMs to programmatically interact with Logseq knowledge graphs, allowing creation and management of pages and blocks.1039MIT
- Alicense-qualityAmaintenanceA server that enables Large Language Models to discover and interact with REST APIs defined by OpenAPI specifications through the Model Context Protocol.4,812286MIT
- Alicense-qualityDmaintenanceA 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
Related MCP Connectors
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/wpfleger96/pagerduty-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server