---
title: Claude Code CLI Setup & Usage | Flyweel Docs
description: Connect Flyweel MCP to Claude Code CLI and query your Google Ads and Meta Ads campaigns with natural language. Setup guide, token config, and examples.
url: "https://www.flyweel.co/docs/mcp/claude-code-cli"
type: static
generatedAt: "2026-09-21T23:29:35.843Z"
---

![Documentation hero background](https://astro-flyweel-docs.vercel.app/vision-hero.webp)
# Claude Code CLI Setup & Usage

Claude Code is Anthropic’s command-line AI tool. It has native MCP support with OAuth built-in.

---

## Quick Setup (OAuth)[Link to this section](#quick-setup-oauth)

The fastest way to connect. No API key needed — you sign in to Flyweel in your browser and approve access.

### Step 1: Add the Server[Link to this section](#step-1-add-the-server)

Run:


*Terminal window*

```
claude mcp add --transport http flyweel-mcp-server https://api.flyweel.co/functions/v1/mcp-server/mcp
```

This opens your browser to sign in to Flyweel and approve access. Once approved, you’re connected.

### Step 2: Test It[Link to this section](#step-2-test-it)

Run Claude Code and ask:


**

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

If you see your accounts, you’re connected.

---

## Fallback: Connect with an API Key[Link to this section](#fallback-connect-with-an-api-key)

Only needed if OAuth isn’t available for you. Instead of signing in through the browser, you pass an API key as a header.
    Show API-key setup
**Step 1: Get your token**

 1. Go to [app.flyweel.co](https://app.flyweel.co)
 1. Click **Settings** → **API & MCP**
 1. Under **Advanced: use an API key instead**, click **Generate API key** (or **Create Token** to name your own)
 1. Copy it immediately — it won’t be shown again

Your token looks like: `fwl_a1b2c3d4...`
   Managing tokens
Toggle a key off to deactivate it, or use the trash icon to delete it.

**Step 2: Add the server with a header**

Run the same command with an `Authorization` header:

*Terminal window*

```
claude mcp add --transport http flyweel-mcp-server https://api.flyweel.co/functions/v1/mcp-server/mcp --header "Authorization: Bearer fwl_YOUR_TOKEN_HERE"
```

Replace `fwl_YOUR_TOKEN_HERE` with your actual token. This writes the server to your Claude Code config at `~/.claude.json`.
   Header alternative
`Authorization: Bearer fwl_…` is preferred. If your client only accepts a custom header, use `X-API-Key: fwl_…` instead.

---

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

### ”Authentication Error”[Link to this section](#authentication-error)

Your token is invalid or deleted.

**Fix:** Generate a new token at [app.flyweel.co](https://app.flyweel.co) → Settings → API & MCP, and re-add the server. Or reconnect via OAuth by re-running the `claude mcp add` command without the header.

### ”No accounts found”[Link to this section](#no-accounts-found)

You haven’t connected ad accounts to Flyweel.

**Fix:** Go to Settings → Connections in Flyweel and connect your Google Ads or Meta Ads.

### Claude Code doesn’t see Flyweel[Link to this section](#claude-code-doesnt-see-flyweel)

The server wasn’t added correctly.

**Fix:**

 1. Run `claude mcp list` to confirm `flyweel-mcp-server` is listed
 1. If it’s missing, re-run the `claude mcp add` command above
 1. Verify the config at `~/.claude.json` if you edited it by hand
 1. Restart Claude Code completely

---

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

 - [What can you ask?](/docs/mcp/setup#what-can-you-ask)
 - [Technical reference](/docs/mcp/setup#technical-reference)
 - [Request a feature](/docs/mcp/setup#request-a-feature)

### Ready to get started?

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