todo-mcp-server

nasarali03/todo-mcp-server

3.2

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 henry@mcphub.com.

This project is a modern To-Do application with REST API and MCP server integration, designed for managing tasks efficiently.

Tools
6
Resources
0
Prompts
0

๐Ÿ“ To-Do API with MCP Server

FastAPI Python MCP License

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 items
  • list_todos - Get all todos
  • get_todo - Get specific todo by ID
  • update_todo - Update existing todos
  • delete_todo - Remove todos
  • todo_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:

ServiceURLDescription
API Roothttp://localhost:8000Basic API information
Interactive Docshttp://localhost:8000/docsSwagger UI documentation
Alternative Docshttp://localhost:8000/redocReDoc documentation
MCP Serverhttp://localhost:8000/mcpMCP server interface
Health Checkhttp://localhost:8000/healthServer 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
MethodEndpointDescription
GET/API information
GET/healthHealth 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
MethodEndpointDescription
GET/mcp/MCP server info
GET/mcp/toolsList available tools
POST/mcp/tools/{tool_name}Execute MCP tool
GET/mcp/resourcesList 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

  1. New API Endpoints: Add to routes/todo.py
  2. New MCP Tools: Add to main.py with @mcp.tool() decorator
  3. New Models: Add to models.py
  4. 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:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. 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:

  1. Check the API Documentation
  2. Watch the
  3. Open an issue on GitHub
  4. Contact the author

โญ Star this repository if you found it helpful!

GitHub stars GitHub forks

Built with โค๏ธ using FastAPI and MCP