mcp-server-todo-list

AnthonyAltieri/mcp-server-todo-list

3.3

If you are the rightful owner of mcp-server-todo-list 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.

The MCP Todo Server is a Model Context Protocol server that provides todo list management functionality using SQLite and Drizzle ORM.

Tools
  1. create_todo

    Create a new todo item.

  2. list_todos

    List todos with optional filtering.

  3. get_todo

    Get a specific todo by its ID.

  4. update_todo

    Update an existing todo.

  5. delete_todo

    Delete a todo by its ID.

  6. complete_todo

    Mark a todo as completed.

MCP Todo Server

A Model Context Protocol (MCP) server that provides todo list management functionality using SQLite and Drizzle ORM.

Features

  • Create, read, update, and delete todos
  • Mark todos as completed
  • Filter todos by completion status and priority
  • Priority levels: low, medium, high
  • SQLite database with automatic initialization

Installation

  1. Install dependencies:
pnpm install
  1. Run database migrations:
pnpm db:migrate
  1. Build the project:
pnpm build

Usage

Development

pnpm dev

Production

pnpm start

Available Tools

The MCP server exposes the following tools that can be used by MCP clients:

create_todo

Create a new todo item.

Parameters:

  • title (string, required): The title of the todo
  • description (string, optional): Detailed description
  • priority (enum, optional): Priority level - "low", "medium", or "high" (default: "medium")

list_todos

List todos with optional filtering.

Parameters:

  • completed (boolean, optional): Filter by completion status
  • priority (enum, optional): Filter by priority - "low", "medium", or "high"
  • limit (number, optional): Maximum number of todos to return (default: 20, max: 100)

get_todo

Get a specific todo by its ID.

Parameters:

  • id (number, required): The ID of the todo to retrieve

update_todo

Update an existing todo.

Parameters:

  • id (number, required): The ID of the todo to update
  • title (string, optional): New title
  • description (string, optional): New description
  • completed (boolean, optional): Completion status
  • priority (enum, optional): New priority level

delete_todo

Delete a todo by its ID.

Parameters:

  • id (number, required): The ID of the todo to delete

complete_todo

Mark a todo as completed.

Parameters:

  • id (number, required): The ID of the todo to mark as completed

Database Schema

The server uses a SQLite database with the following schema:

CREATE TABLE todos (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  title TEXT NOT NULL,
  description TEXT,
  completed INTEGER DEFAULT 0,
  priority TEXT DEFAULT 'medium',
  created_at TEXT DEFAULT (datetime('now')),
  updated_at TEXT DEFAULT (datetime('now'))
);

Example Usage with MCP Client

Here's how you might use this server with an MCP client:

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

const transport = new StdioClientTransport({
  command: "node",
  args: ["dist/index.js"],
});

const client = new Client({
  name: "todo-client",
  version: "1.0.0",
});

await client.connect(transport);

// Create a todo
await client.callTool({
  name: "create_todo",
  arguments: {
    title: "Buy groceries",
    description: "Milk, eggs, bread",
    priority: "high",
  },
});

// List all todos
await client.callTool({
  name: "list_todos",
  arguments: {},
});

Files

  • src/index.ts - Main MCP server implementation
  • src/db/schema.ts - Database schema definition
  • src/db/index.ts - Database connection and initialization
  • drizzle.config.ts - Drizzle ORM configuration

Development

The server uses:

  • Model Context Protocol SDK for MCP functionality
  • Drizzle ORM for database operations
  • better-sqlite3 for SQLite database
  • Zod for parameter validation
  • TypeScript for type safety

The database file (todos.db) will be created automatically when the server starts.

mcp-server-todo-list