screentime-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@screentime-mcp-servershow my app usage for today"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
screentime-mcp-server
MCP server for querying macOS Screen Time data. Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible client.
Reads app usage data directly from macOS knowledgeC.db via sqlite3 CLI — no native modules or dependencies required.
Requirements
macOS (Screen Time must be enabled)
Node.js >= 18
Full Disk Access must be granted to the host application (Claude Desktop, Terminal, etc.)
Granting Full Disk Access
Open System Settings → Privacy & Security → Full Disk Access
Add the application that runs the MCP server (e.g., Claude Desktop, Terminal, WezTerm)
This is required because knowledgeC.db is in a protected location.
Related MCP server: Health Auto Export MCP Server
Setup
Claude Code
claude mcp add screentime -- npx -y screentime-mcp-serverClaude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"screentime": {
"command": "npx",
"args": ["-y", "screentime-mcp-server"]
}
}
}Cursor
Add to your Cursor MCP settings:
{
"mcpServers": {
"screentime": {
"command": "npx",
"args": ["-y", "screentime-mcp-server"]
}
}
}Tools
get_screentime
Get app usage data for a specific date with human-readable app names.
Parameters:
Parameter | Type | Default | Description |
| string | today | Date in |
| number | 60 | Minimum usage duration in seconds |
Example output:
# Screen Time: 2026-02-14
**Total: 5h 30m**
- WezTerm: 2h 15m
- Arc: 1h 30m
- Ableton Live: 55m
- Obsidian: 50m
## Hourly Breakdown
- **09:00**: WezTerm 45m, Arc 12m
- **10:00**: Ableton Live 55m
- **11:00**: WezTerm 40m, Arc 18m
## Timeline Detail
- 09:05-09:50 WezTerm (45m)
- 09:50-10:02 Arc (12m)
- 10:02-10:57 Ableton Live (55m)screentime_sql
Run a custom SQL query directly against knowledgeC.db.
Parameters:
Parameter | Type | Description |
| string | SQL query to execute |
Schema notes:
Table:
ZOBJECTFilter:
ZSTREAMNAME = '/app/usage'App bundle ID:
ZVALUESTRINGTimestamps use Core Data epoch (add
978307200to convert to Unix timestamp)Use
'localtime'modifier for local timezone
App Name Resolution
Bundle IDs are resolved to human-readable names using:
Built-in dictionary (common apps like Safari, Chrome, VS Code, Slack, etc.)
mdfind+mdlslookup (finds any installed app)Fallback: last component of bundle ID, capitalized
License
MIT
Available Tools
2 toolsget_screentimeB
Get app usage data for a specific date. Returns per-app usage grouped by hour with human-readable app names.
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date in YYYY-MM-DD format. Defaults to today. | |
| min_seconds | No | Minimum usage duration in seconds to include. Default: 60 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden, but there is no output schema. It does disclose the return contract ('per-app usage grouped by hour with human-readable app names'), which is genuinely useful. It says nothing about permissions, data availability/latency, or behavior when no usage exists.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences with zero filler: what it does first, what it returns second. Both sentences earn their place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, describing the return shape was necessary and it is done. Both optional params are schema-documented. The only real omission is disambiguation from the sibling tool and any note on empty/error cases.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and both parameters (date format/default, min_seconds default) are fully documented in the schema. The description adds nothing beyond that, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Get app usage data') scoped to 'a specific date', and even specifies the return shape. It does not explicitly distinguish itself from the sibling screentime_sql, but the contrast is strongly implied by the sibling's name.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no when-to-use guidance and never mentions screentime_sql as an alternative for raw/custom queries. An agent must infer from the name alone that this is the pre-aggregated simple path and the sibling is the flexible one.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
screentime_sqlA
Run a custom SQL query against macOS knowledgeC.db (Screen Time database). Use ZOBJECT table with ZSTREAMNAME='/app/usage'. Timestamps use Core Data epoch (978307200 offset from Unix). Returns raw pipe-separated results.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | SQL query to execute against knowledgeC.db |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the load. It discloses non-obvious behavioral facts: the ZOBJECT table, ZSTREAMNAME filter, Core Data epoch offset, and pipe-separated return format. However it omits whether the query is read-only, whether writes/deletes are blocked, and any limits or error behavior for a raw SQL execution tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three compact sentences covering purpose, query target, and return format. Front-loaded with the action; no wasted prose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-param raw query tool with no output schema, the description covers the key domain gotchas (table, stream name, epoch offset, output format). Missing only the safety profile (read-only vs write) and any execution constraints.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for the single 'sql' parameter, so the schema already documents it. The description adds useful domain context (which table and stream to target, the epoch offset) that helps write a correct query, but not parameter-level syntax.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (Run a custom SQL query) and resource (macOS knowledgeC.db / Screen Time database). Distinguishes itself from sibling get_screentime by being the raw/arbitrary query tool versus a canned getter.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies usage context ('custom SQL query', names the ZOBJECT table and stream name) but never states when to prefer this over get_screentime or when to avoid it. Usage is inferred, not articulated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v1.0.0- First observed
get_screentime - First observed
screentime_sql
TDQS
Scored across 2 tools
get_screentime and screentime_sql have distinct roles: one is a convenience wrapper for date-specific usage, the other allows arbitrary SQL. However, an agent might be unsure when to use the specific date tool versus writing SQL, especially since both can return usage data.
The names follow different conventions: get_screentime uses a clear verb_noun pattern, while screentime_sql is noun-based and lacks a verb, making the set feel inconsistent. This mixing reduces predictability.
Two tools is quite thin for a server that could expose more granular Screen Time operations (e.g., date ranges, app lists, totals). The SQL escape hatch adds power, but the surface still feels minimal.
The combination of a targeted get_screentime tool and a general SQL query tool covers most retrieval needs, including custom queries. Minor gaps exist (e.g., no built-in date-range summary or app enumeration), but the SQL tool allows agents to compensate.
Maintenance
Related MCP Connectors
Access New Relic observability data through MCP - query metrics, logs, traces, entities, and more
Explore your Messages SQLite database to browse tables and inspect schemas with ease. Run flexible…
- TimequipOAuthcom.timequip
Manage Timequip projects, tasks, comments, members, and dashboards through MCP.
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables users to query Apple Health metrics, workouts, and trends from CSV files exported via the Health Auto Export app. It allows MCP clients to analyze health data such as heart rate, sleep stages, and activity levels directly from local iCloud Drive storage.35 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables querying health data from the Health Auto Export app on iPhone/iPad via MCP, allowing LLMs like Claude to access and analyze personal health metrics.9 npm65MIT
- AlicenseNot gradedqualityDmaintenanceEnables reading, sending, and managing iMessage conversations on macOS through MCP.1MIT
- AlicenseNot gradedqualityAmaintenanceProvides MCP tools to read local Timing.app activity data, generate aggregated time entries, and push them to the Timing Web API.MIT