nasarali03/todo-mcp-server
If you are the rightful owner of todo-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This project is a modern To-Do application with REST API and MCP server integration, designed for managing tasks efficiently.
📝 To-Do API with MCP Server
A modern To-Do application with REST API and MCP server integration
🎬 Watch the Demo Video
Click above to watch the complete project demonstration!
🚀 Features • 📦 Installation • 🔧 Usage • 📚 API Documentation • 🎥 Demo Video
🎯 Overview
This project is a comprehensive To-Do application built with FastAPI and integrated with MCP (Model Context Protocol) server capabilities. It provides both traditional REST API endpoints and modern MCP tool-based interactions for managing tasks.
🌟 Key Highlights
- Dual Interface: Both REST API and MCP server for maximum flexibility
- Modern Architecture: Built with FastAPI for high performance and automatic documentation
- Type Safety: Full Pydantic model validation
- Developer Friendly: Auto-generated API docs and comprehensive error handling
- CORS Ready: Configured for frontend integration
- Tool-Based Interactions: MCP server enables AI agent integration
🚀 Features
📋 Core Functionality
- ✅ Create new todo items with title and description
- 📖 Read all todos or individual items by ID
- ✏️ Update todo items (title, description, completion status)
- 🗑️ Delete todo items
- 📊 Summary Statistics with completion rates
🛠️ Technical Features
- REST API Endpoints for traditional web integration
- MCP Server Integration for AI agent interactions
- Auto-generated Documentation (Swagger UI & ReDoc)
- CORS Support for cross-origin requests
- Type Validation with Pydantic models
- Error Handling with proper HTTP status codes
- Health Check endpoint for monitoring
🎯 MCP Tools Available
create_todo- Create new todo itemslist_todos- Get all todosget_todo- Get specific todo by IDupdate_todo- Update existing todosdelete_todo- Remove todostodo_summary- Get statistics and completion rates
📦 Installation
Prerequisites
- Python 3.8 or higher
- pip (Python package installer)
Step 1: Clone the Repository
git clone <your-repo-url>
cd mcp
Step 2: Install Dependencies
pip install -r requirements.txt
Step 3: Run the Application
# Development server with auto-reload
uvicorn main:app --reload
# Or run directly
python main.py
🔧 Usage
🌐 Access Points
Once the server is running, you can access:
| Service | URL | Description |
|---|---|---|
| API Root | http://localhost:8000 | Basic API information |
| Interactive Docs | http://localhost:8000/docs | Swagger UI documentation |
| Alternative Docs | http://localhost:8000/redoc | ReDoc documentation |
| MCP Server | http://localhost:8000/mcp | MCP server interface |
| Health Check | http://localhost:8000/health | Server health status |
📡 REST API Examples
Create a Todo
curl -X POST "http://localhost:8000/todos/" \
-H "Content-Type: application/json" \
-d '{"title": "Learn FastAPI", "description": "Complete the FastAPI tutorial"}'
Get All Todos
curl -X GET "http://localhost:8000/todos/"
Update a Todo
curl -X PUT "http://localhost:8000/todos/1" \
-H "Content-Type: application/json" \
-d '{"completed": true}'
Delete a Todo
curl -X DELETE "http://localhost:8000/todos/1"
🤖 MCP Server Usage
List Available Tools
curl -X GET "http://localhost:8000/mcp/tools"
Use MCP Tools
# Create a todo via MCP
curl -X POST "http://localhost:8000/mcp/tools/create_todo" \
-H "Content-Type: application/json" \
-d '{"title": "MCP Todo", "description": "Created via MCP"}'
# Get todo summary
curl -X GET "http://localhost:8000/mcp/resources/todo_summary"
📚 API Documentation
📋 Todo Model
{
"id": int, # Unique identifier
"title": str, # Todo title (required)
"description": str, # Optional description
"completed": bool, # Completion status (default: false)
"created_at": datetime # Creation timestamp
}
🔗 Endpoints
REST API Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | / | API information |
GET | /health | Health check |
GET | /todos/ | Get all todos |
POST | /todos/ | Create new todo |
GET | /todos/{id} | Get specific todo |
PUT | /todos/{id} | Update todo |
DELETE | /todos/{id} | Delete todo |
MCP Server Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /mcp/ | MCP server info |
GET | /mcp/tools | List available tools |
POST | /mcp/tools/{tool_name} | Execute MCP tool |
GET | /mcp/resources | List available resources |
GET | /mcp/resources/{resource_name} | Get MCP resource |
🎥 Demo Video
🎬 Watch the Project Demo
Click the button above or the video below to watch the complete project demonstration!
This video demonstrates the complete functionality of the To-Do API with MCP Server integration
🏗️ Project Structure
mcp/
├── 📁 routes/
│ ├── __pycache__/
│ └── todo.py # Todo route handlers
├── 📄 main.py # FastAPI application & MCP server
├── 📄 models.py # Pydantic data models
├── 📄 requirements.txt # Python dependencies
├── 📄 mcp_server.json # MCP server configuration
├── 📄 todo-api-mcp-demo.mp4 # Demo video
├── 📄 README.md # This file
└── 📄 LICENSE # MIT License
🛠️ Development
🔧 Configuration
The application uses the following configuration:
- Host:
0.0.0.0(all interfaces) - Port:
8000 - Auto-reload: Enabled in development
- CORS: Configured for all origins (adjust for production)
📝 Adding New Features
- New API Endpoints: Add to
routes/todo.py - New MCP Tools: Add to
main.pywith@mcp.tool()decorator - New Models: Add to
models.py - Dependencies: Update
requirements.txt
🧪 Testing
# Test the API endpoints
curl -X GET "http://localhost:8000/health"
# Test MCP server
curl -X GET "http://localhost:8000/mcp/"
🤝 Contributing
We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📋 Contribution Guidelines
- Follow PEP 8 style guidelines
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass
📄 License
This project is licensed under the MIT License - see the file for details.
👨💻 Author
Nasar Ali
- GitHub: @nasarali
- Project: To-Do API with MCP Server
- Video:
🙏 Acknowledgments
- FastAPI - The modern, fast web framework for building APIs
- Pydantic - Data validation using Python type annotations
- MCP Protocol - Model Context Protocol for AI agent integration
- Uvicorn - Lightning-fast ASGI server
📞 Support
If you have any questions or need help:
- Check the API Documentation
- Watch the
- Open an issue on GitHub
- Contact the author