Minimal CLI client for PagerDuty's hosted MCP server — no LLM required. Connects to mcp.pagerduty.com via streamable HTTP transport with token auth. Lists available MCP tools and calls them with JSON arguments.
pip install mcp
export PAGERDUTY_USER_API_KEY="u+your-token-here"# List all available tools
python3 getdata.py
# Call a tool with default arguments
python3 getdata.py list_incidents '{"query_model": {}}'
python3 getdata.py list_services '{"query_model": {}}'
# Call a tool with specific arguments
python3 getdata.py get_incident '{"incident_id": "Q1EBPJVK2KASMY"}'
python3 getdata.py list_oncalls '{"query_model": {}}'| Variable | Required | Default | Description |
|---|---|---|---|
PAGERDUTY_USER_API_KEY |
Yes | — | PagerDuty user API token (format: u+...) |
PAGERDUTY_MCP_URL |
No | https://mcp.pagerduty.com/mcp |
MCP server endpoint |
| Endpoint | Tools | Purpose |
|---|---|---|
https://mcp.pagerduty.com/mcp (default) |
64 CRUD tools | Direct PagerDuty API operations — incidents, services, schedules, teams, escalation policies, event orchestrations, status pages |
https://mcp.pagerduty.com/pagerduty-advance-mcp |
4 AI agent tools | SRE agent, insights/analytics, scheduling/on-call agents |
The Advance endpoint exposes four AI-powered agent tools:
sre_agent_tool— Incident response and root cause analysisinsights_agent_tool— Historical reporting and trend analysisshift_agent_find_coverage_tool— Find replacement on-call coverageshift_agent_on_call_questions_and_conflicts_tool— Scheduling and on-call queries
export PAGERDUTY_MCP_URL='https://mcp.pagerduty.com/pagerduty-advance-mcp'
# List the 4 Advance tools
python3 getdata.py
# Analyze an incident (requires incident_id + message)
python3 getdata.py sre_agent_tool \
'{"message": "What happened and what was the root cause?", "incident_id": "Q1EBPJVK2KASMY"}'The SRE agent returns structured markdown with:
- Incident description and categorization
- Root cause analysis
- Pattern detection across past incidents
- Recommended next steps
Single Python script (getdata.py) using:
mcp.client.streamable_http.streamablehttp_clientfor transportmcp.ClientSessionfor the MCP protocol layer- Header-based auth:
Authorization: Token token={key}
Each operation (list tools, call tool) creates a fresh session.