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

code

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:

typescript

2. CRUD Tools (tools.ts)

Complete set of operations with error handling:

typescript

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:

typescript

Repository Implementation

Clean data layer with SQL persistence:

typescript

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:

typescript

5. Server Configuration (server.ts)

Bringing it all together:

typescript

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

bash

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:

šŸŽÆ 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!

Contact Us

Tell us a little about your project and how to reach you.