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.0.tar.gz (119.3 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.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for todo_txt_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1f2b48408d5536f399c8a94b43294bf8f5f81d924ab29406471db7f16ea8c1b1
MD5 85bef93122d68e83ed26b2bc06b484eb
BLAKE2b-256 c7d820aaf51ce753d84a1fa247337d81fc6ace16141bc4b43243c496298032fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for todo_txt_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd4fbe62d484d4898f17b00fc2f3941bbb1b55010b9e609be81448378690c632
MD5 3693784107ae3dacf97329dea9185b27
BLAKE2b-256 d8a5d032288facb58a61c6bb9658e250c31b94f6ac8d093192cfab475955c690

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