One could pretty easily wrap an MCP server around the ScreenTime activity SQLite database file on MacOS. You could use DuckDB like this server does.
I’ve found good value in making purpose-build MCP servers like that with the general model:
Data<>DuckDB<>MCP<>LLM
With verbose description for the LLM of an “sql” tool endpoint for it to use to explore.
It's pretty crazy what it can do! I'll put examples once I can scrub personal info. But it has browsing history too. Sensitive data, so please be careful!!
Maybe tacky to turn a comment thread into a Show HN, but the top dope is always in the comments anyways.
This morning I kept pushing and started getting Claude into an human-agentic loop of suggesting MCP tool description and pre-flight SQL changes (for views). I'd ask it a some MCP queries, have it examine the SQL mistakes (e.g. CoreData vs UNIX timestamps, tricky queries), then evolved it. Since the endpoint is SQL, it can generate SQL to generate better SQL....
I had some human intelligence in that (and surely at the outset), but right now mostly I'm building and restarting Claude Desktop, then prompting:
"i have integrated those changes. examine my habits of concurrent browsing. identify statistical patterns in the timing and correlation of the destinations. after you do that, look at the issues you had and present new tool descriptions and sql migration. test the sql migrations before final presentation"
I agree entirely. It's especially frustrating since the DeviceActivity framework comes close, but doesn't provide enough detail for users to allow apps to track this info.
The best approach we've found to tracking specific app use time is to have our app publish App Intents, and then tell users to trigger those intents with shortcuts. It's fairly effective, but very clunky to set up and has to be done app by app..