OAuth for iCloud developer guide

Choose MCP or REST for Your iMessage Integration

Use REST when your code decides what to do and MCP when a language model decides. Both use the same Figment grant and the same two scopes. OAuth for iCloud includes an MCP server, and you can build your own MCP layer when you need custom tools.

Figment editorial teamPublished Updated Facts checked November 12, 2026

Use REST when your application code decides what to do. Use MCP when a language model decides. Both paths share the same OAuth for iCloud grant from Figment and the same two iMessage scopes: messages:read for history and search, and messages:send for outbound messages. The difference is the caller's reasoning model, not the permission contract.

Figment issues these grants, not Apple. Apple's supported third-party account authorization covers Mail, Calendar, and Contacts, and there is no Apple-issued iMessage OAuth scope.

What does Figment's REST interface give me?

Figment's OAuth for iCloud exposes iMessage through an HTTP API at https://figment.so/api/icloud. After completing the PKCE authorization flow with your registered client_id, you receive a Figment access token (normally valid for 900 seconds) and a connection_id that identifies the connected Apple Account.

Three read endpoints cover the common patterns:

GET /v1/connections/{connection_id}/chats?limit=20&offset=0
GET /v1/connections/{connection_id}/messages?chatGuid=...&limit=20
GET /v1/connections/{connection_id}/messages/search?query=...&chatGuid=...&limit=20

Use chatGuid values returned by the chats endpoint. In real requests, URL-encode all query parameter values with a URL builder, and never paste raw chatGuid strings into a query string.

A fourth endpoint handles outbound messages:

POST /v1/connections/{connection_id}/messages/send

The body carries a chatGuid (taken from the chats response) and text. Every send requires a stable Idempotency-Key header you generate and persist before the first attempt. Poll GET /v1/connections/{connection_id}/messages/receipt with the same key to check delivery state.

REST fits when your code owns the full decision path: a CRM logging a conversation, a support tool routing by keyword, or a scheduled alert pipeline. The logic is explicit and testable.

How does MCP change the caller?

Integration design: OAuth for iCloud includes an MCP server, listed on the product page. This section describes building your own MCP layer for custom tools, wrapping Figment's supplied REST endpoints as typed tools. Treat the architecture below as a design guide, not a tested integration.

The Model Context Protocol is an open-source standard for connecting AI applications to external systems. In this design, you build an MCP server that exposes Figment's REST operations as typed tools. An LLM running inside a host (Claude Desktop, VS Code, or a custom agentic framework) instantiates an MCP client, discovers the tools, and calls them when it decides an action is warranted.

Your MCP server translates each tools/call request into the matching Figment REST call and returns the result as structured content. The host never touches Figment directly, and your MCP server holds the access token and enforces idempotency.

MCP uses JSON-RPC 2.0 over two transports: stdio for local processes and Streamable HTTP for remote servers. The MCP architecture specification recommends OAuth for remote server authentication, which fits the Figment token flow.

An agent can then read recent messages, reason about their content, and decide whether and how to reply, without hardcoded routing logic in your application. This suits AI assistants, agentic task handlers, and CRM copilots where the LLM interprets context before acting.

Two content-trust concerns apply to this path.

  • Message bodies are untrusted input. A received message can contain text designed to redirect the agent's behavior, which is a prompt-injection risk. Your MCP server should not forward raw message content as tool arguments or system instructions.
  • Writes must be explicit. The send tool should require a resolved chatGuid and final text from the agent. It must not infer or construct those values from conversation context alone. Treat every invocation of the send tool as an explicit authorized write, not an automatic response.

How do REST and MCP compare on permissions and interaction?

ConcernREST: application-drivenMCP: agent-driven (design)
Who calls the endpointYour application codeLLM via tools/call through your MCP server
Token holderYour backendYour MCP server (same Figment access token)
Scopes neededmessages:read, messages:sendSame scopes; server holds the grant
How chatGuid is selectedYour code retrieves and passes itAgent uses a prior tool result from the chats listing
Idempotency keyApp generates one key per intended send before first requestMCP server generates one key per tool invocation; never shared across separate calls
Read completenessBounded by Mac sync state; check hasMore and historyCompleteSame Mac-sync limit applies; expose these fields in tool output
Delivery certaintyPoll /receipt with same key; unknown means poll again, never resend under a new keyTool returns receipt; unknown means poll only, do not issue a new send
Content trustApp controls what text it reads and passesMessage text is untrusted; guard against prompt injection before using it in tool arguments
Best forCRM pipelines, keyword routers, scheduled alertsAI assistants, agentic task handlers, copilot features

The grant, Mac dependency, and delivery uncertainty are identical across both paths. Only the decision-making layer differs.

Which scope and idempotency rules apply to both paths?

Two rules hold on either surface.

There are exactly two iMessage scopes. messages:read covers both history retrieval and search, with no separate search permission. messages:send is distinct. A conversation appearing in a read result is not automatically authorized for sends, because the send grant must include that exact existing conversation. Request messages:send only when your use case needs outbound messages.

Idempotency is about intent, not content. Generate and persist one key per intended send action before its first request. Reusing a content hash to deduplicate silently merges two separately intended identical messages. A failed send with a given key returns its recorded failure on retry, and the key does not trigger a new attempt. An unknown receipt means poll the same receipt endpoint. It never means issue a new key.

Both paths also share the Mac-sync constraint: read history reflects what is available on the connected Mac. The historyComplete and hasMore fields indicate coverage, and data is bounded even when the connector status shows ready.

Should I use REST, MCP, or both?

Choose REST when your logic is deterministic: routing rules, response templates, or time-based triggers. It is straightforward to test and maps directly to any HTTP client or automation platform.

Choose MCP when the decision of when and what to send belongs to a language model. MCP gives the agent a typed tool contract it can discover and invoke, and your application code stays out of the routing logic.

Run both when your product has deterministic and agentic surfaces. A support product might use REST for SLA-driven auto-replies while an MCP server powers the AI copilot that drafts contextual responses. The grant and scopes are shared and only the caller changes.

Sandbox access is free and uses synthetic data that cannot reach real recipients. Messages is part of the Full iCloud suite, which costs $29/month per connected Apple Account. For live access, request a demo.

How do I start?

Register your app and explore the sandbox at the developer dashboard. When you are ready to connect a live Apple Account, use the Connect Apple Account flow.

For a walkthrough of the PKCE grant and token exchange, see OAuth for iCloud: Connect Apple Data to Your App. For the trade-offs of running your own Mac, see Build or Buy Your iMessage Connection Service.

Connect Apple data to your app

Register your app and start with synthetic sandbox data. Choose the permissions your app needs.

Connect Apple Account

Sandbox is free. Live access is $14 or $29 per connected Apple Account, per month.