Skip to content

david0723/task-manager-mcp

Repository files navigation

Takio MCP Server

This project is a simple MCP (Model-Centric Protocol) server that implements the logic for a basic task manager. It allows for CRUD (Create, Read, Update, Delete) operations on tasks and can be backed by either an in-memory store or a Notion database.

Features

  • MCP Compliant: Implements the Model-Centric Protocol for standardized communication.
  • Task Management: Provides full CRUD functionality for tasks.
  • Multiple Backends: Can use either an in-memory data store for quick testing or a Notion database for persistent storage.
  • Cloudflare Workers: Built to be deployed as a serverless Cloudflare Worker.
  • Hono Framework: Uses the Hono web framework for routing and handling requests.
  • Chanfana for OpenAPI: Automatically generates an OpenAPI 3.1 schema from the code, providing interactive documentation.

Project Structure

  • src/index.ts: The main entry point of the application, where the Hono app and OpenAPI documentation are set up.
  • src/endpoints/mcp.ts: Handles incoming MCP requests and routes them to the appropriate task manager implementation.
  • src/mcp/taskManagerServer.ts: Defines the MCP server, including the tools for creating, updating, deleting, and listing tasks.
  • src/TaskManager/TaskManager.ts: The core TaskManagerServer class that orchestrates the task manager implementation.
  • src/TaskManager/implementations/: Contains the different backend implementations for the task manager.
    • InMemoryTaskManager.ts: A simple in-memory implementation for storing tasks.
    • NotionTaskManager.ts: An implementation that uses the Notion API to store tasks in a database.
  • src/utils/: Contains utility functions for parsing data and defining schemas.
  • wrangler.jsonc: Configuration file for the Cloudflare Worker.
  • package.json: Defines the project's dependencies and scripts.

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd takio-mcp
  2. Install dependencies:

    pnpm install

Configuration

  1. Notion Integration (Optional): If you want to use the Notion backend, you'll need to:
    • Create a Notion integration and get your API key.
    • Create a Notion database and get its ID.
    • Set the NOTION_API_KEY as a secret in your Cloudflare Worker:
      npx wrangler secret put NOTION_API_KEY
    • Add the DB_ID to your wrangler.jsonc file in the vars section.

Running Locally

To start the development server, run:

pnpm run dev

This will start a local server, and you can access the interactive OpenAPI documentation at http://localhost:8787/.

Deployment

To deploy the worker to your Cloudflare account, run:

pnpm run deploy

Usage

The server exposes a single MCP endpoint at /mcp. You can interact with it using any MCP-compliant client. The available tools are:

  • createTask(title: string, description?: string, status?: 'pending' | 'in-progress' | 'completed'): Creates a new task.
  • updateTask(id: string, title?: string, description?: string, status?: 'pending' | 'in-progress' | 'completed'): Updates an existing task.
  • deleteTask(id: string): Deletes a task.
  • listTasks(status?: 'pending' | 'in-progress' | 'completed'): Lists all tasks, optionally filtering by status.

About

Simple MCP server implementation for task management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors