> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chatsyncs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Gemini CLI to ChatSyncs

> Step-by-step: add ChatSyncs to Google's Gemini CLI with gemini mcp add --scope user --transport http and your API key in an Authorization header, or the equivalent mcpServers entry with httpUrl in ~/.gemini/settings.json, check it with /mcp, and remove it with gemini mcp remove. Explains why Gemini CLI uses the API key directly instead of browser sign-in. Use when a customer asks how to connect Gemini CLI to ChatSyncs, or gets a Missing issuer parameter error.

Use ChatSyncs from Gemini CLI, Google's AI agent for the terminal.

## Before you start

* **Gemini CLI installed and signed in.** Run `gemini --version`. If it isn't found, install it
  from [geminicli.com](https://geminicli.com).
* **A terminal.** On a Mac, open the **Terminal** app (Applications → Utilities). On Windows,
  open **PowerShell** from the Start menu. In paths below, `~` means your home folder.
* **Your ChatSyncs API key**, from the
  [API Developer Console](https://platform.chatsyncs.com/api/developer/console).
  [How to find it](/mcp/api-key).

<Note>
  Unlike the other apps, Gemini CLI connects with your **API key directly**, not through the
  ChatSyncs browser sign-in page. Gemini CLI asks sign-in pages for an extra security detail that
  ChatSyncs doesn't send yet. The key method below works today.
</Note>

## Connect

<Steps>
  <Step title="Open a terminal">
    Mac: the **Terminal** app. Windows: **PowerShell**. Check Gemini CLI is there by running
    `gemini --version`: it should print a version number.
  </Step>

  <Step title="Add ChatSyncs with your key">
    In a terminal, run this command, with `YOUR_CHATSYNCS_API_KEY` replaced by your key (keep the
    word `Bearer` and the space after it):

    ```bash theme={null}
    gemini mcp add --scope user --transport http --header "Authorization: Bearer YOUR_CHATSYNCS_API_KEY" chatsyncs https://mcp.chatsyncs.com/mcp
    ```

    `--scope user` makes ChatSyncs available in every folder, not just the current one.
  </Step>

  <Step title="Check it's listed">
    Run `gemini`, then type `/mcp` and press Enter. **chatsyncs** is listed as connected, with
    its tools.
  </Step>
</Steps>

### Prefer editing the file?

The command above edits `~/.gemini/settings.json` for you, which is the easiest way. If you'd
rather edit the file yourself, the ChatSyncs part looks like this. If the file already has other
settings, put `"mcpServers"` next to them inside the outer `{ }`, separated by a comma:

```json theme={null}
{
  "mcpServers": {
    "chatsyncs": {
      "httpUrl": "https://mcp.chatsyncs.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_CHATSYNCS_API_KEY"
      }
    }
  }
}
```

## Check it worked

In Gemini CLI, ask:

> **"List my WhatsApp templates."**

Gemini asks you to confirm the ChatSyncs tool call, then lists your templates.

## Disconnect

```bash theme={null}
gemini mcp remove --scope user chatsyncs
```

Your key was stored in `~/.gemini/settings.json`; removing the server deletes it from there.
If the key may have been seen by anyone else, [regenerate it](/mcp/api-key#revoke-access-regenerate-the-key).

## Frequently asked

<AccordionGroup>
  <Accordion title="Is it safe to put my key in that file?">
    It's stored in plain text in `settings.json` (in the `.gemini` folder in your home folder),
    and the command you typed may be kept in your terminal's list of past commands. That's fine on your own computer. Don't
    share or sync the file, and regenerate the key if you stop using Gemini CLI or the computer
    is shared.
  </Accordion>

  <Accordion title="Can I make Gemini skip the confirmations?">
    Gemini CLI has a `"trust": true` setting that skips every confirmation for a server.
    **Don't use it with ChatSyncs:** it would let Gemini send WhatsApp messages without asking.
  </Accordion>

  <Accordion title="Will browser sign-in work later?">
    Once ChatSyncs supports Gemini CLI's extra sign-in check, this page will be updated. The key
    method will keep working either way.
  </Accordion>
</AccordionGroup>

## Gotchas

<Warning>
  * **"Missing issuer parameter in response."** You added ChatSyncs without the `--header`
    part, so Gemini tried browser sign-in. Remove it and add it again with the command above.
  * **Added it but it's missing in another folder.** You left out `--scope user`, so it was
    saved only for the folder you were in. Remove it with `gemini mcp remove chatsyncs` and add
    it again with `--scope user`.
  * **Every action says the key is missing or invalid.** Check the header reads exactly
    `Authorization: Bearer ` followed by your key, with nothing else and no extra spaces.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.