---
title: Gemini CLI MCP Setup Guide | Flyweel Docs
description: Connect Flyweel MCP to Google's Gemini CLI with one gemini mcp add command or by editing settings.json, then test the connection and fix common errors.
url: "https://www.flyweel.co/docs/mcp/gemini-cli"
type: static
generatedAt: "2026-10-07T04:41:33.549Z"
---

![Documentation hero background](https://astro-flyweel-docs.vercel.app/vision-hero.webp)
# Gemini CLI

To connect Flyweel MCP to **Gemini CLI** (Google’s terminal AI agent), add an entry to `~/.gemini/settings.json` under `mcpServers` with `httpUrl` set to `https://api.flyweel.co/functions/v1/mcp-server/mcp` and an `X-API-Key` header. Gemini CLI supports remote HTTP MCP servers natively, so no shim is required.

---

## Option A: One command (recommended)[Link to this section](#option-a-one-command-recommended)


*Terminal window*

```
gemini mcp add --transport http \  --header "X-API-Key: fwl_YOUR_TOKEN_HERE" \  flyweel-mcp-server \  https://api.flyweel.co/functions/v1/mcp-server/mcp
```

Gemini writes this to `~/.gemini/settings.json` automatically. Replace `fwl_YOUR_TOKEN_HERE` with your token from [app.flyweel.co](https://app.flyweel.co) (Settings → API & MCP).

### Scope flag[Link to this section](#scope-flag)

 - `-s user` (default) writes to `~/.gemini/settings.json` (all projects)
 - `-s project` writes to `.gemini/settings.json` in the current repo

---

## Option B: Edit settings.json directly[Link to this section](#option-b-edit-settingsjson-directly)

Path: `~/.gemini/settings.json`

Path: `%USERPROFILE%\.gemini\settings.json`


**

```
{  "mcpServers": {    "flyweel-mcp-server": {      "httpUrl": "https://api.flyweel.co/functions/v1/mcp-server/mcp",      "headers": {        "X-API-Key": "fwl_YOUR_TOKEN_HERE"      },      "timeout": 30000,      "description": "Flyweel MCP: Google, Meta, TikTok Ads plus Pipedrive CRM"    }  }}
```

---

## Test it[Link to this section](#test-it)


**

```
/mcp
```

This lists configured servers. `flyweel-mcp-server` should appear with 8 tools.

Then ask:


**

```
What Google Ads accounts do I have connected to Flyweel?
```

---

## Troubleshooting[Link to this section](#troubleshooting)

### ”Server not found”[Link to this section](#server-not-found)

Settings file is missing or malformed.

**Fix:** Run `cat ~/.gemini/settings.json | jq .`. It should parse cleanly.

### 401 unauthorized[Link to this section](#401-unauthorized)

API key is wrong or the header is missing.

**Fix:** Run `gemini mcp list`, then `gemini mcp remove flyweel-mcp-server`, then rerun Option A.

---

## Next Steps[Link to this section](#next-steps)

 - [What can you ask?](/docs/mcp/setup#what-can-you-ask)
 - [Other MCP Clients](/docs/mcp/other)

### Ready to get started?

Start optimizing your ad spend today with Flyweel.
  [Start Free](https://signup.flyweel.co/?variant=control)