Ticktick Sdkのロゴ

Ticktick Sdk

コミュニティ
dev-mirzabicer

A comprehensive async Python library for TickTick with MCP support.

公開者dev-mirzabicer
リポジトリticktick-sdk
言語Python
フォーク
41
スター
141
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Ticktick Sdkは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには141件のスターと41件のフォークがあります。

ticktick-sdk: A TickTick MCP Server & Full Python SDK

PyPI - Version Python 3.11+ License: MIT PyPI Downloads

A comprehensive async Python SDK for TickTick with MCP (Model Context Protocol) server support.

Includes full support for Dida365 (滴答清单) as well.

Use TickTick programmatically from Python, or let AI assistants manage your tasks.

Table of Contents


Features

MCP Server

  • 43 Tools: Streamlined coverage of TickTick functionality
  • Batch Operations: All mutations accept lists (1-100 items) for bulk operations
  • AI-Ready: Works with Claude, GPT, and other MCP-compatible assistants
  • Dual Output: Markdown for humans, JSON for machines

Python Library

  • Full Async Support: Built on httpx for high-performance async operations
  • Batch Operations: Create, update, delete, complete up to 100 tasks in a single call
  • Complete Task Management: Create, read, update, delete, complete, move, pin tasks
  • Kanban Boards: Full column management (create, update, delete, move tasks between columns)
  • Project Organization: Projects, folders, kanban boards
  • Tag System: Hierarchical tags with colors
  • Habit Tracking: Full CRUD for habits with batch check-ins, streaks, and goals
  • Focus/Pomodoro: Access focus session data and statistics
  • User Analytics: Productivity scores, levels, completion rates

Developer Experience

  • Type-Safe: Full Pydantic v2 validation with comprehensive type hints
  • Well-Tested: 300+ tests covering both mock and live API interactions
  • Documented: Extensive docstrings and examples

Why This Library?

The Two-API Problem

TickTick has two different APIs:

APITypeWhat We Use It For
V1 (OAuth2)Official, documentedProject with all tasks, basic operations
V2 (Session)Unofficial, reverse-engineeredTags, folders, habits, focus, subtasks, and more

The official V1 API is limited. Most of TickTick's power features (tags, habits, focus tracking) are only available through the undocumented V2 web API. This library combines both, routing each operation to the appropriate API automatically.

Compared to Other Libraries

Based on analysis of the actual source code of available TickTick Python libraries:

Featureticktick-sdkpyticktickticktick-pytickthonticktick-python
I/O ModelAsyncAsyncSyncSyncSync
Type SystemPydantic V2Pydantic V2Dictsattrsaddict
MCP ServerYesNoNoNoNo
HabitsFull CRUDNoBasicBasicNo
Focus/PomoYesYesYesYesNo
Unified V1+V2Smart RoutingSeparateBothV2 onlyV2 only
SubtasksAdvancedBatchYesBasicBasic
TagsFull (merge/rename)YesYesYesNo

Key Differentiators:

  • MCP Server: Only ticktick-sdk provides AI assistant integration via Model Context Protocol
  • Unified API Routing: Automatically routes operations to V1 or V2 based on feature requirements
  • Full Habit CRUD: Complete habit management including check-ins, streaks, archive/unarchive
  • Async-First: Built on httpx for high-performance async operations

Installation

bash
pip install ticktick-sdk

Requirements:

  • Python 3.11+
  • TickTick account (free or Pro)

MCP Server Setup & Usage

Use TickTick with AI assistants like Claude through the Model Context Protocol.

Step 1: Register Your App

  1. Go to the TickTick Developer Portal
  2. Click "Create App"
  3. Fill in:
    • App Name: e.g., "My TickTick MCP"
    • Redirect URI: http://127.0.0.1:8080/callback
  4. Save your Client ID and Client Secret

Step 2: Get OAuth2 Access Token

Run the auth command with your credentials:

bash
TICKTICK_CLIENT_ID=your_client_id \
TICKTICK_CLIENT_SECRET=your_client_secret \
ticktick-sdk auth

This will:

  1. Open your browser to TickTick's authorization page
  2. Authorize the app - Click "Authorize" to grant access
  3. Return to terminal - After authorizing, you'll see output like this:
============================================================
  SUCCESS! Here is your access token:
============================================================

a]234abc-5678-90de-f012-34567890abcd

============================================================

NEXT STEPS:

For Claude Code users:
  Run (replace YOUR_* placeholders):
    claude mcp add ticktick \
      -e TICKTICK_CLIENT_ID=YOUR_CLIENT_ID \
      ...
  1. Copy this token - You'll need it in the next step

Note: Sometimes the browser shows an "invalid credentials" error page. Just refresh the page and it should work.

SSH/Headless Users: Add --manual flag for a text-based flow that doesn't require a browser.

Step 3: Configure Your AI Assistant

Claude Code (Recommended)

bash
claude mcp add ticktick \
  -e TICKTICK_CLIENT_ID=your_client_id \
  -e TICKTICK_CLIENT_SECRET=your_client_secret \
  -e TICKTICK_ACCESS_TOKEN=your_access_token \
  -e TICKTICK_USERNAME=your_email \
  -e TICKTICK_PASSWORD=your_password \
  -- ticktick-sdk

Note: For TICKTICK_ACCESS_TOKEN, paste the token you copied from Step 2.

Verify it's working:

bash
claude mcp list        # See all configured servers
/mcp                   # Within Claude Code, check server status

Claude Desktop

Add to your Claude Desktop config:

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

json
{
  "mcpServers": {
    "ticktick": {
      "command": "ticktick-sdk",
      "env": {
        "TICKTICK_CLIENT_ID": "your_client_id",
        "TICKTICK_CLIENT_SECRET": "your_client_secret",
        "TICKTICK_ACCESS_TOKEN": "your_access_token",
        "TICKTICK_USERNAME": "your_email",
        "TICKTICK_PASSWORD": "your_password"
      }
    }
  }
}

Other MCP-Compatible Tools

This server works with any tool that supports the Model Context Protocol, which includes most modern AI assistants and IDEs. The configuration is similar - you just need to provide the command (ticktick-sdk) and the environment variables shown above.

CLI Reference

The ticktick-sdk command provides several subcommands:

CommandDescription
ticktick-sdkStart the MCP server (default)
ticktick-sdk serverStart the MCP server (explicit)
ticktick-sdk server --host HOSTUse specific API host (ticktick.com or dida365.com)
ticktick-sdk server --enabledModules MODULESEnable only specific tool modules (comma-separated)
ticktick-sdk server --enabledTools TOOLSEnable only specific tools (comma-separated)
ticktick-sdk authGet OAuth2 access token (opens browser)
ticktick-sdk auth --manualGet OAuth2 access token (SSH-friendly)
ticktick-sdk --versionShow version information
ticktick-sdk --helpShow help message

Tool Filtering (reduces context window usage for AI assistants):

bash
# Enable only task and project tools
ticktick-sdk server --enabledModules tasks,projects

# Enable specific tools only
ticktick-sdk server --enabledTools ticktick_create_tasks,ticktick_list_tasks

# Available modules: tasks, projects, folders, columns, tags, habits, user, focus

Example Conversations

Once configured, you can ask Claude things like:

  • "What tasks do I have due today?"
  • "Create a task to call John tomorrow at 2pm"
  • "Show me my high priority tasks"
  • "Mark the grocery shopping task as complete"
  • "What's my current streak for the Exercise habit?"
  • "Check in my meditation habit for today"
  • "Create a new habit to drink 8 glasses of water daily"

Available MCP Tools (43 Total)

All mutation tools accept lists for batch operations (1-100 items).

Task Tools (Batch-Capable)

ToolDescription
ticktick_create_tasksCreate 1-50 tasks with titles, dates, tags, etc.
ticktick_get_taskGet task details by ID
ticktick_list_tasksList tasks (active/completed/abandoned/deleted via status filter)
ticktick_update_tasksUpdate 1-100 tasks (includes column assignment)
ticktick_complete_tasksComplete 1-100 tasks
ticktick_delete_tasksDelete 1-100 tasks (moves to trash)
ticktick_move_tasksMove 1-50 tasks between projects
ticktick_set_task_parentsSet parent-child relationships for 1-50 tasks
ticktick_unparent_tasksRemove parent relationships from 1-50 tasks
ticktick_search_tasksSearch tasks by text
ticktick_pin_tasksPin or unpin 1-100 tasks

Project Tools

ToolDescription
ticktick_list_projectsList all projects
ticktick_get_projectGet project details with tasks
ticktick_create_projectCreate a new project
ticktick_update_projectUpdate project properties
ticktick_delete_projectDelete a project

Folder Tools

ToolDescription
ticktick_list_foldersList all folders
ticktick_create_folderCreate a folder
ticktick_rename_folderRename a folder
ticktick_delete_folderDelete a folder

Kanban Column Tools

ToolDescription
ticktick_list_columnsList columns for a kanban project
ticktick_create_columnCreate a kanban column
ticktick_update_columnUpdate column name or order
ticktick_delete_columnDelete a kanban column

Tag Tools

ToolDescription
ticktick_list_tagsList all tags
ticktick_create_tagCreate a tag with color
ticktick_update_tagUpdate tag properties (includes rename via label)
ticktick_delete_tagDelete a tag
ticktick_merge_tagsMerge two tags

Habit Tools (Batch-Capable)

ToolDescription
ticktick_habitsList all habits
ticktick_habitGet habit details
ticktick_habit_sectionsList sections (morning/afternoon/night)
ticktick_create_habitCreate a new habit
ticktick_update_habitUpdate habit properties (includes archive/unarchive)
ticktick_delete_habitDelete a habit
ticktick_checkin_habitsCheck in 1-50 habits (supports backdating)
ticktick_habit_checkinsGet check-in history

User & Analytics Tools

ToolDescription
ticktick_get_profileGet user profile
ticktick_get_statusGet account status
ticktick_get_statisticsGet productivity stats
ticktick_get_preferencesGet user preferences
ticktick_focus_heatmapGet focus heatmap data
ticktick_focus_by_tagGet focus time by tag

Python Library Setup & Usage

Use TickTick programmatically in your Python applications.

Setup

Step 1: Register Your App

Same as MCP setup - go to the TickTick Developer Portal and create an app.

Step 2: Create Your .env File

Create a .env file in your project directory:

bash
# V1 API (OAuth2)
TICKTICK_CLIENT_ID=your_client_id_here
TICKTICK_CLIENT_SECRET=your_client_secret_here
TICKTICK_REDIRECT_URI=http://127.0.0.1:8080/callback
TICKTICK_ACCESS_TOKEN=  # Will be filled in Step 3

# V2 API (Session)
TICKTICK_USERNAME=your_ticktick_email@example.com
TICKTICK_PASSWORD=your_ticktick_password

# Optional
TICKTICK_TIMEOUT=30

Step 3: Get OAuth2 Access Token

bash
# Source your .env file first, or export the variables
ticktick-sdk auth

Copy the access token to your .env file.

Step 4: Verify Setup

python
import asyncio
from ticktick_sdk import TickTickClient

async def test():
    async with TickTickClient.from_settings() as client:
        profile = await client.get_profile()
        print(f'Connected as: {profile.display_name}')

asyncio.run(test())

Quick Start

python
import asyncio
from ticktick_sdk import TickTickClient

async def main():
    async with TickTickClient.from_settings() as client:
        # Create a task
        task = await client.create_task(
            title="Learn ticktick-sdk",
            tags=["python", "productivity"],
        )
        print(f"Created: {task.title} (ID: {task.id})")

        # List all tasks
        tasks = await client.get_all_tasks()
        print(f"You have {len(tasks)} active tasks")

        # Complete the task
        await client.complete_task(task.id, task.project_id)
        print("Task completed!")

asyncio.run(main())

Tasks

Creating Tasks

python
from datetime import datetime, timedelta
from ticktick_sdk import TickTickClient

async with TickTickClient.from_settings() as client:
    # Simple task
    task = await client.create_task(title="Buy groceries")

    # Task with due date and priority
    task = await client.create_task(
        title="Submit report",
        due_date=datetime.now() + timedelta(days=1),
        priority="high",  # none, low, medium, high
    )

    # Task with tags and content
    task = await client.create_task(
        title="Review PR #123",
        content="Check for:\n- Code style\n- Tests\n- Documentation",
        tags=["work", "code-review"],
    )

    # Recurring task (MUST include start_date!)
    task = await client.create_task(
        title="Daily standup",
        start_date=datetime(2025, 1, 20, 9, 0),
        recurrence="RRULE:FREQ=DAILY;BYDAY=MO,TU,WE,TH,FR",
    )

    # Task with reminder
    task = await client.create_task(
        title="Meeting with team",
        due_date=datetime(2025, 1, 20, 14, 0),
        reminders=["TRIGGER:-PT15M"],  # 15 minutes before
    )

    # All-day task
    task = await client.create_task(
        title="Project deadline",
        due_date=datetime(2025, 1, 31),
        all_day=True,
    )

Managing Tasks

python
async with TickTickClient.from_settings() as client:
    # Get a specific task
    task = await client.get_task(task_id="...")

    # Update a task
    task.title = "Updated title"
    task.priority = 5  # high priority
    await client.update_task(task)

    # Complete a task
    await client.complete_task(task_id="...", project_id="...")

    # Delete a task (moves to trash)
    await client.delete_task(task_id="...", project_id="...")

    # Move task to another project
    await client.move_task(
        task_id="...",
        from_project_id="...",
        to_project_id="...",
    )

Subtasks

python
async with TickTickClient.from_settings() as client:
    # Create parent task
    parent = await client.create_task(title="Main task")

    # Create child task
    child = await client.create_task(title="Subtask")

    # Make it a subtask (parent_id in create is ignored by API)
    await client.make_subtask(
        task_id=child.id,
        parent_id=parent.id,
        project_id=child.project_id,
    )

    # Remove parent relationship
    await client.unparent_subtask(
        task_id=child.id,
        project_id=child.project_id,
    )

Querying Tasks

python
async with TickTickClient.from_settings() as client:
    # All active tasks
    all_tasks = await client.get_all_tasks()

    # Tasks due today
    today = await client.get_today_tasks()

    # Overdue tasks
    overdue = await client.get_overdue_tasks()

    # Tasks by tag
    work_tasks = await client.get_tasks_by_tag("work")

    # Tasks by priority
    urgent = await client.get_tasks_by_priority("high")

    # Search tasks
    results = await client.search_tasks("meeting")

    # Recently completed
    completed = await client.get_completed_tasks(days=7, limit=50)

    # Abandoned tasks ("won't do")
    abandoned = await client.get_abandoned_tasks(days=30)

    # Deleted tasks (in trash)
    deleted = await client.get_deleted_tasks(limit=50)

Projects & Folders

Projects

python
async with TickTickClient.from_settings() as client:
    # List all projects
    projects = await client.get_all_projects()
    for project in projects:
        print(f"{project.name} ({project.id})")

    # Get project with all its tasks
    project_data = await client.get_project_tasks(project_id="...")
    print(f"Project: {project_data.project.name}")
    print(f"Tasks: {len(project_data.tasks)}")

    # Create a project
    project = await client.create_project(
        name="Q1 Goals",
        color="#4A90D9",
        view_mode="kanban",  # list, kanban, timeline
    )

    # Update a project
    await client.update_project(
        project_id=project.id,
        name="Q1 Goals 2025",
        color="#FF5500",
    )

    # Delete a project
    await client.delete_project(project_id="...")

Folders (Project Groups)

python
async with TickTickClient.from_settings() as client:
    # List all folders
    folders = await client.get_all_folders()

    # Create a folder
    folder = await client.create_folder(name="Work Projects")

    # Create project in folder
    project = await client.create_project(
        name="Client A",
        folder_id=folder.id,
    )

    # Rename a folder
    await client.rename_folder(folder_id=folder.id, name="Work")

    # Delete a folder
    await client.delete_folder(folder_id="...")

Tags

Tags in TickTick support hierarchy (parent-child relationships) and custom colors.

python
async with TickTickClient.from_settings() as client:
    # List all tags
    tags = await client.get_all_tags()
    for tag in tags:
        print(f"{tag.label} ({tag.name}) - {tag.color}")

    # Create a tag
    tag = await client.create_tag(
        name="urgent",
        color="#FF0000",
    )

    # Create nested tag
    child_tag = await client.create_tag(
        name="critical",
        parent="urgent",  # Parent tag name
    )

    # Rename a tag
    await client.rename_tag(old_name="urgent", new_name="priority")

    # Update tag color or parent
    await client.update_tag(
        name="priority",
        color="#FF5500",
    )

    # Merge tags (move all tasks from source to target)
    await client.merge_tags(source="old-tag", target="new-tag")

    # Delete a tag
    await client.delete_tag(name="obsolete")

Habits

TickTick habits are recurring activities you want to track daily.

Habit Types

TypeDescriptionExample
BooleanSimple yes/no"Did you exercise today?"
RealNumeric counter"How many pages did you read?"

Creating and Managing Habits

python
async with TickTickClient.from_settings() as client:
    # List all habits
    habits = await client.get_all_habits()

    # Boolean habit (yes/no)
    exercise = await client.create_habit(
        name="Exercise",
        color="#4A90D9",
        reminders=["07:00", "19:00"],
        target_days=30,
        encouragement="Stay strong!",
    )

    # Numeric habit
    reading = await client.create_habit(
        name="Read",
        habit_type="Real",
        goal=30,           # 30 pages per day
        step=5,            # +5 button increment
        unit="Pages",
    )

    # Check in a habit (today)
    habit = await client.checkin_habit("habit_id")
    print(f"Streak: {habit.current_streak} days!")

    # Check in for a past date (backdate)
    from datetime import date
    habit = await client.checkin_habit("habit_id", checkin_date=date(2025, 12, 15))

    # Archive/unarchive
    await client.archive_habit("habit_id")
    await client.unarchive_habit("habit_id")

Habit Repeat Rules (RRULE Format)

ScheduleRRULE
Daily (every day)RRULE:FREQ=WEEKLY;BYDAY=SU,MO,TU,WE,TH,FR,SA
Weekdays onlyRRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
Weekends onlyRRULE:FREQ=WEEKLY;BYDAY=SA,SU
X times per weekRRULE:FREQ=WEEKLY;TT_TIMES=5
Specific daysRRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR

Focus/Pomodoro

python
from datetime import date, timedelta

async with TickTickClient.from_settings() as client:
    # Focus heatmap (like GitHub contribution graph)
    heatmap = await client.get_focus_heatmap(
        start_date=date.today() - timedelta(days=90),
        end_date=date.today(),
    )

    # Focus time by tag
    by_tag = await client.get_focus_by_tag(days=30)
    for tag, seconds in sorted(by_tag.items(), key=lambda x: -x[1]):
        hours = seconds / 3600
        print(f"  {tag}: {hours:.1f} hours")

User & Statistics

python
async with TickTickClient.from_settings() as client:
    # User profile
    profile = await client.get_profile()
    print(f"Username: {profile.username}")

    # Account status
    status = await client.get_status()
    print(f"Pro User: {status.is_pro}")
    print(f"Inbox ID: {status.inbox_id}")

    # Productivity statistics
    stats = await client.get_statistics()
    print(f"Level: {stats.level}")
    print(f"Score: {stats.score}")
    print(f"Tasks completed today: {stats.today_completed}")

Error Handling

python
from ticktick_sdk import (
    TickTickClient,
    TickTickError,
    TickTickNotFoundError,
    TickTickAuthenticationError,
    TickTickRateLimitError,
    TickTickValidationError,
)

async with TickTickClient.from_settings() as client:
    try:
        task = await client.get_task("nonexistent-id")
    except TickTickNotFoundError as e:
        print(f"Task not found: {e}")
    except TickTickAuthenticationError:
        print("Authentication failed - check credentials")
    except TickTickRateLimitError:
        print("Rate limited - wait and retry")
    except TickTickValidationError as e:
        print(f"Invalid input: {e}")
    except TickTickError as e:
        print(f"TickTick error: {e}")

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    Your Application                         │
│              (or MCP Server for AI Assistants)              │
└─────────────────────────┬───────────────────────────────────┘
                          │
┌─────────────────────────▼───────────────────────────────────┐
│                    TickTickClient                           │
│            High-level, user-friendly async API              │
│   (tasks, projects, tags, habits, focus, user methods)      │
└─────────────────────────┬───────────────────────────────────┘
                          │
┌─────────────────────────▼───────────────────────────────────┐
│                  UnifiedTickTickAPI                         │
│        Routes calls to V1 or V2, converts responses         │
│              to unified Pydantic models                     │
└─────────────────────────┬───────────────────────────────────┘
                          │
           ┌──────────────┴──────────────┐
           ▼                             ▼
┌──────────────────────┐      ┌──────────────────────┐
│      V1 API          │      │      V2 API          │
│     (OAuth2)         │      │     (Session)        │
│                      │      │                      │
│ • Official API       │      │ • Unofficial API     │
│ • Project with tasks │      │ • Tags, folders      │
│ • Limited features   │      │ • Habits, focus      │
│                      │      │ • Full subtasks      │
└──────────────────────┘      └──────────────────────┘

Key Design Decisions

  1. V2-First: Most operations use V2 API (more features), falling back to V1 only when needed
  2. Unified Models: Single set of Pydantic models regardless of which API provides the data
  3. Async Throughout: All I/O operations are async for performance
  4. Type Safety: Full type hints and Pydantic validation

API Reference

Models

ModelDescription
TaskTask with title, dates, priority, tags, subtasks, recurrence, etc.
ProjectProject/list container for tasks
ProjectGroupFolder for organizing projects
ProjectDataProject with its tasks (from get_project_tasks)
ColumnKanban column for organizing tasks in boards
TagTag with name, label, color, and optional parent
HabitRecurring habit with type, goals, streaks, and check-ins
HabitSectionTime-of-day grouping (morning/afternoon/night)
HabitCheckinIndividual habit check-in record
HabitPreferencesUser habit settings
UserUser profile information
UserStatusAccount status (Pro, inbox ID, etc.)
UserStatisticsProductivity statistics (level, score, counts)
ChecklistItemSubtask/checklist item within a task

Enums

EnumValues
TaskStatusABANDONED (-1), ACTIVE (0), COMPLETED (2)
TaskPriorityNONE (0), LOW (1), MEDIUM (3), HIGH (5)
TaskKindTEXT, NOTE, CHECKLIST
ProjectKindTASK, NOTE
ViewModeLIST, KANBAN, TIMELINE

Exceptions

ExceptionDescription
TickTickErrorBase exception for all errors
TickTickAuthenticationErrorAuthentication failed
TickTickNotFoundErrorResource not found
TickTickValidationErrorInvalid input data
TickTickRateLimitErrorRate limit exceeded
TickTickConfigurationErrorMissing configuration
TickTickForbiddenErrorAccess denied
TickTickServerErrorServer-side error

Important: TickTick API Quirks

TickTick's API has several unique behaviors you should know about:

1. Recurrence Requires start_date

If you create a recurring task without a start_date, TickTick silently ignores the recurrence rule.

python
# WRONG - recurrence will be ignored!
task = await client.create_task(
    title="Daily standup",
    recurrence="RRULE:FREQ=DAILY",
)

# CORRECT
task = await client.create_task(
    title="Daily standup",
    start_date=datetime(2025, 1, 20, 9, 0),
    recurrence="RRULE:FREQ=DAILY",
)

2. Subtasks Require Separate Call

Setting parent_id during task creation is ignored by the API:

python
# Create the child task first
child = await client.create_task(title="Subtask")

# Then make it a subtask
await client.make_subtask(
    task_id=child.id,
    parent_id="parent_task_id",
    project_id=child.project_id,
)

3. Soft Delete

Deleting tasks moves them to trash (deleted=1) rather than permanently removing them.

4. Date Clearing

To clear a task's due_date, you must also clear start_date:

python
task.due_date = None
task.start_date = None
await client.update_task(task)

5. Tag Order Not Preserved

The API does not preserve tag order - tags may be returned in any order.

6. Inbox is Special

The inbox is a special project that cannot be deleted. Get its ID via await client.get_status().


Environment Variables

VariableRequiredDescription
TICKTICK_CLIENT_IDYesOAuth2 client ID from developer portal
TICKTICK_CLIENT_SECRETYesOAuth2 client secret
TICKTICK_ACCESS_TOKENYesOAuth2 access token (from auth command)
TICKTICK_USERNAMEYesYour TickTick email
TICKTICK_PASSWORDYesYour TickTick password
TICKTICK_REDIRECT_URINoOAuth2 redirect URI (default: http://127.0.0.1:8080/callback)
TICKTICK_HOSTNoAPI host: ticktick.com (default) or dida365.com (Chinese)
TICKTICK_TIMEOUTNoRequest timeout in seconds (default: 30)
TICKTICK_DEVICE_IDNoDevice ID for V2 API (auto-generated)

Running Tests

bash
# Install dev dependencies
pip install -e ".[dev]"

# All tests (mock mode - no API calls)
pytest

# With verbose output
pytest -v

# Live tests (requires credentials)
pytest --live

# With coverage
pytest --cov=ticktick_sdk --cov-report=term-missing

Test Markers

MarkerDescription
unitUnit tests (fast, isolated)
tasksTask-related tests
projectsProject-related tests
tagsTag-related tests
habitsHabit-related tests
focusFocus/Pomodoro tests
pinningTask pinning tests
columnsKanban column tests
mock_onlyTests that only work with mocks
live_onlyTests that only run with --live

Troubleshooting

"Token exchange failed"

  • Verify your Client ID and Client Secret are correct
  • Ensure the Redirect URI matches exactly (including trailing slashes)
  • Check that you're using the correct TickTick developer portal

"Authentication failed"

  • Check your TickTick username (email) and password
  • Try logging into ticktick.com to verify credentials

"V2 initialization failed"

  • Your password may contain special characters - try changing it
  • Check for 2FA/MFA (not currently supported)

"Rate limit exceeded"

  • Wait 30-60 seconds before retrying
  • Reduce the frequency of API calls

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Write tests for new functionality
  4. Ensure all tests pass (pytest)
  5. Run type checking (mypy src/)
  6. Submit a pull request

Development Setup

bash
git clone https://github.com/dev-mirzabicer/ticktick-sdk.git
cd ticktick-sdk
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

License

MIT License - see LICENSE for details.


Acknowledgments

インストール

TypingMind
{
  "mcpServers": {
    "ticktick-sdk": {
      "command": "ticktick-sdk",
      "args": [],
      "env": {
        "TICKTICK_CLIENT_ID": "<TICKTICK_CLIENT_ID>",
        "TICKTICK_CLIENT_SECRET": "<TICKTICK_CLIENT_SECRET>",
        "TICKTICK_REDIRECT_URI": "<TICKTICK_REDIRECT_URI>",
        "TICKTICK_ACCESS_TOKEN": "<TICKTICK_ACCESS_TOKEN>",
        "TICKTICK_USERNAME": "<TICKTICK_USERNAME>",
        "TICKTICK_PASSWORD": "<TICKTICK_PASSWORD>"
      }
    }
  }
}

Ticktick SdkのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Ticktick Sdkに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Ticktick Sdkをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Ticktick SdkのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "ticktick-sdk": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてTicktick SdkのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Ticktick SdkのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Ticktick Sdkを使ってこのタスクを手伝ってもらえますか?
Ticktick Sdk
はい、読みました。
Ticktick Sdkで調べた結果をお伝えします。

よくある質問

Ticktick Sdk MCPサーバーは何に使いますか?

Ticktick Sdkは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでTicktick Sdk MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでTicktick Sdkを利用できます。

TypingMindでTicktick Sdk MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Ticktick Sdkを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Ticktick Sdk MCPをTypingMindに接続するにはどうすればよいですか?

Ticktick SdkはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでTicktick Sdk MCPのどのようなツールを利用できますか?

Ticktick SdkはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Ticktick Sdk MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Ticktick Sdkで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇