timothysanders/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 Model Context Protocol (MCP) server is designed to facilitate communication and data exchange between different components of a system, particularly in environments utilizing machine learning models.
Todoist MCP Server
A Model Context Protocol (MCP) server that provides seamless integration with Todoist, allowing AI assistants like Claude to interact with your Todoist tasks and projects.
Features
This MCP server provides the following tools for Todoist integration:
Task Management
get_tasks
- Retrieve tasks with powerful filtering optionscreate_task
- Create new tasks with full parameter supportupdate_task
- Update existing taskscomplete_task
- Mark tasks as completeddelete_task
- Delete tasks permanently
Project & Label Management
get_projects
- Retrieve all projectscreate_label
- Create a new labelget_labels
- Retrieve all labels
Prerequisites
- Python 3.10 or higher
- A Todoist account with API access
- Todoist API token (bearer token)
Installation
1. Clone the Repo
git clone https://github.com/timothysanders/todoist-mcp-server.git
cd todoist-mcp-server
2. Set up the Project
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
3. Install Dependencies
Using the requirements file:
pip install -r requirements.txt
4. Get Your Todoist API Token
- Go to Todoist Integrations
- Create a new app or use an existing one
- Copy your API token
5. Configure Environment
Create a .env
file or set the environment variable:
export TODOIST_TOKEN="your_bearer_token_here"
Or create a .env
file (using the sample .env.example
):
TODOIST_TOKEN=your_bearer_token_here
Usage
Running the Server Standalone
python todoist_mcp_server.py
Testing with MCP Inspector
Install the MCP CLI tools:
pip install "mcp[cli]"
Test your server:
mcp dev todoist_mcp_server.py
This will open a web interface where you can test all the tools.
Integration with Claude Desktop
Add the following configuration to your claude_desktop_config.json
file:
macOS
Location: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows
Location: %APPDATA%\Claude\claude_desktop_config.json
Configuration
{
"mcpServers": {
"todoist": {
"command": "/absolute/path/to/virtual/environment/python",
"args": ["/absolute/path/to/todoist_mcp_server.py"],
"env": {
"TODOIST_TOKEN": "your_bearer_token_here"
}
}
}
}
Important Notes:
- Use the absolute path to your
todoist_mcp_server.py
file - You may need to use the full path to your Python executable (e.g.,
/path/to/venv/bin/python
) - On Windows, use double backslashes (
\\
) or forward slashes (/
) in paths - After adding the configuration, restart Claude Desktop
Tool Examples
Once integrated with Claude, you can use natural language to interact with your Todoist:
Reading Tasks
- "What tasks do I have today?"
- "Show me all my overdue tasks"
- "List tasks in my Work project"
- "What tasks are labeled with @urgent?"
Creating Tasks
- "Create a task to buy groceries"
- "Add a high-priority task to finish the report by tomorrow"
- "Create a subtask under my project planning task"
Managing Tasks
- "Mark my grocery shopping task as complete"
- "Update my meeting task to be due next Friday"
- "Delete the old planning task"
- "Change the priority of my report task to urgent"
Projects and Labels
- "Show me all my projects"
- "List all available labels"
- "Create a label with the color olive green and mark is as a favorite"
API Reference
get_tasks
Retrieve tasks with optional filtering.
Parameters:
project_id
(optional): Filter by project IDlabel_id
(optional): Filter by label IDfilter_expr
(optional): Todoist filter expressionlang
(optional): Language for filter parsing (default: "en")
Filter Examples:
"today"
- Tasks due today"overdue"
- Overdue tasks"@work"
- Tasks with the "work" label"p1"
- Priority 1 (urgent) tasks"next 7 days"
- Tasks due in the next week
create_task
Create a new task.
Parameters:
content
(required): Task titledescription
(optional): Task descriptionproject_id
(optional): Project to add task topriority
(optional): 1 (normal) to 4 (urgent)due_string
(optional): Natural language due datelabels
(optional): List of label names
create_project
Create a new project
Parameters:
name
(required): Name for new projectdescription
(optional): Project descriptionparent_id
(optional): The parent project to link the new project tocolor
(optional): The color to assign to the new projectis_favorite
(optional): Whether to mark this project as a favorite
create_label
Create a new label
Parameters:
name
(required): Name for the new labelcolor
(optional): The color to assign to the new labelis_favorite
(optional): Whether to mark this label as a favorite
Other Tools
All tools return JSON responses and include comprehensive error handling.
Error Handling
The server includes robust error handling:
- Invalid API tokens are caught at startup
- HTTP errors are logged and returned as JSON
- Network timeouts are handled gracefully
- All errors include descriptive messages
Logging
The server logs to stderr (not stdout to avoid interfering with MCP protocol):
- INFO level for normal operations
- ERROR level for failures
- All requests and responses are logged for debugging
Development
Project Structure
todoist-mcp-server/
āāā todoist_mcp_server.py # Main server implementation
āāā requirements.txt # Python dependencies
āāā pyproject.toml # Project configuration
āāā .env.example # Environment template
āāā README.md # This file
Branch Naming Conventions
General Format: type/issue-number-brief-description
Types:
feature/
- New functionality or enhancementsbug/
- Bug fixeshotfix/
- Critical fixesdocs/
- Documentation updatesrefactor/
- Code refactoringtest/
- Adding or updating testschore/
- Maintenance tasks
Examples
feature/23-add-project-creation
bug/45-fix-task-completion-error
docs/12-update-api-documentation
refactor/67-restructure-task-handlers
test/34-add-integration-tests
hotfix/89-critical-auth-bug
Contributing
- Follow the existing code style with type hints and docstrings
- All functions should have comprehensive Numpy-style docstrings
- Add appropriate error handling for new features
- Test new tools with the MCP Inspector before