mcpField
T
Todo App using MCP Server

Todo App using MCP Server

Remote
github.com/theatulanandProductivity0Updated 81w ago
Repository

About Todo App using MCP Server

An Express.js todo app that uses the Google Gemini API to interpret natural-language commands and MongoDB for persistence. It is for users managing tasks through commands, with real-time updates delivered over SSE.

Key features

  1. 01Add todos with natural language
  2. 02List todos, including completed ones
  3. 03Complete todos by MongoDB ID
  4. 04Delete todos by MongoDB ID
  5. 05Stream real-time updates over SSE

Use cases

  1. 01Create a shopping task with a sentence
  2. 02Review open or all todos
  3. 03Mark a specific todo complete
  4. 04Receive todo changes in an MCP client

MCP support

The project uses MCP with SSE for real-time updates and provides an `/sse` endpoint for compatible clients.

Configuration

Remote servers need no local install. Pick your client, then copy the config or install in one click.

Endpointhttp://localhost:3000/sse
Copy install command
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.

Tools

Details

From the project README

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.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.