ticktick-mcp-server
An MCP server that enables Claude to manage TickTick tasks and projects via OAuth 2.1 with PKCE authentication.
README
ticktick-mcp-server
TickTick MCP (Model Context Protocol) Server - An MCP server for using TickTick task management features from Claude
Overview
This MCP server enables integration with the TickTick task management platform from Claude Desktop. It implements secure authentication using OAuth 2.1 with PKCE (Proof Key for Code Exchange) and provides comprehensive task and project management capabilities.
Authentication and Authorization
OAuth 2.1 with PKCE
This server adopts the OAuth 2.1 with PKCE protocol for secure authentication:
-
PKCE Authentication Flow
- Generates code_verifier and code_challenge at the start of authentication
- Displays TickTick authentication screen in browser
- Obtains authorization code after user approval
- Exchanges tokens using authorization code and code_verifier
-
Token Storage
- Stores access tokens in
.ticktick-mcp-server-credentials.jsonfile - ⚠️ Security Warning: Tokens are currently stored in plaintext. For production use, implementing encryption is recommended
- Never expose access tokens publicly
- Stores access tokens in
-
Automatic Token Refresh
- MCP server automatically checks token expiration
- Obtains new access token using refresh token when expired
Setup Instructions
1. Configure Authentication Credentials
Configure credentials obtained from the TickTick Developer Console. Choose from one of three methods:
Method 1: ticktick-oauth.keys.json (Recommended)
Create a ticktick-oauth.keys.json file in the project root:
{
"client_id": "your_ticktick_client_id",
"client_secret": "your_ticktick_client_secret",
"redirect_uri": "http://localhost:8080/callback"
}
Method 2: Environment Variables (.env)
Create a .env file in the project root:
TICKTICK_CLIENT_ID=your_ticktick_client_id
TICKTICK_CLIENT_SECRET=your_ticktick_client_secret
TICKTICK_REDIRECT_URI=http://localhost:8080/callback
Method 3: System Environment Variables
Set directly in your shell:
export TICKTICK_CLIENT_ID=your_ticktick_client_id
export TICKTICK_CLIENT_SECRET=your_ticktick_client_secret
export TICKTICK_REDIRECT_URI=http://localhost:8080/callback
Configuration Priority:
- Settings passed directly to the constructor (specified in code)
ticktick-oauth.keys.jsonfile- Environment variables (
.envfile or system environment variables)
Note:
- When configured through multiple methods, loading follows the priority order above
- For security, these files are added to
.gitignoreand will not be committed to the repository - Replace
your_ticktick_client_idandyour_ticktick_client_secretwith actual values
Token Storage Location Configuration (Important)
Authentication tokens are saved according to the following priority:
- Path specified by
TICKTICK_CREDENTIALS_PATHenvironment variable (recommended) - User home directory (
~/.ticktick-mcp-server-credentials.json) - Current working directory (fallback)
For Claude Desktop environment, setting the TICKTICK_CREDENTIALS_PATH environment variable is strongly recommended:
export TICKTICK_CREDENTIALS_PATH=/Users/yourusername/Documents/.ticktick-mcp-server-credentials.json
2. Build the Project
npm install
npm run build
For Developers: Testing and Code Quality
# TypeScript type checking
npm run typecheck
# Code quality check with ESLint
npm run lint
# Run tests
npm test
# Check test coverage (target: 80% or higher)
npm run test:coverage
# Run tests in watch mode
npm run test:watch
3. Execute Authentication
For first-time use, authenticate with the following command:
# Start authentication flow
npm run start auth
# or
npm run start:auth
Authentication Steps
- Running the above command will automatically open a browser
- Log in to your account on the TickTick login screen
- Approve application access permissions
- Upon completion, tokens are saved to
.ticktick-mcp-server-credentials.json - "Authentication completed successfully!" message will be displayed
4. Verify Authentication Status
To verify authentication has completed successfully:
# Launch MCP Inspector to verify
npm run inspector
- Access http://localhost:5173 in your browser
- Click "Connect" in MCP Inspector
- Execute the
ticktick_auth_statustool to check authentication status
5. Normal Startup
After authentication is complete, start with:
npm run start
Available MCP Tools
Authentication Management
ticktick_auth_status: Check authentication statusticktick_authorize: Start OAuth authentication flowticktick_logout: Clear saved tokensticktick_health_check: Test API connectivity
Task Management
ticktick_list_tasks: Get task list (with filtering and sorting)ticktick_get_task: Get specific task detailsticktick_create_task: Create new taskticktick_update_task: Update task (title, content, due date, priority, checklist, etc.)- Note:
projectIdandtaskIdparameters are required (per TickTick API specification)
- Note:
ticktick_delete_task: Delete taskticktick_complete_task: Mark task as completedticktick_uncomplete_task: Mark task as incompleteticktick_search_tasks: Search tasksticktick_get_overdue_tasks: Get overdue tasks
Project Management
ticktick_list_projects: Get project listticktick_get_project: Get specific project detailsticktick_create_project: Create new projectticktick_update_project: Update projectticktick_delete_project: Delete projectticktick_get_project_tasks: Get tasks in a projectticktick_get_project_stats: Get project statisticsticktick_archive_project: Archive projectticktick_unarchive_project: Unarchive project
API Features
This MCP server is implemented based on the official TickTick OpenAPI:
Supported Operations
- ✅ Create, update, delete, and complete tasks
- ✅ Create, update, and delete projects
- ✅ Project archive functionality
- ✅ Task search and filtering
Implementation Features
- Automatic date format conversion: Auto-conversion from ISO format to TickTick API format
- Enhanced error handling: Detailed error messages and troubleshooting hints
- Rate limiting support: API client with automatic retry functionality
- PKCE-enabled OAuth: Secure authentication flow
Integration with Claude Desktop
Add the following to your Claude Desktop configuration file:
{
"mcpServers": {
"ticktick": {
"command": "/absolute/path/to/node",
"args": ["/absolute/path/to/ticktick-mcp-server/dist/index.js"],
"env": {
"TICKTICK_CLIENT_ID": "your_client_id",
"TICKTICK_CLIENT_SECRET": "your_client_secret",
"TICKTICK_REDIRECT_URI": "http://localhost:8080/callback",
"TICKTICK_CREDENTIALS_PATH": "/absolute/path/to/.ticktick-mcp-server-credentials.json",
"LOG_LEVEL": "info"
}
}
}
}
Troubleshooting
Authentication Errors
"invalid_request" Error
OAuth Error
error="invalid_request", error_description="At least one redirect_uri must be registered with the client."
Cause: No redirect URI is registered in the TickTick OAuth application.
Solution:
- Access TickTick Developer Portal
- Add the following redirect URI in application settings:
http://localhost:8080/callback - Save settings
Important: The redirect URI must match exactly (protocol, host, port, and path).
Other Authentication Errors
- Verify the contents of
ticktick-oauth.keys.jsonare correct - Confirm
redirect_uriis set tohttp://localhost:8080/callback - Check that the application is enabled in the TickTick Developer Console
Token Not Being Saved
- Check write permissions for the project directory
- Verify
.ticktick-mcp-server-credentials.jsonfile is created - Confirm file contents are valid JSON format
Re-authenticating
- Delete
.ticktick-mcp-server-credentials.jsonfile - Run
npm run start authcommand again
Latest Updates
See CHANGELOG.md for detailed change history.
v0.2.0 (Latest) - 2025-06-08
- ✅ Comprehensive test suite added: Jest configuration and unit tests (80% coverage target)
- ✅ Input validation implemented: Strict type checking and validation with Zod schemas
- ✅ Unified error handling: Consistent error response format
- ✅ ESLint configuration added: Strict code quality rules for TypeScript
- ✅ Expanded documentation: API specification, CHANGELOG, and contribution guidelines added
- ✅ Improved type safety: Eliminated
anytypes with proper type annotations
Security
Important Security Notes
-
Protecting Credentials
.ticktick-mcp-server-credentials.json- Contains authentication tokensticktick-oauth.keys.json- Contains OAuth client secrets- Never commit these files to Git
-
Recommended Security Measures
- Set appropriate permissions for credential files:
chmod 600 .ticktick-mcp-server-credentials.json - Rotate tokens regularly
- Delete unused tokens
- Implement token encryption for production environments
- Set appropriate permissions for credential files:
See Security Policy for details.
Documentation
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。