Chapter 3 Exercises
These exercises focus on database integration - the "killer app" for enterprise MCP servers.
Exercises
-
Building a Database Query Tool ⭐⭐ Intermediate (35 min)
- Create list_tables and execute_query tools
- Learn to structure database results for AI consumption
-
SQL Injection Code Review ⭐⭐ Intermediate (25 min)
- Identify SQL injection vulnerabilities
- Learn parameterized queries and allowlisting
-
Pagination Patterns ⭐⭐ Intermediate (30 min)
- Implement cursor-based pagination
- Handle large result sets safely
Next Steps
After completing these exercises:
- SQL Safety and Injection Prevention - Deep dive into security
- Handling Large Results - Production patterns