Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Created September 25, 2025 19:36
Show Gist options
  • Select an option

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

Select an option

Save KyMidd/e135373390bac5aae8147d8d47ef298d to your computer and use it in GitHub Desktop.
PagerDuty MCP client setup for the Slack Strands agentic bot
def build_pagerduty_mcp_client(pagerduty_api_key, pagerduty_api_url):
"""Build PagerDuty MCP client with available tools"""
# Build the PagerDuty MCP client
pagerduty_mcp_client = MCPClient(
server_path="/opt/pagerduty-mcp-server",
server_args=[],
server_env={
"PAGERDUTY_API_KEY": pagerduty_api_key,
"PAGERDUTY_API_URL": pagerduty_api_url,
},
)
# List available tools from the PagerDuty MCP server
available_tools = pagerduty_mcp_client.list_tools()
print(f"🟡 Available PagerDuty MCP tools: {[tool.name for tool in available_tools]}")
# Convert MCP tools to Strands-compatible tools
pagerduty_tools = [
pagerduty_mcp_client.create_tool(tool) for tool in available_tools
]
return pagerduty_mcp_client, pagerduty_tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment