Michael Di Giacomi
All posts

How the iMessage bridge for my dot works

How an approved iMessage becomes a notification, an authorized read and a separate reply.

A Mac can send an iMessage on behalf of my dot. The missing piece in my setup was what happened next. When somebody replied, the dot didn't know it had a message unless I asked it to check.

I wrote about why I built the bridge. This is the implementation side: how a reply turns into a notification, what the Mac checks before releasing any text, and what happens if a send gets interrupted.

From iMessage to replyThe message, the notification and the reply are separate steps.
  1. iMessage
    An approved conversation gets a message

    One person sends an iMessage in an approved one-to-one conversation.

  2. Dedicated Mac
    The watcher checks local policy

    The Mac detects the arrival and checks the current Contacts allowlist.

  3. OpenAI dot
    A signed MCP Events notice wakes the dot

    The Mac sends an event ID, conversation alias and timestamp. No message text or attachments are included.

  4. Dedicated Mac
    The Mac reads that exact message

    The dot asks for the exact event. A separate authorized local workflow rechecks policy before returning that one message.

  5. OpenAI dot
    The dot drafts a reply

    The dot uses the authorized message text to decide whether and how to respond.

  6. Dedicated Mac
    The Mac rechecks and sends

    Only if the reply is separately authorized does the Mac recheck the destination and hand the reply to Messages.

  7. iMessage
    Messages sends to the recipient

    The reply goes to the approved conversation. An uncertain send is not automatically retried.

The notification is a lookup key

Messages runs in a dedicated Mac setup with a separate Apple account, so the bridge isn't watching my personal inbox. The watcher looks for new arrivals in approved one-to-one conversations. A signed local policy helper checks the Contacts allowlist. Group chats and people outside that list aren't part of the workflow.

The notification carries an opaque conversation alias, an event ID and a timestamp. No body, attachments or phone number go in that notification. A durable local queue keeps track of work across a process restart. The queue can tell us what happened to the notification, but receipt of a notification doesn't tell us that anyone read or replied to the message.

How the Mac gets the dot’s attention

I used MCP Events for the OpenAI side of the bridge. MCP stands for Model Context Protocol. You may have seen it used to give ChatGPT tools it can call. The events feature works in the other direction: ChatGPT can subscribe to updates from a connected plugin instead of repeatedly asking if anything changed.

In my setup, the plugin offers a message-arrival event. I set up my dot to watch for it and told it what to do when one arrives. ChatGPT subscribes, and the bridge sends a signed webhook when it finds a matching iMessage. The webhook is an HTTPS notification carrying the small event record described above. ChatGPT verifies it and delivers it to the subscribed workflow, so my dot can start handling the arrival without me opening a chat or prompting it to check.

The subscription only covers the notification. From there, the dot uses a separate, authorized local workflow to ask the Mac for the exact message or request a reply. The event itself can’t authorize either one.

This is a custom plugin connection in ChatGPT, not a call to the general-purpose OpenAI API or a feature of built-in dot texting. OpenAI documents MCP Events for dots and supported Work chats; whether you can use a particular plugin or set up its triggers depends on your access.

How ChatGPT reaches the Mac without opening a port

I used OpenAI’s Secure MCP Tunnel to connect the bridge’s private MCP service to ChatGPT. The Mac starts an outbound HTTPS connection to OpenAI. When ChatGPT needs to set up or manage the event subscription, the Mac picks up that request through the tunnel, passes it to the local MCP service, and sends the response back. I didn’t have to expose that service to the internet or open an inbound port on the Mac.

The tunnel and the event solve different problems. The tunnel lets ChatGPT reach the private service. A signed MCP Events webhook goes the other way: it tells ChatGPT that a matching iMessage arrived, so the dot can wake up. In this setup the event contains only metadata, and reading the message or sending a reply still goes through the separate authorized Mac workflow.

Reads and replies are separate

When the dot handles a notification, it asks the Mac for that exact event. The local workflow checks the event against the original message and conversation and rechecks the current policy. It won't look up the newest message instead if the match fails. That matters when two messages arrive close together or the dot wakes up late.

A successful read returns the text of that one message to the authorized workflow. It can enter the dot's tool history at that point. The privacy boundary is what the alert carries and which text can be retrieved, not a promise that approved text never leaves the Mac.

A reply is a separate action, with its own authorization for that event, recipient and text. The Mac checks that the account and conversation still match before sending. An incoming message is just input to that decision. It can't grant itself permission to read another conversation or authorize a reply on its own.

Stop, restart and the awkward part of sending

The watcher runs under an explicit Start and a time-limited lease. Stop, revocation and an invalid lease block further work. A restart on its own doesn't authorize anything: resuming depends on the previous authorized intent still being valid and the local checks passing.

The awkward failure is losing contact after the Mac may have handed a reply to Messages. We can't always tell whether it went out. The workflow records its attempt locally before handing off the send. If the outcome is uncertain, it keeps that attempt marked unknown and doesn't automatically try again. Even if the send command returns successfully, that only tells us the command returned. It doesn't tell us when the recipient saw the message.

Where the time goes

I look at three timings: when Messages sees the arrival, when the dot gets the notification, and when a reply comes back. Measuring only the last one makes it hard to tell whether to look at the Mac, the notification path or the reply handler.

One change we made was to combine some of the signed Contacts checks for notifications into one exchange. It saves trips between processes without skipping the checks. That's a useful improvement on its own, but a fixture showing fewer calls isn't proof that iMessages come back faster in practice. For that, I want timings from real conversations under comparable conditions.

OpenAI's built-in dot texting already supports one-to-one iMessage or RCS between you and your own dot where available. This bridge is separate. I wanted a few people I specifically approved to be able to reply through the Messages app they already use, and I wanted a way to stop that access locally.