Giving an AI agent access to iMessage means solving two problems: getting authorized, scoped access to the user's messages, and exposing that access through a protocol the agent understands. Figment handles the first part with a user-approved OAuth grant that your app exchanges for an access token, not the user's Apple password. OAuth for iCloud includes an MCP server for the second part (/icloud). Build a local MCP adapter when you need custom tools: it translates tool calls into authenticated REST requests against Figment's API. For a full build, see Connect an MCP Client to Your iMessage Account.
What can the adapter do?
It wraps four iMessage operations:
- List conversations
- a paginated chat list. Each chat returns a
guidused aschatGuidin later calls. - Message history
- paginated messages per conversation. Check
hasMoreandhistoryCompletebefore assuming full coverage. - Search
- scans messages available on the connected Mac. Pagination is bounded by documented limits, and search is not a guaranteed complete index.
- Send
- posts to an existing conversation included in the user's send grant, and requires a stable idempotency key.
When Messages in iCloud is enabled, SMS, MMS, and RCS threads sync alongside iMessage. The iPhone must be on, connected to a network, and signed in to the same Apple Account for new traffic to reach the Mac (see Apple: carrier forwarding setup). Previously synced carrier-message history can remain on the Mac when the iPhone goes offline, but phone availability directly affects new messages that have not yet synced. historyComplete: false does not prove complete iCloud history.
Which tools map to which scopes and endpoints?
There are exactly two iMessage scopes. messages:read covers listing, history, and search. messages:send is a separate grant for outbound sends. The table below is a custom adapter design: these are suggested tool names for your own MCP server, not the tools of Figment's MCP server.
| Adapter tool | Scope | REST endpoint |
|---|---|---|
list_chats | messages:read | GET https://figment.so/api/icloud/v1/connections/{id}/chats |
list_messages | messages:read | GET https://figment.so/api/icloud/v1/connections/{id}/messages?chatGuid=ENCODED_CHAT_GUID |
search_messages | messages:read | GET https://figment.so/api/icloud/v1/connections/{id}/messages/search?chatGuid=ENCODED_CHAT_GUID&query=ENCODED_QUERY |
send_message | messages:send | POST https://figment.so/api/icloud/v1/connections/{id}/messages/send |
Request only the scopes your agent needs. A conversation returned by list_chats is not automatically authorized for sends: the user's messages:send grant must explicitly include that existing conversation. A selected-conversation read grant requires chatGuid for both history and search. Encode all query parameter values with a URL builder, and do not paste raw strings into GET URLs.
How does the connection lifecycle affect the adapter?
Each Apple service reports its own state independently of the account sign-in. The iMessage connector can reach any of these states: connecting, needs_approval, syncing, ready, offline, reconnect_required, revoked.
Your adapter should validate the grant at startup and handle API errors at call time. Non-ready or revoked connectors return non-2xx responses instead of a diagnostic state object, so treat those as errors and surface setup guidance to the user. Direct users to /icloud/account for connection status and resolution. A ready state does not guarantee complete message history or delivery.
Where do credentials live, and is there a Figment MCP server?
Yes. OAuth for iCloud includes an MCP server, listed on the product page. A custom adapter is a separate local process that you build and run, typically a Node script or similar, and it reads credentials from a protected environment or secret store at startup.
Register your app at /icloud/developers. Figment is the token issuer. This is not an Apple-issued credential and is not related to Sign in with Apple. Access tokens are opaque strings that normally expire after 900 seconds. Store and rotate refresh tokens separately per grant, serialize refresh calls per grant, and save replacement refresh tokens. Token refresh is application work in your adapter.
Never place a live token value in a shared or version-controlled config file. Your adapter is responsible for loading credentials from its own protected environment or secret store. Do not rely on a host application to expand environment-variable references or retrieve secret values from an OS keychain automatically. For general host configuration, see local server setup.
How do I send messages safely?
Persist one stable idempotency key per intended action before the first request, bound to the exact payload. Reuse it only for that same action and body. A body hash alone can wrongly merge two separately intended identical messages.
submitted means the bridge accepted the request, not that the message was delivered. Receipt states are submitted, delivered, read, failed, unknown, and simulated (sandbox). A failed receipt does not automatically retry, and repeating the request with the same key returns the same recorded result. If state is unknown, poll only, and never resend under a new key. The receipt envelope is {data:{idempotencyKey,state,guid?,delivery?,retrySend?},mode,replayed}. Sandbox responses carry mode:"sandbox" and state:"simulated".
How much does it cost?
The developer pays $29 per month per connected Apple Account for the Full iCloud suite, the plan that includes Messages. Sandbox is free, with synthetic conversations, no real message delivery, and no charge. For live access, request a demo. Manage grants at /icloud/account.
Connect Apple Account to register your app and start building.