Todo MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Todo MCP Serveradd a new todo: buy groceries"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP server todo application - Filip Brebera (hiring task)
This is my solution to the task of implementing a multi-node todo application using an MCP server with Redis for storage and OpenRouter for AI-powered analysis.
Prerequisites
Required Tools:
OpenRouter API Key:
You need an OpenRouter API key to run the AI analysis feature.
Get your API key from openrouter.ai/keys
Copy the example environment file:
cp .env.example .envEdit
.envand add your API key:OPENROUTER_API_KEY=sk-or-v1-your-actual-key-here
Related MCP server: Todo Markdown MCP Server
Quick Start
Local Development (Stdio Mode)
For testing with MCP clients like VS Code or Cursor:
Note: Make sure MCP_MODE=stdio is set in your .env file.
# Install dependencies
bun install
# Start Redis
docker run -d -p 6379:6379 redis:7-alpine
# Run in stdio mode
bun run devDevelopment (Multi-Node HTTP)
For testing multi-node setup locally with hot reload:
# Start all services with hot reload
docker-compose -f docker-compose.dev.yml up
# Test health
curl http://localhost:3000/healthProduction (Multi-Node HTTP)
For production deployment:
# Build and start all services
docker-compose up --build -d
# Verify health
curl http://localhost:3000/health
# View logs
docker-compose logs -fServer Modes
You can switch between two modes - stdio and HTTP - using the MCP_MODE environment variable.
Stdio Mode: For local development and MCP client integration (VS Code, Cursor)
Single user session
Direct stdio communication
No HTTP server
HTTP Mode: For multi-node production deployment
Distributed sessions via Redis
Load balanced across multiple nodes
HTTP transport with session headers
Available Tools
Tool | Parameters | Description |
|
| Add a new todo |
|
| List todos |
|
| Remove a todo |
|
| Mark todo as completed |
| - | Clear all todos |
|
| AI-powered prioritization |
Configuration
Variable | Default | Description |
|
| Server mode: |
|
| HTTP server port (http mode only) |
|
| Redis connection string |
| required | API key from openrouter.ai |
|
| Node identifier (for debugging) |
Testing HTTP Mode
Sessions are created automatically on first request. MCP clients handle sessions transparently.
With MCP Client (Claude Code, VS Code, Cursor)
Use the included .mcp.json.http.example template:
# Copy the HTTP example
cp .mcp.json.http.example .mcp.json
# Start the multi-node setup
docker-compose up --build -dThe config file points to http://localhost:3000/mcp (load-balanced endpoint).
Testing Stdio Mode
Quick Setup (Recommended)
The project includes a .mcp.json.example template that MCP clients (Claude Code, VS Code, Cursor) automatically detect.
Steps:
Copy the example config:
cp .mcp.json.example .mcp.jsonEdit
.mcp.jsonand update the absolute path and OpenRouter API keyStart Redis:
docker run -d -p 6379:6379 redis:7-alpineRestart your MCP client - tools will be available automatically
Manual Setup
Alternatively, add to your MCP client settings manually:
Note: Make sure MCP_MODE=stdio is set in your .env file.
{
"mcpServers": {
"todo": {
"command": "bun",
"args": ["run", "/absolute/path/to/src/main.ts"],
"env": {
"OPENROUTER_API_KEY": "your-key-here"
}
}
}
}Testing with MCP Inspector
The MCP Inspector provides a visual UI for testing MCP servers:
HTTP Mode
# Start the dev environment
docker-compose -f docker-compose.dev.yml up
# In another terminal, start inspector
npx @modelcontextprotocol/inspector http://localhost:3000/mcp
# Open the URL shown (usually http://localhost:6274)Stdio Mode
# Start Redis
docker run -d -p 6379:6379 redis:7-alpine
# Start inspector with stdio
npx @modelcontextprotocol/inspector bun run src/main.tsNote: Make sure MCP_MODE=stdio is set in your .env file for stdio mode to work correctly.
The inspector will open in your browser where you can:
View all available tools
Test tool calls with validation
See input/output schemas
Debug responses
Approach and Key Decisions
I have decided to implement the server in TypeScript using Bun and Hono as a web server for its performance and developer experience. I used the official MCP SDK for TypeScript to handle MCP protocol details. As Redis client, I chose ioredis for its robustness and features. For AI integration, I used Vercel's AI SDK with OpenRouter as a provider to keep it flexible and try out different models.
Multi-Node Session Management
The main challenge was implementing multi-node support without sticky sessions while working within the MCP SDK's limitations.
The Problem:
The MCP SDK's built-in session management is designed for single-node deployments
The SDK stores sessions in memory, which doesn't work across multiple nodes
Without sticky sessions, requests can land on any node
The Solution:
AsyncLocalStorage for dependency injection of
sessionIdto tool handlersStateless SDK transport (
WebStandardStreamableHTTPServerTransport) with nosessionIdGeneratorAuto-session creation on first request with
Mcp-Session-Idheader tracking
Why AsyncLocalStorage?
The SDK's tool handlers don't support custom parameters, so we can't pass sessionId directly:
// SDK API doesn't allow this:
server.registerTool('todo_add', config, async (args, sessionId) => { ... })
// We have to use:
server.registerTool('todo_add', config, async (args) => {
const sessionId = sessionContext.getStore(); // AsyncLocalStorage
})AsyncLocalStorage provides ambient context that propagates through the async call chain without modifying function signatures.
Alternative Approaches Considered:
Hardcode SDK responses - Build JSON-RPC responses manually instead of using the SDK
❌ More code to maintain
❌ Lose SDK benefits (validation, protocol handling)
✅ Full control over session handling
Modify SDK source - Fork the SDK to add session parameter support
❌ Maintenance burden
❌ Out of sync with upstream
✅ Cleaner API
Sticky sessions - Use load balancer sticky sessions
❌ Violates assignment requirements
❌ Does not scale that well
✅ Simpler implementation
AI Model response JSON Parsing
Initially attempted to use Vercel AI SDK's structured output (Output.array()), but discovered that most models don't support json_schema format via OpenRouter proxy. Therefore I reverted to parsing raw text responses with Zod validation.
Security Considerations
Session ID Exposure:
Session IDs are currently unprotected UUIDs transmitted in HTTP headers. Anyone with a session ID can:
Read all todos in that session
Create, modify, or delete todos
Access AI analysis results
For Production, Consider:
Authentication - Add proper auth (JWT, OAuth) before session creation
Session Encryption - Use signed/encrypted session tokens
Rate Limiting - Prevent session ID enumeration attacks
Session Expiry - Current 1-hour TTL helps but isn't sufficient
LLM Usage limits - Prevent abuse of AI analysis tool
Time Spent
Total: ~3.5 hours
Most of the time was spent on file-structure and testing of the functionality. Claude Code was used for brainstorming the multi-node session management approach, cleaning up syntax, documenting the code, making it easy to setup and writing this README.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/bxxf/todo-mcp-assignment'
If you have feedback or need assistance with the MCP directory API, please join our Discord server