Build a complete Todo application with MCPCodex in under 10 minutes. Learn the fundamentals of AI-assisted development.
React with TypeScript, modern components, and responsive design.
API routes with SQLite database and full CRUD operations.
One-click deployment to Vercel, Netlify, or your preferred platform.
Start by creating a new MCPCodex project. The CLI will guide you through the setup process:
# Initialize a new MCPCodex project
mcp init my-todo-app
# Navigate to project directory
cd my-todo-app
# The CLI will ask you a few questions:
# - Project type: web-app
# - Framework: react-typescript
# - Database: sqlite
# - Authentication: jwt
# - Deployment: vercel
# Start development server
mcp dev
my-todo-app/
├── src/
│ ├── components/
│ │ ├── TodoList.tsx
│ │ ├── TodoItem.tsx
│ │ └── AddTodo.tsx
│ ├── pages/
│ │ ├── index.tsx
│ │ └── api/
│ │ └── todos.ts
│ ├── lib/
│ │ ├── database.ts
│ │ └── auth.ts
│ └── styles/
│ └── globals.css
├── mcp.config.js
├── package.json
└── README.md
Now comes the magic! Use MCPCodex to generate your application components using natural language:
# Generate a Todo component with AI
mcp generate component "TodoList with add, edit, delete functionality"
# Generate API routes
mcp generate api "CRUD operations for todos with SQLite"
# Generate database schema
mcp generate schema "Todo model with title, description, completed, createdAt"
# Generate tests
mcp generate tests "unit tests for TodoList component"
Here's what MCPCodex generated for our TodoList component:
// Generated by MCPCodex AI
import React, { useState, useEffect } from 'react';
import { Todo } from '../types/Todo';
import { TodoItem } from './TodoItem';
import { AddTodo } from './AddTodo';
interface TodoListProps {
initialTodos?: Todo[];
}
export const TodoList: React.FC<TodoListProps> = ({ initialTodos = [] }) => {
const [todos, setTodos] = useState<Todo[]>(initialTodos);
const [loading, setLoading] = useState(false);
useEffect(() => {
fetchTodos();
}, []);
const fetchTodos = async () => {
setLoading(true);
try {
const response = await fetch('/api/todos');
const data = await response.json();
setTodos(data);
} catch (error) {
console.error('Failed to fetch todos:', error);
} finally {
setLoading(false);
}
};
const addTodo = async (title: string, description: string) => {
try {
const response = await fetch('/api/todos', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ title, description }),
});
const newTodo = await response.json();
setTodos([...todos, newTodo]);
} catch (error) {
console.error('Failed to add todo:', error);
}
};
const updateTodo = async (id: string, updates: Partial<Todo>) => {
try {
const response = await fetch(`/api/todos/${id}`, {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(updates),
});
const updatedTodo = await response.json();
setTodos(todos.map(todo => todo.id === id ? updatedTodo : todo));
} catch (error) {
console.error('Failed to update todo:', error);
}
};
const deleteTodo = async (id: string) => {
try {
await fetch(`/api/todos/${id}`, { method: 'DELETE' });
setTodos(todos.filter(todo => todo.id !== id));
} catch (error) {
console.error('Failed to delete todo:', error);
}
};
if (loading) {
return <div className="flex justify-center p-8">Loading...</div>;
}
return (
<div className="max-w-2xl mx-auto p-6">
<h1 className="text-3xl font-bold mb-8 text-center">My Todo App</h1>
<AddTodo onAdd={addTodo} />
<div className="space-y-2 mt-6">
{todos.map(todo => (
<TodoItem
key={todo.id}
todo={todo}
onUpdate={updateTodo}
onDelete={deleteTodo}
/>
))}
</div>
{todos.length === 0 && (
<div className="text-center text-gray-500 mt-12">
No todos yet. Add one above to get started!
</div>
)}
</div>
);
};
// Generated API route: pages/api/todos.ts
import { NextApiRequest, NextApiResponse } from 'next';
import { getDatabase } from '../../lib/database';
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const db = getDatabase();
switch (req.method) {
case 'GET':
try {
const todos = db.prepare('SELECT * FROM todos ORDER BY createdAt DESC').all();
res.status(200).json(todos);
} catch (error) {
res.status(500).json({ error: 'Failed to fetch todos' });
}
break;
case 'POST':
try {
const { title, description } = req.body;
const result = db.prepare(
'INSERT INTO todos (title, description, completed, createdAt) VALUES (?, ?, ?, ?)'
).run(title, description, false, new Date().toISOString());
const newTodo = db.prepare('SELECT * FROM todos WHERE id = ?').get(result.lastInsertRowid);
res.status(201).json(newTodo);
} catch (error) {
res.status(500).json({ error: 'Failed to create todo' });
}
break;
default:
res.setHeader('Allow', ['GET', 'POST']);
res.status(405).end(`Method ${req.method} Not Allowed`);
}
}
Your todo application is now ready! Let's test it locally:
# Start the development server
npm run dev
# Or with MCPCodex CLI
mcp dev
# Your app will be available at http://localhost:3000
# Run generated tests npm test # Run with coverage npm run test:coverage
Ready to share your app with the world? MCPCodex makes deployment effortless:
# Deploy your project
mcp deploy
# MCPCodex will:
# 1. Build your project
# 2. Run tests
# 3. Deploy to your configured platform (Vercel, Netlify, etc.)
# 4. Set up database and environment variables
# 5. Provide you with the live URL
# Monitor deployment
mcp deploy status
# View deployment logs
mcp deploy logs
MCPCodex handles the entire deployment pipeline automatically:
Your basic todo app is just the beginning! Let's add more features using AI:
# Add more features with AI assistance
mcp generate feature "user authentication with JWT"
mcp generate feature "todo categories and tags"
mcp generate feature "todo due dates and reminders"
mcp generate feature "search and filter functionality"
# Optimize and refactor
mcp refactor --optimize-performance
mcp refactor --improve-accessibility
mcp refactor --add-error-handling
# Generate documentation
mcp generate docs --api
mcp generate docs --components
mcp generate docs --deployment
User login and registration with JWT
Organize todos with tags and categories
Add deadlines and reminder notifications
Advanced filtering and search functionality
Progressive Web App with offline support
Dark mode and customizable themes
mcp init
Explore our extensive library of project templates and tutorials.