
What You Are Making
An Apple Shortcut that calls the ScreenTimerAI MCP server directly from macOS and returns yesterday's activity summary.
No AI assistant needed. No third-party app. Just Shortcuts, a shell script, and your data.
Why Apple Shortcuts
Apple Shortcuts is a built-in macOS automation tool that lets you chain actions into reusable workflows triggered by a hotkey, the menu bar, or a schedule. It is popular with Mac users who want lightweight automation without installing third-party tools. Connecting screen time tracking to Shortcuts makes sense because Shortcuts runs natively on every Mac with zero dependencies — no subscriptions, no cloud services, no AI provider needed. By calling the ScreenTimerAI binary directly, you get local-only time tracking data without any data leaving your machine. It is the most private way to automate your daily productivity report.
How This Works
Apple Shortcuts does not natively support MCP. But the ScreenTimerAI MCP server is a local binary that speaks JSON-RPC over stdio. You can call it from Shortcuts using the "Run Shell Script" action.
The script sends three messages to the MCP server:
- An
initializehandshake - An
initializednotification - A
tools/callrequest to fetch your data
The server responds with JSON, and Shortcuts parses the result.
Step 1: Create The Shortcut
Open the Shortcuts app on your Mac and create a new shortcut.
Action 1: Run Shell Script
Add a "Run Shell Script" action. Set the shell to /bin/zsh and paste this script:
#!/bin/zsh
MCP_BIN="/Applications/ScreenTimerAI.app/Contents/MacOS/activity-mcp-server"
START_DATE="$(date -v-1d +%Y-%m-%d)"
END_DATE="$(date +%Y-%m-%d)"
printf '%s\n%s\n%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"shortcut","version":"1.0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"summarize_activity_range","arguments":{"timeRange":{"start":"'"$START_DATE"'","end":"'"$END_DATE"'"}}}}' \
| "$MCP_BIN" 2>/dev/null \
| tail -1Action 2: Get Dictionary from Input
Add a "Get Dictionary from Input" action. This parses the JSON response from the MCP server.
Action 3: Get Dictionary Value
Add a "Get Dictionary Value" action. Set the key path to result.content to extract the activity summary text.
Action 4: Show Result
Add a "Show Result" action to display the summary, or use "Show Notification" for a quick popup.
Available Tools
You can call any of these ScreenTimerAI tools from the shell script by changing the tools/call method name and arguments:
| MCP function | What it returns |
|---|---|
get_current_activity | The app and window you are using right now |
get_activity_logs | Raw activity log entries for a date range |
show_activity_timeline | A visual timeline of app usage throughout the day |
summarize_activity_range | Top categories, apps, and notable activity blocks |
analyze_focus_segments | Focus stability analysis and deep work detection |
show_focus_score_timeline | Focus scores plotted across time blocks |
show_focus_score_trends | Focus score trends over multiple days |
To call a different tool, replace summarize_activity_range in the shell script with the function name above and adjust the arguments JSON accordingly.
Optional: Schedule It
In Shortcut settings, add an Automation trigger to run this shortcut every morning at your preferred time.
You can also run it from the command line:
shortcuts run "Daily Productivity Report"
Other Shortcut Ideas
Once the basic shortcut is working, you can duplicate and adapt it for different workflows:
- Morning notification: Use "Show Notification" instead of "Show Result" for a quick popup with yesterday's top app. This is less intrusive than a full dialog and works well as part of a morning automation sequence.
- Log to Apple Notes: Add an "Append to Note" action after the shell script step to save each day's summary to a running journal in Apple Notes. Over time this becomes a searchable archive of your daily productivity.
- Weekly digest: Create a second shortcut that calls
summarize_activity_rangewith a 7-day window and saves the output to a note every Monday. Schedule it with an Automation trigger so it runs automatically at the start of each week. - Menu bar quick check: Build a shortcut that runs
get_current_activityand shows a notification with what you are currently doing. Assign it a keyboard shortcut for quick awareness checks throughout the day.
Troubleshooting
- Shell script returning empty output? Make sure the binary path is correct and ScreenTimerAI is installed. Test by running the shell script directly in Terminal first. If the binary is not at the default path, update the
MCP_BINvariable to match your installation. - JSON parse error in Shortcuts? The
tail -1in the script grabs only the last response line. If the output contains extra lines, adjust totail -n 1. You can also pipe throughpython3 -m json.toolin Terminal to validate the output format. - Permission denied? Shortcuts may need Full Disk Access to run shell scripts that call external binaries. Go to System Settings, then Privacy and Security, then Full Disk Access, and add Shortcuts to the allowed list.
What Happens Next
Every time the shortcut runs, it calls the ScreenTimerAI binary directly, fetches yesterday's data, and shows the result.
No AI subscription needed. No network calls. Everything runs locally on your Mac.