# Gemini CLI

Gemini CLI can read your fivebar stats over MCP, and answer questions about them.

Ask it about your sites in your own words, such as why traffic jumped on Tuesday, and it answers from your figures, following fivebar’s rules about what they mean. Working in your site’s code, it can also [add fivebar to it](https://fiveb.ar/docs/coding-assistants.md) and check it’s working. Connecting is adding fivebar’s address, signing in and choosing Allow, with no key to copy.

## Add fivebar

Run:

```
gemini mcp add --transport http -s user fivebar https://fiveb.ar/api/mcp
```

Without `-s user` it’s added for the project you’re in alone. Or add it to `~/.gemini/settings.json`:

```
{
  "mcpServers": {
    "fivebar": {
      "httpUrl": "https://fiveb.ar/api/mcp"
    }
  }
}
```

## Sign in

Gemini CLI opens your browser the first time it reaches fivebar. To sign in again, run `/mcp auth fivebar`. It needs a browser on the same computer, so it can’t sign in over SSH.

fivebar opens in your browser. Sign in if you need to, check that the page names Gemini CLI, and choose Allow. Gemini CLI can then [read the stats](https://fiveb.ar/docs/mcp.md#what-an-app-can-read) of every site on your Sites page, and changes nothing of yours unless you also tick the box to let it [change settings](https://fiveb.ar/docs/mcp.md#changing-settings).

## Try it

Ask Gemini CLI about your sites in your own words, such as:

- Which pages did best last week, and where did their visitors come from?
- How does this month compare with last month so far?
- How many people are on my site right now?

## Removing it

Delete fivebar from `settings.json`.

To stop Gemini CLI reading your stats from fivebar’s side, disconnect it in [Settings](https://fiveb.ar/settings).

More in [Gemini CLI’s own documentation](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md).
