Skip to main content

Model Context Protocol server for todo.txt file management with AI assistants like Claude

Project description

Todo.txt MCP Server

A minimal but extensible Model Context Protocol (MCP) server that exposes todo.txt files through a structured API for use with AI clients like Claude Desktop.

Features

Phase 1 MVP (Current)

  • Full CRUD Operations: Create, read, update, delete todos
  • Todo.txt Format Compliance: Follows the todo.txt specification
  • Priority Support: Handle priority levels (A-Z)
  • Projects & Contexts: Support for +project and @context tags
  • Search & Filtering: Search by text, filter by priority, project, or context
  • Statistics: Get comprehensive stats about your todo list
  • File Safety: Automatic backups and file size limits
  • MCP Resources: Access raw file content and formatted statistics

Available MCP Tools

List & Query Tools

  • list_todos - List all todos (optionally include completed)
  • get_todo - Get a specific todo by ID
  • search_todos - Search todos by text content
  • filter_by_priority - Filter todos by priority level
  • filter_by_project - Filter todos by project
  • filter_by_context - Filter todos by context
  • get_statistics - Get comprehensive todo statistics

CRUD Tools

  • add_todo - Add a new todo item
  • complete_todo - Mark a todo as completed
  • update_todo - Update an existing todo
  • delete_todo - Delete a todo item
  • reload_todos - Reload todos from file system

Available MCP Resources

  • todo://file - Raw content of the todo.txt file
  • todo://stats - Formatted statistics about your todos

Installation

Quick Start (Recommended)

The fastest way to get started is using uvx to run the server without installing:

# Run directly without installing (recommended for testing)
uvx todo-txt-mcp

# Or install globally with uv
uv tool install todo-txt-mcp

Installation Methods

1. Using uv (Modern Python Package Manager)

# Install globally (recommended)
uv tool install todo-txt-mcp

# Or install in project
uv add todo-txt-mcp

# Run the server
uv tool run todo-txt-mcp
# or if installed in project: uv run todo-txt-mcp

2. Using pip (Traditional)

# Install globally
pip install todo-txt-mcp

# Or install for user only
pip install --user todo-txt-mcp

# Run the server
todo-txt-mcp

3. Using pipx (Isolated Installation)

# Install in isolated environment
pipx install todo-txt-mcp

# Run the server
todo-txt-mcp

From Source

git clone https://github.com/danielmeint/todo-txt-mcp.git
cd todo-txt-mcp
uv install

Development Installation

git clone https://github.com/danielmeint/todo-txt-mcp.git
cd todo-txt-mcp
uv install --dev

Usage

Command Line

Run the MCP server directly:

# Use default todo.txt in current directory
todo-txt-mcp

# Specify a custom todo.txt file
todo-txt-mcp /path/to/your/todo.txt

# Use existing todo.sh configuration (auto-detected)
todo-txt-mcp

# Specify a todo.sh config file explicitly  
todo-txt-mcp /path/to/your/todo.cfg

Integration with Existing todo.sh Setup

If you're already using todo.sh, this MCP server can automatically use your existing configuration!

The server will automatically detect and use todo.sh config files in these locations:

  • ~/.todo/config
  • ~/.todo.cfg
  • /etc/todo/config
  • /usr/local/etc/todo/config

Your existing todo.sh config variables are supported:

  • TODO_DIR - Base directory for todo files
  • TODO_FILE - Path to your todo.txt file
  • DONE_FILE - Path to your done.txt file

Example todo.sh config:

# Your todo.txt directory
export TODO_DIR="/Users/username/Dropbox/todo"

# Your todo/done/report.txt locations  
export TODO_FILE="$TODO_DIR/todo.txt"
export DONE_FILE="$TODO_DIR/done.txt"
export REPORT_FILE="$TODO_DIR/report.txt"

With Claude Desktop

Add to your Claude Desktop MCP configuration file:

Location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Option 1: Using uvx (Recommended)

{
  "mcpServers": {
    "todo-txt": {
      "command": "uvx",
      "args": ["todo-txt-mcp"]
    }
  }
}

Option 2: Using uv tool

{
  "mcpServers": {
    "todo-txt": {
      "command": "uv",
      "args": ["tool", "run", "todo-txt-mcp"]
    }
  }
}

Option 3: Direct installation

{
  "mcpServers": {
    "todo-txt": {
      "command": "todo-txt-mcp"
    }
  }
}

Option 4: With custom todo.txt file

{
  "mcpServers": {
    "todo-txt": {
      "command": "uvx",
      "args": ["todo-txt-mcp", "/Users/username/Dropbox/todo/todo.txt"]
    }
  }
}

Option 5: With environment variables

{
  "mcpServers": {
    "todo-txt": {
      "command": "uvx",
      "args": ["todo-txt-mcp"],
      "env": {
        "TODO_MCP_TODO_FILE_PATH": "/Users/username/Dropbox/todo/todo.txt",
        "TODO_MCP_BACKUP_ENABLED": "true"
      }
    }
  }
}

Restart Claude Desktop after updating the configuration file.

Configuration

Using Existing todo.sh Configuration (Recommended)

If you already use todo.sh, no additional configuration is needed! The MCP server will automatically detect and use your existing todo.sh config.

Manual Configuration

The server can also be configured via environment variables:

# File paths
TODO_MCP_TODO_FILE_PATH=/path/to/todo.txt
TODO_MCP_DONE_FILE_PATH=/path/to/done.txt

# File handling
TODO_MCP_ENCODING=utf-8
TODO_MCP_AUTO_ARCHIVE=true
TODO_MCP_BACKUP_ENABLED=true
TODO_MCP_BACKUP_COUNT=5

# Safety limits
TODO_MCP_MAX_FILE_SIZE=10000000  # 10MB

Examples

Adding Todos

# Add a simple todo
add_todo(text="Buy groceries")

# Add a todo with priority and tags
add_todo(
    text="Finish project proposal", 
    priority="A",
    projects=["work"],
    contexts=["computer", "office"]
)

Searching and Filtering

# Search for todos containing "meeting"
search_todos(query="meeting")

# Get all high-priority todos
filter_by_priority(priority="A")

# Get all work-related todos
filter_by_project(project="work")

# Get all todos for phone calls
filter_by_context(context="phone")

Managing Todos

# Complete a todo
complete_todo(todo_id="abc123")

# Update a todo
update_todo(
    todo_id="abc123",
    text="Updated task description",
    priority="B"
)

# Delete a todo
delete_todo(todo_id="abc123")

Development

Running Tests

# Run all tests
uv run pytest

# Run with verbose output
uv run pytest -v

# Run specific test file
uv run pytest tests/unit/test_todo_service.py

Project Structure

src/todo_txt_mcp/
├── __init__.py          # Package initialization
├── server.py            # Main MCP server
├── models/              # Data models
│   ├── config.py        # Configuration model
│   └── todo.py          # Todo item and list models
├── services/            # Business logic
│   ├── file_service.py  # File I/O operations
│   └── todo_service.py  # Todo business logic
└── tools/               # MCP tools
    ├── crud_tools.py    # Create/Update/Delete tools
    └── list_tools.py    # List/Query tools

Architecture

The server follows a clean architecture pattern:

  1. Models: Pydantic models for data validation and serialization
  2. Services: Business logic layer that handles todo operations
  3. Tools: MCP tool definitions that expose functionality to clients
  4. Server: FastMCP server that ties everything together

Todo.txt Format Support

The server fully supports the todo.txt format specification:

  • ✅ Basic todo items
  • ✅ Completion markers (x)
  • ✅ Priority levels ((A) through (Z))
  • ✅ Creation and completion dates
  • ✅ Projects (+project)
  • ✅ Contexts (@context)
  • ✅ Proper formatting and parsing

Example todo.txt content:

(A) Call Mom +family @phone
x 2024-01-15 2024-01-10 (B) Buy groceries +shopping @errands
Write project proposal +work @computer
(C) Schedule dentist appointment +health @phone

Roadmap

Phase 2 (Planned)

  • Due date support
  • Recurring todos
  • Advanced search with regex
  • Bulk operations
  • Import/export functionality

Phase 3 (Planned)

  • Multiple file support
  • Sync capabilities
  • Web interface
  • Plugin system
  • Advanced reporting

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Run the test suite
  6. Submit a pull request

License

[Add your license here]

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

todo_txt_mcp-1.0.1.tar.gz (114.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

todo_txt_mcp-1.0.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file todo_txt_mcp-1.0.1.tar.gz.

File metadata

  • Download URL: todo_txt_mcp-1.0.1.tar.gz
  • Upload date:
  • Size: 114.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for todo_txt_mcp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 00e3021f66396287ffa550b99c08d40c7bd77625956c961c1ccc6038130522ef
MD5 cf97e319b9da19827a8d9a9c23b54dd4
BLAKE2b-256 1566e2ab920f510ebeda19fe4bf8f193bfe3e4ea75d4845b3dd30b2d3ed47f56

See more details on using hashes here.

File details

Details for the file todo_txt_mcp-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for todo_txt_mcp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3a29a62e7c10b18aa7cbaa62aba58e7af533adcb70dde930a7db3be01027192
MD5 10db90e628549da11f853447ce81aa5e
BLAKE2b-256 21ed301d1f993be9dc5333b42eaab5e221bd22963eab5f0a33ac5383c7c119c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page