Skip to main content
The Todo TypeScript server showcases a complete CRUD (Create, Read, Update, Delete) application built with MCP. It demonstrates service-oriented architecture and state management patterns.

Features

  • Complete CRUD Operations: Create, list, update, complete, and delete todos
  • Service Architecture: Separated business logic from MCP handlers
  • In-Memory Storage: Simple state management for learning
  • TypeScript Types: Fully typed implementation
  • Six Tools: Comprehensive todo management

Installation

1

Navigate to Directory

2

Install Dependencies

3

Build the Server

4

Configure MCP Client

Add to your MCP client configuration:

Data Model

The Todo interface defines the structure of todo items:

Tools

TODO-Create

Create a new todo item. Parameters:
  • task (string): The task description
Example:
Response:
Implementation:

TODO-List

List all todo items. Parameters: None Example Response:
Implementation:

TODO-Complete

Mark a todo item as completed. Parameters:
  • id (string): The todo item ID
Example:
Response:
Implementation:

TODO-Update

Update a todo item’s task description. Parameters:
  • id (string): The todo item ID
  • task (string): New task description
Example:
Response:
Implementation:

TODO-Delete

Delete a todo item. Parameters:
  • id (string): The todo item ID
Example:
Response:
Implementation:

TODO-ClearCompleted

Remove all completed todo items. Parameters: None Response:
Implementation:

Service Layer

The todo service (todo.service.ts) handles all business logic:

State Management

Create Todo

Get All Todos

Get Todo by ID

Complete Todo

Delete Todo

Update Todo Task

Filter Helpers

Server Configuration

Usage Examples

Create and Manage Todos

Conversational Usage

Architecture Benefits

Separation of Concerns

Business logic isolated in service layer, MCP handlers stay thin

Testability

Service functions can be unit tested independently

Reusability

Service functions can be used by multiple tools or other services

Maintainability

Clear structure makes code easier to understand and modify

Dependencies

Extending the Server

Add Priority Levels

Add Tags

Troubleshooting

The build script sets execute permissions. If you see permission errors:
Ensure your imports use .js extensions:
This is required for ES modules even with TypeScript.
This server uses in-memory storage. Todos are lost when the server restarts. For persistence, implement file-based or database storage in the service layer.

Project Structure

Next Steps

EDteam Go Server

Learn about external API integration with Go

Basic TypeScript

Explore resources and prompts in MCP