Todo MCP Server

Todo MCP Server

This MCP server provides tools to manage a todo list with CRUD operations, enabling listing, creating, updating, and deleting todos.

Category
Visit Server

README

Todo App - FastAPI to MCP Conversion

This project demonstrates how to create a FastAPI todo application and convert it to an MCP (Model Context Protocol) server. ss 1 ss 2 ss 3 ss 4

Project Structure

├── main.py              # FastAPI application
├── models.py            # Pydantic models for data validation
├── database.py          # In-memory database operations
├── mcp_server.py        # MCP server implementation
├── mcp_config.json     # MCP server configuration
├── test_mcp.py         # Test script for MCP server
├── requirements.txt    # Python dependencies
└── README.md           # This file

Features

FastAPI Application

  • RESTful API endpoints for todo management
  • CRUD operations (Create, Read, Update, Delete)
  • Data validation with Pydantic models
  • In-memory storage for simplicity

MCP Server

  • Converts FastAPI functionality to MCP tools
  • 5 available tools: list_todos, get_todo, create_todo, update_todo, delete_todo
  • Compatible with MCP clients and AI assistants

Installation

  1. Create and activate a virtual environment:
python -m venv venv
# On Windows:
.\venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt

Usage

Running the FastAPI Application

python main.py

The API will be available at http://localhost:8000

API Endpoints:

  • GET / - Welcome message
  • GET /todos - List all todos
  • GET /todos/{id} - Get specific todo
  • POST /todos - Create new todo
  • PUT /todos/{id} - Update todo
  • DELETE /todos/{id} - Delete todo

Running the MCP Server

python mcp_server.py

The MCP server provides these tools:

  • list_todos - Get all todos
  • get_todo - Get specific todo by ID
  • create_todo - Create new todo
  • update_todo - Update existing todo
  • delete_todo - Delete todo

Testing the MCP Server

python test_mcp.py

This will run a comprehensive test of all MCP server functionality.

API Examples

FastAPI Examples

Create a todo:

curl -X POST "http://localhost:8000/todos" \
     -H "Content-Type: application/json" \
     -d '{"title": "Learn MCP", "description": "Study Model Context Protocol", "status": "pending"}'

Get all todos:

curl "http://localhost:8000/todos"

MCP Tool Examples

The MCP server can be used with MCP-compatible clients. The tools accept JSON arguments and return structured responses.

Data Models

Todo Model

  • id: Integer (auto-generated)
  • title: String (required)
  • description: String (optional)
  • status: Enum (pending, in_progress, completed)
  • created_at: DateTime (auto-generated)
  • updated_at: DateTime (auto-updated)

Status Values

  • pending: Todo is not started
  • in_progress: Todo is being worked on
  • completed: Todo is finished

Development

The project uses:

  • FastAPI for the REST API
  • Pydantic for data validation
  • MCP for the protocol server
  • asyncio for asynchronous operations

Notes

  • The database is in-memory and will reset when the application restarts
  • The MCP server runs in stdio mode for easy integration
  • Both the FastAPI app and MCP server share the same data models and business logic

MCP-Server

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured