Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created August 24, 2025 13:28
Show Gist options
  • Select an option

  • Save KyMidd/4deae867281f139acfdd2d89f5df433a to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/4deae867281f139acfdd2d89f5df433a to your computer and use it in GitHub Desktop.
# User question to start
user_question = "Find all active issues over the last 4 hours, find critical outages, and research potential code changes that caused those issues."
# Build PagerDuty MCP
def build_pagerduty_mcp_client():
"""Build and return a PagerDuty MCP client."""
return MCPClient(lambda: stdio_client(
StdioServerParameters(
command="uv",
args=[
"run",
"--directory",
"/Users/kyler/git/GitHub/PagerDuty/pagerduty-mcp-server",
"python",
"-m",
"pagerduty_mcp"
#"--enable-write-tools" # This flag enables write operations on the MCP Server enabling you to create issues, pull requests, etc.
],
env={
"PAGERDUTY_HOST": "https://api.my_company.pagerduty.com",
"PAGERDUTY_USER_API_KEY": os.getenv("PAGERDUTY_USER_API_KEY")
},
)
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment