๐ฆ Rust Things
A high-performance Rust library and CLI for Things 3 integration with integrated MCP (Model Context Protocol) server support for AI/LLM environments.
๐ฆ Version 1.0.0 - Production Ready!
โจ Features
- ๐ High Performance: Built with Rust for maximum speed and reliability
- ๐ง CLI Tool: Command-line interface for managing Things 3 data
- ๐ค MCP Integration: Integrated MCP server for AI/LLM integration
- ๐ Safe Integration: Reads via async SQLx, mutations via AppleScript (per CulturedCode guidelines)
- ๐๏ธ Moon Workspace: Organized monorepo with Moon build system
- ๐งช Well Tested: Comprehensive test suite and benchmarks
- ๐ Performance Monitoring: Built-in metrics and system monitoring
- ๐พ Caching Layer: High-performance caching with Moka
- ๐ Backup & Restore: Complete backup system with metadata
- ๐ค Data Export: Multiple formats (JSON, CSV, OPML, Markdown)
- ๐ง Advanced MCP Tools: 17 tools for AI/LLM integration
- โก Async Database: SQLx-powered async database operations with thread safety
- ๐ Web Servers: Health check and monitoring dashboard servers
๐ Installation
Homebrew (macOS)
# Add the tap (when available)
# Install
Cargo (Rust)
# Install from crates.io (when published)
# Or install from source
After upgrading:
cargo installreplaces the binary on disk, but any running MCP server process still uses the old in-memory binary. Restart the process (or your editor/agent host) after upgrading so the new version is loaded. You can verify the running version withthings3 --version.
From Source
# Add to PATH
Using Moon (Development)
# Install Moon if you haven't already
|
# Clone and setup
โ๏ธ Feature Flags
New in 1.0.0: Modular compilation with feature flags! Choose only what you need.
Library (things3-core)
[]
# Minimal (core functionality only - 24% smaller binary)
= { = "1.0", = false }
# With specific features
= { = "1.0", = ["export-csv", "observability"] }
# Full features (recommended for most users)
= { = "1.0", = ["full"] }
Available Features:
export-csv: CSV export supportexport-opml: OPML export supportobservability: Metrics, tracing, and health checksfull: Enable all featurestest-utils: Testing utilities (development only)
CLI (things3-cli)
[]
# CLI with all features
= { = "1.0", = ["full"] }
# CLI with specific features
= { = "1.0", = ["mcp-server", "export-csv"] }
Additional CLI Features:
mcp-server: MCP server functionality (requires export features)
๐ See FEATURES.md for detailed feature documentation and compatibility matrix.
๐ Quick Start
Get started in under 5 minutes! See the Quick Start Guide for detailed instructions.
Basic Library Usage
use ;
async
CLI Commands
# Show help
# Health check
# Show inbox tasks
# Show today's tasks
# Show all projects
# Show all areas
# Search for tasks
# Start MCP server (for AI/LLM integration)
# Start health check server
# Start monitoring dashboard
Environment Variables
# Set custom database path
# Enable fallback to default path
# Enable verbose logging
๐ Web Servers
The CLI includes built-in web servers for monitoring and health checks:
Health Check Server
# Start health check server
# Test health endpoint
Monitoring Dashboard
# Start monitoring dashboard
# Access dashboard
The dashboard provides:
- Real-time metrics and statistics
- Database health monitoring
- Performance metrics
- System resource usage
- Task and project analytics
๐ค MCP Integration
The MCP (Model Context Protocol) server provides 46 tools for AI/LLM integration. Common tools:
Available MCP Tools
| Tool | Description |
|---|---|
get_inbox |
Get tasks from the inbox |
get_today |
Get tasks scheduled for today |
get_projects |
Get all projects, optionally filtered by area |
get_areas |
Get all areas |
search_tasks |
Search for tasks by title or notes |
create_task |
Create a new task |
update_task |
Update an existing task |
complete_task |
Mark a task as completed |
delete_task |
Soft delete a task |
get_productivity_metrics |
Get productivity metrics |
export_data |
Export data in various formats |
bulk_create_tasks |
Create multiple tasks at once |
bulk_complete |
Complete multiple tasks at once |
bulk_move |
Move multiple tasks to a project or area |
get_recent_tasks |
Get recently modified tasks |
backup_database |
Create a database backup |
restore_database |
Restore from a backup (requires --unsafe-direct-db) |
list_backups |
List available backups |
get_performance_stats |
Get performance statistics |
get_system_metrics |
Get system resource metrics |
get_cache_stats |
Get cache performance stats |
See skills/things3/references/TOOLS.md for the full 46-tool catalog.
Configuration
Cursor
// .cursor/mcp.json
VS Code
// .vscode/mcp.json
Zed
// .zed/settings.json
Use with Claude Code / your AI agent
rust-things3 ships agent skills that let you drive Things 3 directly from Claude Code, Claude Desktop, Cursor, Zed, and any other agentskills.io-compatible host.
| Skill | What it does |
|---|---|
/things3 |
MCP setup + full tool catalog |
/things3-daily-review |
Read-only daily review โ today's tasks, inbox, overdue items |
See skills/README.md for install instructions and the full catalog.
Documentation
Getting Started
- Quick Start Guide - Get started in under 5 minutes
- User Guide - Comprehensive usage guide
- Error Handling Guide - Error handling patterns and recovery strategies
Release Documentation (1.0.0)
- Release Notes - What's new in 1.0.0
- Migration Guide - Upgrade from 0.x to 1.0.0
- Feature Flags Guide - Modular compilation with feature flags
- Security Audit - Security audit results
- Post-1.0 Roadmap - Future development plans
- Changelog - Complete version history
Core Documentation
- Architecture - System design and component overview
- MCP Integration - Complete MCP server guide
- Reliability Guide - Connection pooling, error recovery, and resilience patterns
- Performance Guide - Benchmarks and optimization strategies
- Database Schema - Things 3 database structure
- Development Guide - Setup and development workflow
- Coverage Analysis - Test coverage report
Examples
Basic Examples
See the libs/things3-core/examples/ directory for practical usage examples:
basic_usage.rs- Basic database operations (connect, query, create, update)bulk_operations.rs- Bulk operation examples (move, complete, delete)search_tasks.rs- Advanced search functionalityexport_data.rs- Data export in multiple formats (JSON, CSV, Markdown)
Integration Examples (New in 1.0.0)
Real-world integration patterns in examples/integration/:
mcp_client.rs- Custom MCP client implementationcli_extension.rs- Extending the CLI with custom commandsweb_api.rs- REST API with Axum web frameworkbackground_service.rs- Long-running service with graceful shutdowncustom_middleware.rs- Custom middleware for cross-cutting concerns
See examples/integration/README.md for detailed documentation.
API Documentation
Generate and view API documentation:
Testing
Test Coverage
- Total Tests: 438 tests
- Coverage: ~85%+ (target: 85%+)
- Test Categories:
- Database operations (Phase 1)
- MCP I/O layer (Phase 2)
- Middleware chain (Phase 3)
- Observability system (Phase 4)
Running Tests
# All tests
# Specific package
# With coverage
Running live AppleScript tests (macOS only)
The AppleScriptBackend integration tests drive a real Things 3 install
through osascript. They are gated and ignored by default โ cargo test
on CI / Linux / a Mac without Things 3 will not run them.
Prerequisites:
- macOS with Things 3 installed.
- The first invocation triggers the macOS Automation permission prompt ("rust-things3 wants to control Things3"). Grant it via System Settings โ Privacy & Security โ Automation, or the tests will fail with a clear permission-denied error.
Run with:
THINGS3_LIVE_TESTS=1
--test-threads=1 is required: every test mutates the single shared
Things 3 instance, and concurrent runs would race. Each test creates
entities with a unique rust-things3 e2e {ts}-{uuid}-style title and
deletes them on completion (a Drop guard ensures cleanup even on panic).
For background on why the project uses AppleScript instead of writing the
SQLite database directly, see CulturedCode's safety
article.
See Development Guide for more testing details.
Development
Prerequisites
- Rust 1.70+
- Moon (for workspace management)
- Things 3 (for testing)
- cargo-llvm-cov (for coverage)
Setup
# Clone the repository
# Install dependencies
# Run tests
# Run development pipeline
Quick Commands
# Format code
# Lint code
# Run coverage
# Generate docs
See Development Guide for comprehensive development information.
Project Structure
rust-things3/
โโโ apps/
โ โโโ things3-cli/ # CLI application with MCP server
โโโ libs/
โ โโโ things3-core/ # Core library
โ โโโ things3-common/ # Shared utilities
โโโ tools/
โ โโโ xtask/ # Development tools
โโโ tests/ # Integration tests
API Reference
Core Library
Basic Usage
use ;
use Result;
async
Advanced Configuration
use ;
use Path;
// Custom database path with SQLx
let db = new.await?;
// From environment variables
let config = from_env;
let db = new.await?;
Error Handling
use ;
use Result;
async
Caching and Performance
use ;
use Duration;
// Configure caching
let cache_config = CacheConfig ;
let db = with_cache_config?;
// Get cache statistics
let stats = db.get_cache_stats.await?;
println!;
Data Export
use ;
// Export to JSON
let exporter = new_default;
let json_data = exporter.export_json.await?;
// Export to CSV
let csv_data = exporter.export_csv.await?;
// Custom export configuration
let config = ExportConfig ;
let exporter = new;
MCP Server Integration
use ;
use json;
// Create MCP server
let server = new?;
// List available tools
let tools = server.list_tools.await?;
println!;
// Call a tool
let request = CallToolRequest ;
let result = server.call_tool.await?;
CLI Library
use ;
use stdout;
// Parse CLI arguments
let cli = parse;
// Use CLI functions programmatically
match cli.command
Common Utilities
use ;
// Get default database path
let db_path = get_default_database_path;
println!;
// Format dates
let formatted = format_date;
println!;
// Parse dates
let date = parse_date?;
println!;
// Validate UUIDs
let is_valid = is_valid_uuid;
println!;
// Truncate strings
let truncated = truncate_string;
println!;
Architecture
The project is organized as a Moon-managed Rust workspace:
rust-things3/
โโโ apps/things3-cli/ # CLI application with MCP server
โโโ libs/things3-core/ # Core database and business logic
โโโ libs/things3-common/ # Shared utilities
โโโ examples/ # Usage examples
โโโ docs/ # Documentation
โโโ tests/ # Integration tests
Key features:
- Async-first: Built on Tokio for concurrent operations
- Type-safe: SQLx for compile-time SQL verification
- MCP Protocol: Industry-standard AI agent communication
- Middleware: Extensible request/response processing
- Observability: Built-in metrics, logging, and tracing
See Architecture Documentation for detailed system design.
Troubleshooting
Database Not Found
# Find your Things 3 database
# Set custom path
Permission Issues
Things 3 must be running when using mutation operations (create, update, complete, delete). The default AppleScriptBackend drives Things 3 via osascript โ it requires the app to be open.
On first run, macOS will prompt: "rust-things3 wants to control Things3." Grant access via System Settings โ Privacy & Security โ Automation.
For read-only operations (inbox, today, search, etc.) Things 3 does not need to be running.
Stale Binary After Upgrade
If you upgrade via cargo install but the MCP server still behaves as if it's
on the old version, you are likely running a stale in-memory binary โ the
OS cached the old executable in memory even though the file on disk changed.
Symptoms: tool calls return errors that were fixed in the new version;
things3 --version prints the old version number when run from a fresh shell
but the running process reports something different.
Fix: restart the process or application hosting the MCP server (e.g. your
editor, Claude Desktop, or the shell running things3 mcp), then verify:
Test Failures
Run tests single-threaded if experiencing database lock issues:
See Development Guide for more troubleshooting tips.
Contributing
We welcome contributions! Please see our Contributing Guidelines for detailed information on:
- Development setup
- Code style guidelines
- Testing requirements
- Pull request process
- Issue reporting
Quick Start
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests (maintain 85%+ coverage)
- Run the development pipeline:
moon run :dev-pipeline - Submit a pull request
For more details, see CONTRIBUTING.md and Development Guide.
License
MIT License - see LICENSE file for details.
Acknowledgments
- Inspired by things3
- Built with Moon workspace management
- Follows evelion-apps/things-api patterns