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

# Claude Code

> Claude Code is Anthropic's CLI tool for working with Claude directly in your terminal.

[Claude Code](https://docs.anthropic.com/en/docs/claude-code) is Anthropic's CLI tool for working with Claude directly in your terminal. You can connect it to Clickbase's MCP servers to query your analytics and manage your sites with natural language.

## Prerequisites

* Claude Code installed (`npm install -g @anthropic-ai/claude-code`).
* A Clickbase team with an active subscription — see [Authentication](/api/authentication).

## Setup

Add the [Reader](/ai/reader) server for reporting and Q\&A, the [Writer](/ai/writer) server if the agent should also manage sites, goals or funnels. Both use HTTP transport with OAuth 2.1 discovery — see [Connectors](/ai/overview) — so there is no API key to paste into the command.

<CodeGroup>
  ```bash title="Reader" theme={null}
  claude mcp add --transport http clickbase-reader https://clickbase.so/mcp/reader
  ```

  ```bash title="Writer" theme={null}
  claude mcp add --transport http clickbase-writer https://clickbase.so/mcp/writer
  ```
</CodeGroup>

This adds the servers to your project's `.mcp.json` file. To add them globally instead, append the `--scope user` flag.

## Manual configuration

You can also configure the servers manually by creating a `.mcp.json` file in your project root:

```json theme={null}
{
    "mcpServers": {
        "clickbase-reader": {
            "type": "http",
            "url": "https://clickbase.so/mcp/reader"
        },
        "clickbase-writer": {
            "type": "http",
            "url": "https://clickbase.so/mcp/writer"
        }
    }
}
```

For global configuration, add the same to `~/.claude.json`.

## Authorize

The first time Claude Code calls a Clickbase tool, it opens your browser to complete the OAuth authorization flow. Sign in and approve access — the resulting token acts within your current team, exactly like a REST API token.

## Verify it works

Start Claude Code and ask it to use Clickbase:

```bash theme={null}
claude
```

```
List my Clickbase sites
```

You should see Claude Code call the Reader's `list-sites-tool` and return your sites.
