Module 2: GitHub Actions Integration - Starter Code
This is your starting point for Module 2. You'll extend the PR Agent from Module 1 with webhook handling and MCP Prompts.
Your Task
- Import Required Types: Add the necessary imports for MCP Prompts
- Connect to Events File: Define the path to read webhook events
- Implement GitHub Actions Tools: Complete the tools to query events
- Create MCP Prompts: Build prompts for standardized CI/CD workflows
Note: The webhook server (webhook_server.py) is provided for you!
Getting Started
Install dependencies:
bashuv syncStart the webhook server (in a separate terminal):
bashpython webhook_server.pyFollow the TODOs in
server.pyto implement Module 2 features
Testing Your Implementation
Start your server:
bashuv run server.pyIn another terminal, start Cloudflare Tunnel:
bashcloudflared tunnel --url http://localhost:8080Configure GitHub webhooks with your tunnel URL
Test with Claude Code using the new prompts
Implementation Hints
- The webhook server stores events in
github_events.json - Read the JSON file in your tools to get event data
- Prompts are simple functions that return strings with instructions
- Decorate prompt functions with
@mcp.prompt()
Need Help?
- Review the Module 2 documentation
- Check the solution in the
solution/directory - Look at the MCP documentation for Prompts: https://modelcontextprotocol.io/docs/concepts/prompts