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.
- 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.
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 coreTaskManagerServerclass 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.
- A Cloudflare account.
- Node.js and pnpm installed.
- Wrangler CLI installed and authenticated.
-
Clone the repository:
git clone <repository-url> cd takio-mcp
-
Install dependencies:
pnpm install
- 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_KEYas a secret in your Cloudflare Worker:npx wrangler secret put NOTION_API_KEY
- Add the
DB_IDto yourwrangler.jsoncfile in thevarssection.
To start the development server, run:
pnpm run devThis will start a local server, and you can access the interactive OpenAPI documentation at http://localhost:8787/.
To deploy the worker to your Cloudflare account, run:
pnpm run deployThe 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.