# Connect an AI agent to Figment Messages

Add this URL as a remote HTTP MCP server in a client that supports OAuth:

```text
https://figment.so/api/icloud/mcp
```

The service provides read-only Messages access for the connection you approve.

## Connect

1. Open [My connections](https://figment.so/icloud/account). Complete Messages setup for live access, or use a sandbox connection with synthetic data.
2. Add the MCP URL above to your client.
3. Let the client open Figment's approval page. Choose a connection and approve `messages:read`.
4. Ask the agent to check its connection before reading messages.

MCP clients can register a public client automatically. A client secret and personal API token are not required. Creating an app in the developer dashboard is for a custom REST integration; it is not a required manual step for an MCP client that supports registration.

## Agent instructions

Copy this into your agent:

```text
Connect to Figment Messages through remote HTTP MCP at https://figment.so/api/icloud/mcp.
Use OAuth for iCloud with issuer https://figment.so/icloud and scope messages:read. Let me choose a connection and approve access in Figment.
Your MCP client can register a public client through the issuer metadata. No client secret or personal API token is needed.
First call figment_get_messages_connection. Check the connection state and whether its mode is sandbox or live.
If live setup is pending, explain that state. Keep the existing setup. Do not ask me to pay or sign in to Apple again because a connection is still being prepared.
Use only the Messages connection I approve. Sandbox results are synthetic. Live results cover messages available on its assigned Mac, not a guaranteed complete iCloud archive.
List conversations before selecting a chat. Follow returned pagination when a request needs older messages. For dated questions, check timestamps in my timezone and cover the requested dates before making a whole-day claim.
These MCP tools are read-only. Do not claim to send messages or access other Apple services through them.
I enter Apple credentials and verification codes on Figment's setup page. Do not ask me to paste credentials or access tokens into chat.
Setup guide: https://figment.so/icloud/agents.md
```

## Available tools

- `figment_get_messages_connection` checks the authorized connection's state and mode.
- `figment_list_conversations` lists its conversations.
- `figment_list_messages` reads a conversation selected by its returned `chatGuid`.
- `figment_search_messages` searches its available message history.

Follow the pagination returned by each tool. A recent page is not proof that an older day had no messages. Sending and access to other Apple services are not available through these four MCP tools.

## OAuth discovery

- Issuer: https://figment.so/icloud
- Protected resource metadata: https://figment.so/.well-known/oauth-protected-resource/api/icloud/mcp
- Authorization server metadata: https://figment.so/.well-known/oauth-authorization-server/icloud
- Scope: `messages:read`

Use the authorization, token, and registration endpoints returned by this issuer. Tokens from the Mac Hosting sign-in do not grant access to Messages.

## Connection not ready

A paid live connection can remain pending while Figment prepares and verifies its assigned Mac. Check [My connections](https://figment.so/icloud/account). Use a sandbox connection while live setup is pending. A pending connection does not require another payment.

A `401` before sign-in is the OAuth discovery step. The MCP client should follow the Bearer challenge. If `401` remains after sign-in, check the issuer and MCP resource, then complete the client's OAuth flow again. Do not put Apple passwords, verification codes, or Bearer tokens into chat.

A `503` with `temporarily_unavailable` means the service could not check access. Keep the existing OAuth session and retry after the returned `Retry-After` delay. It is not proof that the token expired or that another payment is needed.

## REST and access control

For a custom REST integration, use the [developer API quickstart](https://figment.so/icloud/developers). MCP and REST use the same connection permissions and readiness checks.

You can disconnect an app in [My connections](https://figment.so/icloud/account). Its tokens stop working. Other apps and the Mac's sign-in remain connected. To sign the hosted Mac out, use the separate owner log-out action.
