TODO List Example
Ready to see MCP in action? This example showcases a complete TODO management system built with our TypeScript MCP Framework. You'll see full CRUD operations, type-safe schemas, and production-ready patterns in just a few files.
What You'll Build
A fully functional TODO MCP server with:
- ā Create - Add new tasks with validation
- š Read - List and search todos
- āļø Update - Modify existing tasks
- šļø Delete - Remove completed tasks
- š Smart Filtering - By status, priority, and date
- š Rich Resources - Data access for AI agents
Architecture Overview
The architecture follows clean separation of concerns with type-safe interfaces throughout.
Key Implementation Patterns
1. Type-Safe Schemas (schema.ts)
Clean data models with full validation:
2. CRUD Tools (tools.ts)
Complete set of operations with error handling:
3. SQL Database & Repository (repository.ts)
Powered by Durable Object SQLite storage - This example uses agent local SQL storage for zero-latency data access and immediate consistency.
Why Durable Object Storage?
ā
Zero Network Latency - Sub-millisecond data access
ā
No Additional Costs - Included in Durable Object pricing
ā
Immediate Consistency - No replication lag
ā
ACID Compliance - Full transaction support
ā
Perfect for Agent State - Isolated, persistent storage per agent
SQL Schema Definition
From the TypeScript Agent Framework schema:
Repository Implementation
Clean data layer with SQL persistence:
Key Benefits: The repository pattern abstracts SQL complexity while leveraging the powerful SQL storage capabilities built into our platform.
4. Smart Resources (resources.ts)
Rich data access for AI agents:
5. Server Configuration (server.ts)
Bringing it all together:
Why This Pattern Works
š”ļø Type Safety - Zod schemas ensure data integrity at runtime
š§© Modular Design - Each concern is cleanly separated
š AI-Ready - Resources provide rich context for agents
š§ Extensible - Easy to add new operations and filters
ā
Production Ready - Error handling and validation built-in
Test It Out
What Makes This Special
This isn't just another CRUD example. It demonstrates:
- Schema-First Design - Types drive everything
- Agent-Friendly Resources - AI can understand your data
- Real Error Handling - Production-grade validation
- Clean Architecture - Maintainable and extensible
Next Steps
Ready to build your own? Check out:
- Complete Source Code - Full implementation with tests
- Getting Started Guide - Build from scratch
- Integration Testing - Test your CRUD operations
- Agent Framework - Connect to AI agents
šÆ Ready to build? This TODO example shows how clean architecture and MCP make building AI-ready tools a breeze. Start with the complete source and adapt it to your needs!