# Connect Your iMessage History to Gemini CLI

Canonical: https://figment.so/blog/gemini-cli-read-search-imessage-history

Add Figment Messages as a remote MCP server in Gemini CLI, complete OAuth, and verify read-only access before searching a conversation.

Connect Gemini CLI to your iMessage history with our remote Messages MCP server. Add the server, complete Figment OAuth, and verify the connection before searching. This route is for Gemini CLI; it does not establish the same tools in the Gemini app.

Start with our [Messages setup guide](/icloud/agents.md). We recommend a known conversation and one source-backed answer as the first result.

## What server should I configure?

Use the remote HTTP MCP address:

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

The OAuth issuer is `https://figment.so/icloud`, and the permission is `messages:read`. A compatible public client can register automatically. Do not paste a personal API token into the prompt or create a developer app just to use this MCP route.

Google documents remote servers and OAuth in its [Gemini CLI MCP guide](https://geminicli.com/docs/tools/mcp-server/). Follow that guide for your installed version. A configuration entry uses this server address:

```json
{
  "mcpServers": {
    "figment-messages": {
      "httpUrl": "https://figment.so/api/icloud/mcp"
    }
  }
}
```

Merge that entry into your existing settings rather than replacing unrelated configuration. Restart or refresh the CLI as its current guide requires.

## How do I approve and verify access?

Use Gemini CLI's documented authentication command when the server requires OAuth:

```text
/mcp auth figment-messages
```

Complete the browser approval. Select the intended Figment connection and approve read access. Then ask Gemini CLI to call `figment_get_messages_connection`.

Check whether the connection is sandbox or live. Sandbox results are synthetic. Live setup can remain pending while we prepare and verify the assigned Mac. A pending connection does not need another payment.

Apple credentials belong on Figment's setup page when required. Do not enter them or verification codes into the CLI conversation.

## What should the first message search do?

Ask the agent to identify the chat before reading it:

```text
Check my Figment Messages connection and report its mode.
List conversations so I can select the chat with the venue.
Find the latest confirmed start time for our December 4 booking.
Show the supporting message and its timestamp in my timezone.
Do not send a message.
```

The tools are `figment_get_messages_connection`, `figment_list_conversations`, `figment_list_messages`, and `figment_search_messages`. Use the selected conversation's returned `chatGuid` for reading messages. All four tools are read-only.

Check a familiar message before relying on an unfamiliar answer. A title or display name alone can identify the wrong group. Ask for participants or other conversation details when several chats match.

## How do I search older dates correctly?

State the date range and timezone. Follow returned pagination. A page of recent messages cannot establish that there were no relevant messages months earlier.

Live results cover history available on the assigned Mac. They are not a guaranteed complete iCloud archive. If the requested period is unavailable, ask Gemini CLI to describe what it checked and what remains unknown.

For an agreement that changed over time, inspect the sequence. A proposed time is not necessarily the final time. Require the latest explicit confirmation and its source.

## Can Gemini CLI send a reply?

Not through these Figment tools. It can prepare a draft for you to review and send separately. The same connection does not expose Notes, Calendar, Drive, Mail, or Passwords.

If a request is temporarily unavailable, retain the OAuth session and follow the returned retry delay. For persistent authorization errors, check the server address and issuer before repeating the OAuth flow. Our [iMessage MCP overview](/imessage-mcp) explains the permission and history boundaries.
