opal-mcp
Click on "Install 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., "@opal-mcphow much time did I spend on Instagram 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.
opal-mcp
Lets your AI assistant see and control your Opal screen time.
Ask Poke "how much time did I burn on Instagram this week" or "block me for an hour, I need to finish this" and it can actually answer and actually do it.
Works with Poke, Claude Desktop, OpenClaw, Hermes, or anything else that speaks MCP.
What it can do
Tool | What it's for |
| One call, whole picture. What's blocking, how long is left, today's total so far. Block status is this Mac only. |
| Time per app over any period. "today", "last 7 days", "this week", a date, a range. Covers your iPhone too. |
| Your recurring blocks, when they run, which are paused. |
| What's on the blocklist right now. |
| Start a focus block. Takes "45m", "1h30m", "2 hours", or a plain number. |
| End the block that's running. |
| What's working and what isn't. Run this when something's off. |
| Shows the shape of Opal's files. Only useful when a number looks wrong. |
Related MCP server: omnifocus-mcp
Read this before you install it
Opal has no API. No developer docs, no keys, nothing to sign up for, and their terms say not to automate against their servers. So this doesn't talk to Opal at all. It works two other ways, both on your own machine:
Reading your Opal data straight off your disk, where Opal already puts it. Read-only.
Controlling blocks through Apple Shortcuts, which is the automation route Opal themselves point people at.
Two things follow from that, and they're worth knowing up front:
It has to run on your Mac. It reads local files, so it can't run on a server somewhere. For Poke that means a tunnel — see below.
Starting and stopping blocks needs Opal's Shortcuts actions, and those have shown up on iPhone and iPad before the Mac app. If the actions aren't in your Mac's Shortcuts app yet, reading works fine and controlling doesn't.
opal_check_setupwill tell you which situation you're in. There's no way around it from here — that part is Opal's to ship.
Reading your screen time works regardless.
Install
git clone https://github.com/lewisnsmith/opal-mcp.git
cd opal-mcp
npm install
npm run buildThen check what works on your machine:
npm run smokeThat starts the server the way an agent would and calls every read-only tool. It'll tell you what's missing.
Give it permission to read your screen time
The usage numbers live in a database macOS keeps locked down. Whatever app runs this server needs Full Disk Access:
System Settings → Privacy & Security → Full Disk Access, switch on the app that runs it — Terminal, iTerm, Claude Desktop, whichever — then restart that app. The restart matters, it won't take effect otherwise.
Without it you'll get a clear message saying so rather than a screen time total of zero.
Hook it up to Poke
Poke needs a public https URL, and this runs on your Mac, so you need a tunnel.
# terminal 1
MCP_AUTH_TOKEN=pick-a-long-random-string npm run serve
# terminal 2
cloudflared tunnel --url http://localhost:8000Take the https URL cloudflared prints, then in Poke go to settings → connections → new:
URL: the tunnel URL with
/mcpon the end.https://something.trycloudflare.com/mcpAuthorization:
Bearer pick-a-long-random-string
The /mcp is not optional. Leaving it off is the single most common reason Poke says it can't see any tools.
Then tell Poke: "use the opal integration's opal_status tool". Naming the integration explicitly helps the first time.
If Poke keeps acting like it's still looking at an old version of the connection, send it clearhistory.
ngrok http 8000 works the same way if you'd rather use that.
Hook it up to Claude Desktop, OpenClaw, or Hermes
These run things locally, so no tunnel and no token needed.
{
"mcpServers": {
"opal": {
"command": "node",
"args": ["/absolute/path/to/opal-mcp/dist/index.js"]
}
}
}For Claude Desktop that goes in ~/Library/Application Support/Claude/claude_desktop_config.json. Other runners use the same shape — point them at the same command and args.
Your iPhone
Most people's screen time is mostly the phone, so this matters more than the Mac side.
Seeing your iPhone's screen time works already. Turn on Settings → Screen Time → Share Across Devices on the phone. Your iPhone usage syncs into the Mac's Screen Time store, and opal_screen_time reads it — you'll get one combined total with a per-device split, and device: "iphone" narrows to just the phone.
One thing worth knowing about how that's put together: several databases hold overlapping copies of this, so the numbers come from exactly one of them, never several added up. Summing them would count your Mac twice and inflate every total. The iCloud store wins when it's there, because it's the only one that knows about the phone.
Blocking your iPhone works through a Focus mode. Opal's Shortcuts actions only exist on iOS, so there's nothing on the Mac to call directly. The way round it:
On the iPhone, open Opal and bind a block to a Focus mode — that's Opal's Focus Filter setting.
On the Mac, make a shortcut with the Set Focus action turning that same Focus on. Name it
Opal Focus On.Do it again for off, named
Opal Focus Off.Check Focus is set to share across devices, or the Mac flipping it won't reach the phone.
Then opal_start_block flips the Focus, the Focus syncs to the phone, and Opal starts the block there.
The honest caveat: opal_status reads Opal's files on this Mac, so it can't confirm a block that's running on your phone. The tool says so in its reply rather than sending your agent looking for something it'll never find. Your iPhone's screen time still shows up fine — it's only the block status that's Mac-only.
Let it start and stop blocks
Reading works out of the box. Controlling needs a one-time setup, because the only sanctioned way in is Shortcuts.
Open the Shortcuts app.
New shortcut, add Opal's Start Session action.
Name it exactly
Opal Start Session.Do it again with End Session, named
Opal End Session.
Prefer different names? Set OPAL_SHORTCUT_START and OPAL_SHORTCUT_STOP instead.
If you can't find Opal's actions in the Shortcuts app, they aren't in your Mac build yet. See the note near the top.
Settings
All optional, all environment variables.
| Which timezone your days run in. Defaults to your machine's. Get this wrong and every number lands on the wrong day. |
| HTTP port. Default 8000. |
| HTTP bind address. Default 127.0.0.1, so nothing off your machine can reach it directly. Tunnels connect to localhost, so you rarely need to change this. |
| Require this as the bearer token in HTTP mode. Set it before you put a tunnel in front of this, or anyone with the URL can read your screen time and start blocks. |
| Name of your start shortcut, if it isn't the default. |
| Name of your stop shortcut. |
| Chattier logging, on stderr. |
When something's wrong
Run opal_check_setup first. It checks all three moving parts separately and names the broken one.
"Can't find Opal on this machine" — Opal needs to be installed and opened at least once, and this has to be running on that same Mac.
Screen time won't read — Full Disk Access, see above. Remember to restart the app afterwards.
Poke sees no tools — check the URL ends in /mcp, check the tunnel is still up, then send Poke clearhistory.
Numbers look wrong — run opal_debug_files. Opal never published their file format, so this shows what's actually on your disk. It prints key names only, never values, so it's safe to paste into an issue.
How much to trust this
Being straight with you about the shaky parts:
The screen time numbers are solid. They come from the same macOS database System Settings reads, using a query that's been in forensics tooling for years.
The Opal file parsing is educated guesswork. Opal doesn't document their format. The field names came from one small open source project doing the same thing, with nobody else to cross-check against. So every field is optional, one weird file can't take the rest down, and
opal_debug_filesexists for when it disagrees with reality. If you spot a wrong number, that tool's output is exactly what's needed to fix it.Starting a block reports that the shortcut ran, not that Opal listened. Those aren't the same claim. Opal's harder modes are deliberately difficult to cancel, and that's the point of them. Check
opal_statusafter.
Development
npm test # 129 tests, no Mac required, uses fixtures
npm run typecheck
npm run dev # run from source over stdio
npm run smoke # check against your real machineThe tests build a real SQLite database with Apple's actual table names and run the real query against it, and stand up a real MCP client against both transports. They don't mock the parts that matter.
Licence
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables access to Oura Ring health data including sleep patterns, activity metrics, readiness scores, heart rate, workouts, and stress measurements with AI-powered analysis and personalized recommendations.Last updated61MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to read and write to OmniFocus database, allowing natural language task management, project creation, and GTD workflows.Last updated41MIT
- Alicense-qualityDmaintenanceEnables AI assistants to access your Oura Ring health data through OAuth2-authenticated API calls.Last updated299MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to access and analyze your Hevy workout data, including workout history, exercise progress, personal records, and routines.Last updated4133MIT
Related MCP Connectors
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Runtime permission, approval, and audit layer for AI agent tool execution.
Let AI tools securely access your LinkedIn network and DMs
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lewisnsmith/opal-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server