|
| 1 | +# Unit 3 Implementation Plan: Advanced MCP Development |
| 2 | + |
| 3 | +## Overview |
| 4 | +This document outlines the implementation plan for Unit 3: Building Custom Workflow Servers for Claude Code. This unit bridges the gap between basic MCP concepts (Units 1-2) and production deployment (Unit 4). |
| 5 | + |
| 6 | +## Core Philosophy: Local "Toy" to Production Pipeline |
| 7 | + |
| 8 | +**Unit 3**: Build it locally, see it work (focus on workflow logic) |
| 9 | +**Unit 4**: Ship it to production (add auth, deploy globally, handle real traffic) |
| 10 | + |
| 11 | +## Module Structure: Jump-in Anywhere Design |
| 12 | + |
| 13 | +Each module provides complete working solutions that serve as starting points for subsequent modules, allowing learners to begin at any point in the unit. |
| 14 | + |
| 15 | +### Module 1: Basic Workflow Server (30 min) |
| 16 | +**Learning Goal**: "I want Claude Code to help me create better PRs" |
| 17 | + |
| 18 | +**What Learners Build**: |
| 19 | +- Minimal MCP server with PR template suggestion |
| 20 | +- Simple rule-based template selection (file extension → template type) |
| 21 | +- Working Claude Code integration |
| 22 | + |
| 23 | +**Starter Code**: Empty MCP template |
| 24 | +**End State**: Working PR template suggester |
| 25 | +**For Unit 4**: Perfect base for Cloudflare Workers deployment |
| 26 | + |
| 27 | +**Key Files**: |
| 28 | +``` |
| 29 | +/examples/unit3-module1-solution/ |
| 30 | +├── server.py (or server.js) |
| 31 | +├── mcp_config.json |
| 32 | +└── templates/ |
| 33 | + ├── bug.md |
| 34 | + ├── feature.md |
| 35 | + └── docs.md |
| 36 | +``` |
| 37 | + |
| 38 | +### Module 2: Smart File Analysis (45 min) |
| 39 | +**Learning Goal**: "Make template selection actually intelligent" |
| 40 | + |
| 41 | +**What Learners Build**: |
| 42 | +- Context-aware file analysis (not just extensions) |
| 43 | +- Pattern matching logic (tests → test template, config → ops template) |
| 44 | +- Multi-file change analysis |
| 45 | + |
| 46 | +**Starter Code**: Module 1 solution |
| 47 | +**End State**: Intelligent template selection |
| 48 | +**For Unit 4**: Core logic ready for remote deployment |
| 49 | + |
| 50 | +**New Concepts**: |
| 51 | +- File content analysis |
| 52 | +- Pattern recognition |
| 53 | +- Business logic separation |
| 54 | + |
| 55 | +### Module 3: GitHub Actions Integration (45 min) |
| 56 | +**Learning Goal**: "Tell me when my tests pass/fail" |
| 57 | + |
| 58 | +**What Learners Build**: |
| 59 | +- Local webhook receiver using Cloudflare Tunnel |
| 60 | +- GitHub Actions event parsing |
| 61 | +- Real-time CI/CD status in Claude Code |
| 62 | + |
| 63 | +**Starter Code**: Module 2 solution |
| 64 | +**End State**: Live CI/CD monitoring |
| 65 | +**For Unit 4**: Key feature that benefits from remote hosting |
| 66 | + |
| 67 | +**Technology Choice**: Cloudflare Tunnel (not ngrok) |
| 68 | +- **Why**: Seamless Unit 4 transition, better security, preview-optimized |
| 69 | +- **Bonus**: Uses Cloudflare preview feature for instant public URLs |
| 70 | +- **Educational**: Builds familiarity with Cloudflare ecosystem |
| 71 | + |
| 72 | +### Module 4: Team Communication (30 min) |
| 73 | +**Learning Goal**: "Update my team automatically" |
| 74 | + |
| 75 | +**What Learners Build**: |
| 76 | +- Slack webhook integration for notifications |
| 77 | +- Smart message formatting based on CI results |
| 78 | +- Fallback options for free-tier users (console/file output) |
| 79 | + |
| 80 | +**Starter Code**: Module 3 solution |
| 81 | +**End State**: Complete workflow automation |
| 82 | +**For Unit 4**: Ready for OAuth-protected remote deployment |
| 83 | + |
| 84 | +### Module 5: Polish & Claude Code Integration (30 min) |
| 85 | +**Learning Goal**: "Make it production-ready (locally)" |
| 86 | + |
| 87 | +**What Learners Build**: |
| 88 | +- Error handling and logging |
| 89 | +- Configuration management |
| 90 | +- Complete Claude Code workflow demonstration |
| 91 | + |
| 92 | +**Starter Code**: Module 4 solution |
| 93 | +**End State**: Unit 4-ready codebase |
| 94 | +**For Unit 4**: Seamless transition to remote deployment |
| 95 | + |
| 96 | +## Unit 3 → Unit 4 Transition Strategy |
| 97 | + |
| 98 | +### Shared Codebase Approach |
| 99 | +- Unit 3 final solution becomes Unit 4 starter template |
| 100 | +- Same workflow logic, different deployment model |
| 101 | +- Learners see immediate value of productionizing their work |
| 102 | + |
| 103 | +### Knowledge Bridge |
| 104 | +| Unit 3 (Local) | Unit 4 (Production) | |
| 105 | +|----------------|-------------------| |
| 106 | +| Local MCP server | Cloudflare Workers deployment | |
| 107 | +| Cloudflare Tunnel | Native Cloudflare hosting | |
| 108 | +| File-based config | Environment variables | |
| 109 | +| Development webhooks | Production webhook security | |
| 110 | +| Direct Claude Code connection | `mcp-remote` client adapter | |
| 111 | + |
| 112 | +### Natural Progression Points |
| 113 | +1. **Security**: "My webhook is public, how do I protect it?" → OAuth |
| 114 | +2. **Reliability**: "What if my laptop is off?" → Remote hosting |
| 115 | +3. **Scale**: "What about multiple team members?" → Shared deployment |
| 116 | +4. **Maintenance**: "How do I update this?" → CI/CD deployment |
| 117 | + |
| 118 | +## Repository Structure |
| 119 | + |
| 120 | +``` |
| 121 | +/examples/ |
| 122 | +├── unit3-module1-solution/ # Basic workflow server |
| 123 | +├── unit3-module2-solution/ # Smart file analysis |
| 124 | +├── unit3-module3-solution/ # GitHub Actions integration |
| 125 | +├── unit3-module4-solution/ # Team communication |
| 126 | +├── unit3-final-solution/ # Complete local server |
| 127 | +└── unit4-starter/ # Unit 3 final → Unit 4 starting point |
| 128 | +``` |
| 129 | + |
| 130 | +## Free-Tier Compatibility |
| 131 | + |
| 132 | +### Core Features (Always Free) |
| 133 | +- Local MCP server development |
| 134 | +- Cloudflare Tunnel for webhooks |
| 135 | +- Basic GitHub Actions integration |
| 136 | +- File-based team notifications |
| 137 | + |
| 138 | +### Upgrade Paths |
| 139 | +- Slack integration (free Slack workspaces) |
| 140 | +- Enhanced GitHub Actions (public repos) |
| 141 | +- Advanced notifications (email fallbacks) |
| 142 | + |
| 143 | +### Unit 4 Preparation |
| 144 | +- All Unit 3 code runs on Cloudflare free tier |
| 145 | +- No premium services required for core functionality |
| 146 | +- Optional features clearly marked |
| 147 | + |
| 148 | +## Interactive Learning Elements |
| 149 | + |
| 150 | +### Quiz Contribution Areas for @burtenshaw |
| 151 | + |
| 152 | +#### Module 1 Quizzes: MCP Server Fundamentals |
| 153 | +**Focus Areas**: |
| 154 | +- MCP protocol understanding |
| 155 | +- Client-server communication patterns |
| 156 | +- Tool registration and discovery |
| 157 | +- Configuration management |
| 158 | + |
| 159 | +**Sample Question Types**: |
| 160 | +- "Which MCP method is used for tool discovery?" |
| 161 | +- "How does Claude Code connect to MCP servers?" |
| 162 | +- "What's the difference between tools and resources in MCP?" |
| 163 | + |
| 164 | +#### Module 2 Quizzes: Logic & Pattern Recognition |
| 165 | +**Focus Areas**: |
| 166 | +- File analysis strategies |
| 167 | +- Business logic separation |
| 168 | +- Pattern matching concepts |
| 169 | +- Error handling in analysis |
| 170 | + |
| 171 | +**Sample Question Types**: |
| 172 | +- "How would you detect if a change is test-related?" |
| 173 | +- "What file patterns indicate a configuration change?" |
| 174 | +- "When should template selection fallback to defaults?" |
| 175 | + |
| 176 | +#### Module 3 Quizzes: Integration & Webhooks |
| 177 | +**Focus Areas**: |
| 178 | +- Webhook security concepts |
| 179 | +- GitHub Actions event types |
| 180 | +- Network tunneling basics |
| 181 | +- Event-driven architecture |
| 182 | + |
| 183 | +**Sample Question Types**: |
| 184 | +- "What GitHub Actions events trigger on PR completion?" |
| 185 | +- "How does Cloudflare Tunnel maintain security?" |
| 186 | +- "What's the difference between push and workflow_run events?" |
| 187 | + |
| 188 | +#### Module 4 Quizzes: Team Workflows |
| 189 | +**Focus Areas**: |
| 190 | +- Team communication patterns |
| 191 | +- Notification strategies |
| 192 | +- Fallback mechanisms |
| 193 | +- Workflow integration |
| 194 | + |
| 195 | +**Sample Question Types**: |
| 196 | +- "When should automated notifications be sent?" |
| 197 | +- "How do you handle notification failures?" |
| 198 | +- "What information is most valuable in CI/CD alerts?" |
| 199 | + |
| 200 | +#### Module 5 Quizzes: Production Readiness |
| 201 | +**Focus Areas**: |
| 202 | +- Error handling strategies |
| 203 | +- Configuration management |
| 204 | +- Monitoring and debugging |
| 205 | +- Performance considerations |
| 206 | + |
| 207 | +**Sample Question Types**: |
| 208 | +- "What configuration should never be hardcoded?" |
| 209 | +- "How do you debug MCP server connectivity issues?" |
| 210 | +- "What logs are essential for troubleshooting?" |
| 211 | + |
| 212 | +#### Unit 3 → Unit 4 Bridge Quiz |
| 213 | +**Focus Areas**: |
| 214 | +- Local vs remote deployment trade-offs |
| 215 | +- Security model differences |
| 216 | +- Scalability considerations |
| 217 | +- DevOps pipeline concepts |
| 218 | + |
| 219 | +**Sample Question Types**: |
| 220 | +- "Why might you choose remote deployment over local?" |
| 221 | +- "What security concerns arise with public webhook endpoints?" |
| 222 | +- "How does team collaboration change with remote servers?" |
| 223 | + |
| 224 | +### Hands-On Exercises |
| 225 | +- **Module Checkpoints**: "Quick Check" after each module |
| 226 | +- **Integration Tests**: End-to-end workflow verification |
| 227 | +- **Customization Challenges**: "Adapt this for your team's workflow" |
| 228 | +- **Troubleshooting Labs**: Common problems and solutions |
| 229 | + |
| 230 | +## Implementation Timeline |
| 231 | + |
| 232 | +### Week 1: Foundation |
| 233 | +- Module 1: Basic workflow server |
| 234 | +- Module 2: Smart file analysis |
| 235 | +- Create starter code templates |
| 236 | + |
| 237 | +### Week 2: Integration |
| 238 | +- Module 3: GitHub Actions + Cloudflare Tunnel |
| 239 | +- Module 4: Team communication |
| 240 | +- End-to-end testing |
| 241 | + |
| 242 | +### Week 3: Polish |
| 243 | +- Module 5: Production readiness |
| 244 | +- Unit 4 transition preparation |
| 245 | +- Interactive elements and quizzes |
| 246 | + |
| 247 | +### Week 4: Review & Refinement |
| 248 | +- Team feedback integration |
| 249 | +- Documentation polish |
| 250 | +- Community preview |
| 251 | + |
| 252 | +## Success Metrics |
| 253 | + |
| 254 | +### Learning Outcomes |
| 255 | +- Learners can build production-ready MCP servers locally |
| 256 | +- Understanding of workflow automation concepts |
| 257 | +- Confidence to tackle Unit 4 remote deployment |
| 258 | +- Practical skills applicable to real development teams |
| 259 | + |
| 260 | +### Technical Deliverables |
| 261 | +- 5 complete working code examples |
| 262 | +- Seamless Unit 4 transition codebase |
| 263 | +- Comprehensive troubleshooting documentation |
| 264 | +- Interactive assessment materials |
| 265 | + |
| 266 | +## Next Steps |
| 267 | + |
| 268 | +1. **Team Review**: Gather feedback on this plan |
| 269 | +2. **Quiz Development**: Collaborate with @burtenshaw on assessment design |
| 270 | +3. **Module 1 Implementation**: Start with basic workflow server |
| 271 | +4. **Iterative Development**: Build and test each module sequentially |
| 272 | + |
| 273 | +## Questions for Team Discussion |
| 274 | + |
| 275 | +1. **Scope**: Is the 3-hour total time commitment appropriate? |
| 276 | +2. **Technology**: Any concerns about Cloudflare Tunnel? |
| 277 | +3. **Modularity**: Does the jump-in-anywhere approach work for our audience? |
| 278 | +4. **Unit 4 Bridge**: Is the transition strategy clear and compelling? |
| 279 | +5. **Free Tier**: Any features that might require paid services? |
| 280 | + |
| 281 | +--- |
| 282 | + |
| 283 | +*This plan emphasizes practical, hands-on learning that prepares students for real-world MCP server development while maintaining a clear path to production deployment in Unit 4.* |
0 commit comments