Todo App using MCP Server

by theatulanand

322 downloads
Not rated
GitHub

About

A simple Todo application enhanced with natural language processing using the Google Gemini API, MongoDB for persistence, and MCP (Model Context Protocol) for real-time updates via Server-Sent Events (SSE). Built with a modular MVC architecture using Express.js, it is intended…

Details

Author
theatulanand
Downloads
322
Categories
Productivity

- Add todos using natural language (e.g., “buy milk”)
- List todos, optionally including completed ones
- Mark todos as complete by MongoDB ID
- Delete todos by MongoDB ID
- Real‑time updates via SSE with MCP integration

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Todo App using MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, install dependencies, and create a .env file with PORT, MONGO_URI, and GEMINI_API_KEY. Start the server with npm start. Send POST requests to /api/command with a JSON body containing a "command" field (e.g., {"command": "Add a task to buy milk"}). Supported commands include adding, listing, completing, and deleting todos. Connect to /sse for real‑time updates (requires an MCP‑compatible client).

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "todo app using mcp server": {
            "todo-mcp": {
                "type": "http",
                "url": "http://localhost:3000/sse"
            }
        }
    }
}

McpServers

{
    "todo-mcp": {
        "type": "http",
        "url": "http://localhost:3000/sse"
    }
}

Todo App using MCP Server

A simple Todo application enhanced with natural language processing using the Google Gemini API, MongoDB for persistence, and MCP (Model Context Protocol) for real-time updates via Server-Sent Events (SSE). Built using a modular MVC architecture with Express.js.

---

Features

- Add todos using natural language (e.g., "Add a task to buy milk")
- List todos (optionally include completed ones)
- Mark todos as complete using their MongoDB ID
- Delete todos by their MongoDB ID
- Receive real-time updates using Server-Sent Events (SSE) with MCP

---

Tech Stack

- Node.js: Server runtime
- Express.js: Routing and middleware
- MongoDB (Atlas): Cloud-based NoSQL database
- Mongoose: ODM for MongoDB
- Google Gemini API: Handles natural language command interpretation
- @modelcontextprotocol/sdk: For MCP integration and SSE
- dotenv: For managing environment variables

---

Prerequisites

- Node.js (v18 or higher)
- MongoDB Atlas cluster (credentials required)
- Google Gemini API Key (available from Google AI Studio)

---

Installation

1. Clone the repository

   git clone https://github.com/theatulanand/to-do-mcp-server.git
cd todo-mcp-single

2. Install dependencies

   npm install

3. Set up environment variables

Create a .env file in the root directory:

   PORT=3000
MONGO_URI=URI
GEMINI_API_KEY=

---

Running the App

Start the server:

npm start

You should see:

Connected to MongoDB with Mongoose
Server running on http://localhost:3000

To stop the server, press Ctrl + C.

---

How to Use

Send a POST request to /api/command with a JSON body:

{ "command": "Add a task to buy milk" }

Example Commands

- Add:

  curl -X POST http://localhost:3000/api/command -H "Content-Type: application/json" -d '{"command": "Add a task to buy milk"}'

- List:

  curl -X POST http://localhost:3000/api/command -H "Content-Type: application/json" -d '{"command": "List my todos"}'

- Complete:

  curl -X POST http://localhost:3000/api/command -H "Content-Type: application/json" -d '{"command": "Complete todo with ID some_mongodb_id"}'

- Delete:

  curl -X POST http://localhost:3000/api/command -H "Content-Type: application/json" -d '{"command": "Delete todo with ID some_mongodb_id"}'

- List including completed:

  curl -X POST http://localhost:3000/api/command -H "Content-Type: application/json" -d '{"command": "List my todos including completed"}'

---

Real-time Updates (SSE)

Connect to /sse to receive live updates. (Requires MCP-compatible client.)

---

Project Structure

todo-mcp-single/
├── models/           # Mongoose schemas
│   └── Todo.js
├── controllers/      # Business logic
│   └── todoController.js
├── routes/           # API routes
│   └── todoRoutes.js
├── utils/            # Utility functions (e.g., Gemini integration)
│   └── gemini.js
├── .env              # Environment configuration
└── server.js         # App entry point

---

Troubleshooting

- MongoDB Connection Failed: Check MONGO_URI and IP whitelist in Atlas.
- Gemini API Errors: Validate API key and network access to generativelanguage.googleapis.com.
- Unrecognized Commands: Check Gemini raw output in logs for debugging.

---

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.