5uh417/todoist-mcp-server
If you are the rightful owner of todoist-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Todoist MCP Server is a Model Context Protocol server that integrates with Todoist, allowing AI assistants to manage tasks and projects through the Todoist API.
get_tasks
Retrieve tasks from Todoist with optional project filtering.
create_task
Create new tasks with full customization options.
complete_task
Mark tasks as completed.
get_projects
Retrieve all projects from your Todoist account.
create_project
Create new projects with optional color customization.
Todoist MCP Server
A Model Context Protocol (MCP) server that provides seamless integration with Todoist, enabling AI assistants to manage tasks and projects through the Todoist API.
Features
š§ Core Tools
-
Task Management
get_tasks
- Retrieve tasks from Todoist (with optional project filtering)create_task
- Create new tasks with full customization (priority, labels, due dates)complete_task
- Mark tasks as completed
-
Project Management
get_projects
- Retrieve all projects from your Todoist accountcreate_project
- Create new projects with optional color customization
-
Setup & Configuration
setup_todoist
- Dynamic API token configuration and connection verification
šļø Architecture
- FastMCP Framework: Built on the modern FastMCP server framework for optimal performance
- Async Operations: Full async/await support for non-blocking API calls
- Modular Design: Clean separation of concerns with dedicated modules for:
- Task operations (
src/tools/tasks.py
) - Project operations (
src/tools/projects.py
) - API client (
src/todoist_client.py
) - Resource management (
src/resources/
) - Prompt management (
src/prompts/
)
- Task operations (
š Security & Configuration
- Environment Variables: Secure API token management via
.env
files - Token Validation: Built-in connection testing and validation
- Error Handling: Comprehensive error handling with meaningful error messages
Installation
Prerequisites
- Python 3.10 or higher
- Todoist account with API access
Setup
-
Install the package
pip install -e .
-
Set up your Todoist API token
Create a
.env
file in the project root:TODOIST_API_TOKEN=your_api_token_here
Or set it as an environment variable:
export TODOIST_API_TOKEN=your_api_token_here
-
Configure Claude Desktop (if using with Claude Desktop)
Add to your
claude_desktop_config.json
:{ "mcpServers": { "todoist": { "url": "http://127.0.0.1:8000", "env": { "TODOIST_API_TOKEN": "your_api_token_here" } } } }
Usage
Running the Server
# Direct execution
python main.py
# Or using the module
python -m src.server
HTTP Server Mode
The server also supports HTTP mode for web-based integrations:
python -m uvicorn src.http_server:app --reload --port 8000
API Integration
Task Operations
# Get all tasks
tasks = await get_tasks()
# Get tasks from specific project
project_tasks = await get_tasks(project_id="12345")
# Create a new task
task = await create_task(
content="Review quarterly reports",
project_id="work_project_id",
priority=3,
due_string="tomorrow at 9am",
labels=["urgent", "review"]
)
# Complete a task
result = await complete_task(task_id="67890")
Project Operations
# Get all projects
projects = await get_projects()
# Create a new project
project = await create_project(
name="Q4 Planning",
color="blue"
)
Development
Project Structure
todoist-mcp-server/
āāā src/
ā āāā __main__.py # Module entry point
ā āāā server.py # Main MCP server setup
ā āāā http_server.py # HTTP server variant
ā āāā todoist_client.py # Todoist API client
ā āāā tools/
ā ā āāā tasks.py # Task management tools
ā ā āāā projects.py # Project management tools
ā āāā resources/
ā ā āāā todoist_resources.py # MCP resources
ā āāā prompts/
ā āāā task_prompts.py # Task-related prompts
ā āāā project_prompts.py # Project-related prompts
āāā main.py # Simple entry point
āāā pyproject.toml # Project configuration
āāā claude_desktop_config.json # Claude Desktop configuration
āāā CLAUDE.md # Development guidelines
Dependencies
- mcp[cli] (ā„1.4.0) - Model Context Protocol framework
- httpx (ā„0.25.0) - Modern HTTP client for API calls
- uvicorn (ā„0.23.0) - ASGI server for HTTP mode
- python-dotenv (ā„1.1.1) - Environment variable management
Development Commands
# Install in development mode
pip install -e .
# Run with auto-reload (development)
python -m uvicorn src.http_server:app --reload
# Test API connection
python -c "from src.todoist_client import TodoistClient; import asyncio; asyncio.run(TodoistClient().get_projects())"
Contributing
This project follows clean architecture principles:
- API Client Layer (
todoist_client.py
) - Handles all Todoist API interactions - Tools Layer (
tools/
) - MCP tool implementations - Server Layer (
server.py
) - MCP server setup and configuration - Resources & Prompts - MCP resources and prompt management
When contributing:
- Follow the existing async patterns
- Add proper error handling
- Update documentation for new features
- Test with both environment variable and dynamic token setup
License
This project is open source and available under standard licensing terms.