Skip to content

anthony-maio/ontask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Personal Context Server

An open-source, privacy-first personal context tracking system for knowledge workers. Track what you're working on, when you switch contexts, and expose that information to AI tools via MCP.

Why?

Knowledge workers lose track of their work. You start 10 things, finish 2, and forget about the other 8. Personal Context Server helps you:

  • Remember what you were doing across context switches
  • Track time naturally without manual timers
  • Give AI assistants real context about your work
  • Own your data - everything stays local

Architecture

Core Components

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ OnTask (C#)  │────▢│  SQLite Database │◀────│ ActivityMonitor β”‚
β”‚ Manual Tasks β”‚     β”‚  Shared Context  β”‚     β”‚    (Python)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚
                                 β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚ PersonalContextMCP    β”‚
                     β”‚    (TypeScript)       β”‚
                     β”‚ Exposes to AI Tools   β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Optional: ConversationTracker Plugin

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Browser Extensions   β”‚
β”‚ - Claude.ai          │──┐
β”‚ - ChatGPT (future)   β”‚  β”‚ HTTP (localhost:8766)
β”‚ - Gemini (future)    β”‚  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                          ↓
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚ ConversationTracker β”‚
              β”‚   (Python Service)  β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         ↓
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚  SQLite Database    β”‚
              β”‚  + conversations    β”‚
              β”‚  + messages (FTS5)  β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                         ↓
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚  PersonalContextMCP β”‚
              β”‚  + search tools     β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Components

1. OnTask (Windows, C#)

  • Hotkey-activated task tracker (Ctrl+Shift+0)
  • System tray app with modern WPF UI
  • Manual task entry - tell it what you're working on
  • Shows recent task history

πŸ“– OnTask Documentation

2. ActivityMonitor (Cross-platform, Python)

  • Tracks active windows and applications automatically
  • Measures time spent in each context
  • Detects document/file context from window titles
  • Runs in background - no UI needed

πŸ“– ActivityMonitor Documentation

3. PersonalContextMCP (Cross-platform, TypeScript)

  • MCP server for AI tools (Claude Desktop, Cursor, etc.)
  • Exposes activity and task data via natural language queries
  • Read-only access to context database
  • Query by time, application, or content

πŸ“– MCP Server Documentation

4. ConversationTracker (Optional Plugin, Python)

  • Captures AI conversations from Claude, ChatGPT, Gemini, Perplexity
  • Full-text search across all your chat history
  • Browser extensions for automatic capture
  • MCP integration - search conversations from within Claude

πŸ“– ConversationTracker Documentation

Note: ConversationTracker is completely optional. The core Personal Context Server (OnTask + ActivityMonitor + MCP) works independently.

Quick Start

Prerequisites

  • Windows 10+ (for OnTask)
  • Python 3.8+ (for ActivityMonitor)
  • Node.js 18+ (for MCP server)
  • .NET 8.0 (for OnTask)

Installation

1. Initialize Database

cd database
python init_database.py

2. Install ActivityMonitor

cd activity-monitor
pip install -e .
python activity_monitor.py

3. Build OnTask

dotnet build -c Release
dotnet run

4. Install MCP Server

cd personal-context-mcp
npm install
npm run build

5. Configure Claude Desktop

Edit %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "personal-context": {
      "command": "node",
      "args": ["C:\\path\\to\\personal-context-mcp\\dist\\index.js"]
    }
  }
}

Usage

OnTask

  1. Launch OnTask - it sits in your system tray (tomato icon)
  2. Press Ctrl+Shift+0 to enter current task
  3. View recent tasks in the UI

ActivityMonitor

Run in background:

python activity_monitor.py

Or install as a Windows service (see ActivityMonitor docs).

Query Your Context in Claude

Once the MCP server is configured, ask Claude:

Core queries:

"What was I working on this morning?"
"Show me my VS Code activity from yesterday"
"What tasks have I been switching between?"
"Give me a summary of this week's work"

With ConversationTracker (optional):

"Search my past conversations about Python asyncio"
"What did I discuss with ChatGPT yesterday?"
"Find the conversation where I asked about database indexing"
"Show me my recent Claude conversations"

Claude will use the MCP server to query your local database and provide context-aware responses.

Privacy & Data

All data stays local. Nothing is ever sent to any server.

  • Database: %APPDATA%\PersonalContext\context.db
  • OnTask settings: %APPDATA%\OnTask\settings.json
  • No telemetry, no cloud, no tracking
  • You can inspect, export, or delete your data anytime

Data Stored

Activities (from ActivityMonitor)

  • Timestamp
  • Application name (e.g., "Code.exe", "chrome.exe")
  • Window title
  • Document path (when detectable)
  • Duration in window

Tasks (from OnTask)

  • Task description
  • Start time
  • End time (when completed)
  • Status (active/completed)

Context Switches

  • From/to task IDs
  • Switch time
  • Trigger type (manual/automatic)

Features

βœ… Core Features

  • Manual task tracking (OnTask)
  • Automatic activity monitoring (Windows)
  • Shared SQLite database
  • MCP server for AI integration
  • Time-based queries
  • Application usage tracking
  • Task history and search

βœ… ConversationTracker (Optional Plugin)

  • AI conversation capture (Claude.ai)
  • Full-text search (SQLite FTS5)
  • Multi-platform support (ChatGPT, Gemini, Perplexity planned)
  • Browser extension for Claude
  • MCP integration (3 new tools)
  • Conversation summaries

🚧 Planned Features

  • ChatGPT, Gemini, Perplexity browser extensions
  • Semantic search over activities and conversations
  • AI-generated activity summaries
  • Conversation topic extraction
  • Neo4j option for graph relationships
  • Linux support for ActivityMonitor
  • macOS improvements
  • Multi-device sync (optional, encrypted)
  • Pomodoro timer integration
  • Task categories and tags

Documentation

Core Components

Optional Plugins

System

Project Structure

personal-context-server/
β”œβ”€β”€ database/                    # Database schema and initialization
β”‚   β”œβ”€β”€ schema.sql
β”‚   β”œβ”€β”€ init_database.py
β”‚   └── README.md
β”œβ”€β”€ activity-monitor/            # Python activity tracking component
β”‚   β”œβ”€β”€ activity_monitor.py
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ setup.py
β”‚   └── README.md
β”œβ”€β”€ personal-context-mcp/        # TypeScript MCP server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   └── index.ts
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ tsconfig.json
β”‚   └── README.md
β”œβ”€β”€ Services/                    # C# OnTask services
β”‚   β”œβ”€β”€ DatabaseService.cs
β”‚   β”œβ”€β”€ TaskHistoryService.cs
β”‚   β”œβ”€β”€ SettingsService.cs
β”‚   └── GlobalHotKeyService.cs
β”œβ”€β”€ Models/                      # C# data models
β”‚   β”œβ”€β”€ TaskItem.cs
β”‚   └── AppSettings.cs
β”œβ”€β”€ MainWindow.xaml              # OnTask WPF UI
β”œβ”€β”€ App.xaml
β”œβ”€β”€ OnTask.csproj
β”œβ”€β”€ README.md                    # This file
└── LICENSE

Technology Stack

OnTask (C# / .NET 8 / WPF)

  • WPF: Modern Windows UI framework
  • System.Data.SQLite: Database access
  • Hardcodet.NotifyIcon.Wpf: System tray integration
  • Newtonsoft.Json: Settings serialization

ActivityMonitor (Python 3.8+)

  • psutil: Cross-platform process utilities
  • pywin32: Windows API access (Windows only)
  • pyobjc: macOS API access (macOS only)
  • sqlite3: Built-in database access

PersonalContextMCP (TypeScript / Node.js 18+)

  • @modelcontextprotocol/sdk: MCP protocol implementation
  • better-sqlite3: Fast SQLite access
  • TypeScript 5: Type-safe development

Development

Prerequisites

  • Visual Studio 2022 or VS Code (for C#)
  • Python 3.8+ with pip
  • Node.js 18+ with npm
  • Git

Building

# Database
cd database
python init_database.py

# ActivityMonitor
cd activity-monitor
pip install -e .

# OnTask
dotnet restore
dotnet build -c Release

# MCP Server
cd personal-context-mcp
npm install
npm run build

Running Tests

# OnTask
dotnet test

# ActivityMonitor
# TODO: Add tests
pytest

# MCP Server
# TODO: Add tests
npm test

Troubleshooting

Database Not Found

Make sure you've initialized the database:

cd database
python init_database.py

The database should be created at %APPDATA%\PersonalContext\context.db.

ActivityMonitor Not Tracking

Windows: Make sure you have pywin32 installed:

pip install pywin32

macOS: Grant accessibility permissions to Terminal or your Python executable.

MCP Server Not Showing in Claude

  1. Check the config file syntax (must be valid JSON)
  2. Ensure the path to index.js is absolute and correct
  3. Restart Claude Desktop completely
  4. Check Claude Desktop logs (Help β†’ View Logs)

OnTask Hotkey Not Working

Another application may be using Ctrl+Shift+0. Close other productivity tools or check for hotkey conflicts.

Contributing

Contributions are welcome! This project aims to be:

  • Privacy-first - user data never leaves their machine
  • Open - no proprietary dependencies
  • Practical - solves real problems for knowledge workers
  • Well-documented - easy to understand and extend

See CONTRIBUTING.md for guidelines.

License

MIT License - see LICENSE

Acknowledgments

Inspired by:

  • Pieces OS (but open and independent)
  • Model Context Protocol (Anthropic)
  • The need for better context management tools
  • The Pomodoro Technique

Support


Built with ❀️ by developers who forget what they were working on

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •