๐ฆ 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
- ๐ Comprehensive API: Full access to Things 3 database with async SQLx
- ๐๏ธ 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
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 21 tools for AI/LLM integration:
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 |
get_productivity_metrics |
Get productivity metrics |
export_data |
Export data in various formats |
bulk_create_tasks |
Create multiple tasks at once |
get_recent_tasks |
Get recently modified tasks |
backup_database |
Create a database backup |
restore_database |
Restore from a backup |
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 |
Configuration
Cursor
// .cursor/mcp.json
VS Code
// .vscode/mcp.json
Zed
// .zed/settings.json
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
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
Ensure Things 3 is closed when running the CLI:
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