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

# Use Chief with your AI coding agent

> Connect Chief to Claude Code, Cursor, or Codex and start asking questions in minutes — no SDK or curl required.

Chief gives your AI coding agent direct access to your project. Ask questions about
everything your team has uploaded, add new documents, and automate the busywork —
right from Claude Code, Cursor, or Codex. No SDK, no curl, no boilerplate to get
started.

<Note>
  **Claude Code runs on your computer, not in a browser tab.** You may have chatted with Claude
  on the web — Claude Code is different: it runs in your terminal, so it can reach your files and
  your Chief project and *build* things for you. Once it's connected you can both **ask** Chief
  questions and **hand it these docs and have it build** an integration for you. This guide sets
  up both.
</Note>

## What you'll need

* **An AI coding agent installed** — [Claude Code](https://docs.claude.com/en/docs/claude-code/overview),
  [Cursor](https://cursor.com), or [Codex](https://github.com/openai/codex). This guide uses
  Claude Code in its examples.
* **A terminal** — the macOS **Terminal** app, or **Windows Terminal** / **PowerShell** on
  Windows. This is where you run the commands below.
* **A Chief account** with access to a project.

<Accordion title="New to the terminal or Claude Code? Start here.">
  The terminal is a text window where you type commands instead of clicking. To open one:

  * **macOS** — press `Cmd + Space`, type `Terminal`, and press Enter.
  * **Windows** — press the Start button and type `Terminal`, `PowerShell`, or `Command
    Prompt`. Any of the three works.

  Claude Code is the agent that runs *inside* that terminal. Install it by following the
  [official install guide](https://docs.claude.com/en/docs/claude-code/overview), then type
  `claude` in your terminal to start it. Once it's running, come back and follow the three
  steps below.

  **If the install is blocked or warns you:**

  * **Windows** may show "Windows protected your PC" (SmartScreen). Click **More info → Run
    anyway**.
  * **macOS** may say the app "can't be opened." Open **System Settings → Privacy & Security**
    and choose **Open Anyway**.
  * **Locked-down work computers** often block new software outright. If an install is refused
    no matter what, run through this on a personal computer instead.

  These warnings are normal for new developer tools — they aren't errors. Install only from the
  official links above, then allow it to run.
</Accordion>

## Connect your agent to Chief

Four steps and your agent is talking to Chief.

<Steps>
  <Step title="Install Claude Code">
    If you don't have it yet, install Claude Code with the recommended native installer:

    <CodeGroup>
      ```bash macOS / Linux theme={null}
      curl -fsSL https://claude.ai/install.sh | bash
      ```

      ```powershell Windows (PowerShell) theme={null}
      irm https://claude.ai/install.ps1 | iex
      ```
    </CodeGroup>

    Then type `claude` in your terminal to start it. For other install methods and
    troubleshooting, see the
    [official install guide](https://docs.claude.com/en/docs/claude-code/overview). Prefer
    Cursor or Codex? Use either — you'll find their setup in step 4.
  </Step>

  <Step title="Get your Chief token">
    Sign in to Chief. Open your account menu (bottom-left), go to **Settings**, open the
    **API tokens** tab, and choose **Create token**.

    <Frame caption="Account menu → Settings → API tokens → Create token.">
      <img src="https://mintcdn.com/chief-2d405d1a/QGBlzHNeqRlizFjv/images/demos/web-settings-tokens.png?fit=max&auto=format&n=QGBlzHNeqRlizFjv&q=85&s=b262ea2287613f6db9e1f48fb129b175" alt="Chief Settings showing the path to the API tokens tab and the Create token button" width="2922" height="1482" data-path="images/demos/web-settings-tokens.png" />
    </Frame>

    Give the token a name, pick an expiration, and select **Generate token**.

    <Frame caption="Name the token and choose an expiration, then Generate token.">
      <img src="https://mintcdn.com/chief-2d405d1a/QGBlzHNeqRlizFjv/images/demos/web-create-token.png?fit=max&auto=format&n=QGBlzHNeqRlizFjv&q=85&s=c0d80128bf6f1aa21f2efb2d36901a72" alt="Chief's Create a personal access token dialog with a name field and expiration selector" width="1020" height="752" data-path="images/demos/web-create-token.png" />
    </Frame>

    Copy the token as soon as it appears — it starts with `pat_`.

    <Warning>
      The token is shown **only once**. Copy it now. If you lose it, delete it and create a
      new one — there's no penalty.
    </Warning>

    You'll also need your **project id** (it starts with `project_`). Find it in the URL of
    any project page — it's the segment right after `/project/`:

    <Frame caption="Your project id is the /project/ segment of any project URL.">
      <img src="https://mintcdn.com/chief-2d405d1a/QGBlzHNeqRlizFjv/images/demos/web-project-id.png?fit=max&auto=format&n=QGBlzHNeqRlizFjv&q=85&s=cdd4eec66bd5e165dc49cf209757b2ff" alt="Browser address bar showing a Chief project URL with the project id segment highlighted" width="1080" height="300" data-path="images/demos/web-project-id.png" />
    </Frame>

    You'll paste both into your agent's config below.
  </Step>

  <Step title="Install the Chief MCP server">
    ```bash theme={null}
    brew install --cask Storytell-ai/tap/chief-mcp
    ```

    Other install options (Go, prebuilt binaries) are on the
    [MCP server page](/mcp/overview#install).
  </Step>

  <Step title="Connect Claude Code">
    ```bash theme={null}
    claude mcp add chief \
      -e CHIEF_API_KEY=<your-token> \
      -e CHIEF_PROJECT_ID=<your-project-id> \
      -- chief-mcp stdio
    ```

    Restart Claude Code so it picks up the new server — that's it.

    <Frame caption="After connecting, /mcp shows the Chief server and its tools — that's how you know it worked.">
      <img src="https://mintcdn.com/chief-2d405d1a/QGBlzHNeqRlizFjv/images/demos/agent-mcp-connected.png?fit=max&auto=format&n=QGBlzHNeqRlizFjv&q=85&s=e057ed86faf0bbfb6de951baa2fe6cdb" alt="Claude Code's /mcp panel showing the chief server connected with 44 tools" width="2000" height="870" data-path="images/demos/agent-mcp-connected.png" />
    </Frame>

    <Accordion title="Using Cursor or Codex instead?">
      <Tabs>
        <Tab title="Cursor">
          [![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=chief\&config=eyJjb21tYW5kIjoiY2hpZWYtbWNwIiwiYXJncyI6WyJzdGRpbyJdLCJlbnYiOnsiQ0hJRUZfQVBJX0tFWSI6IiIsIkNISUVGX1BST0pFQ1RfSUQiOiIifX0=)

          After install, open the server in **Cursor Settings → MCP** and fill in your
          `CHIEF_API_KEY` and `CHIEF_PROJECT_ID`. Prefer to paste config by hand? See
          [MCP clients → Cursor](/mcp/clients).
        </Tab>

        <Tab title="Codex">
          Add to `~/.codex/config.toml`:

          ```toml theme={null}
          [mcp_servers.chief]
          command = "chief-mcp"
          args = ["stdio"]
          env = { CHIEF_API_KEY = "<your-token>", CHIEF_PROJECT_ID = "<your-project-id>" }
          ```
        </Tab>
      </Tabs>

      Using a different client, or want HTTP transport? The full matrix is on
      [MCP clients](/mcp/clients).
    </Accordion>
  </Step>
</Steps>

## Try it

Once your agent is connected, paste this in:

<Tip>
  "Using Chief, what are the main themes across everything in my project?"
</Tip>

Your agent calls Chief, reads your project, and answers — no code from you. Ask it
anything about your project: list what you've uploaded, summarize a document, or pull
the themes across everything.

<Frame caption="Claude Code listing a project's files through the Chief MCP tools.">
  <img src="https://mintcdn.com/chief-2d405d1a/QGBlzHNeqRlizFjv/images/demos/agent-list-files.png?fit=max&auto=format&n=QGBlzHNeqRlizFjv&q=85&s=a7fdcea579e501edf45a35adc59681b8" alt="A Claude Code session using the Chief MCP tools to list the files uploaded to a project" width="2000" height="1239" data-path="images/demos/agent-list-files.png" />
</Frame>

## Have your agent build an integration for you

Connecting over MCP lets your agent *talk to* Chief. You can also ask it to *build* against
the Chief API — a script, a sync job, whatever you need — and it will read this
documentation and write the code.

In your terminal, set your credentials so the agent doesn't need them in the chat, then
describe what you want:

```bash theme={null}
export CHIEF_API_KEY="pat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
export CHIEF_PROJECT_ID="project_xxxxxxxxxxxxxxxxxxxx"
```

### Starter prompts

A few prompts to start from — paste one in and adjust it to your goal:

* *"Read the Chief API docs at [https://dev.chief.bot](https://dev.chief.bot). Using `CHIEF_API_KEY` and
  `CHIEF_PROJECT_ID` from my environment, write a script that uploads every PDF in this folder
  to my project and labels them `contracts`."*
* *"Ask my Chief project for the three biggest risks across everything we've uploaded this
  quarter, and print the answer."*
* *"Create a Chief action that emails me a summary of new uploads every weekday morning."*
* *"Write a script that pulls this week's new assets from my Chief project and posts a short
  summary to our team's Slack channel."*

<Tip>
  Point your agent straight at the docs and let it read what it needs. There's an
  agent-readable index at [`https://dev.chief.bot/llms.txt`](https://dev.chief.bot/llms.txt).
</Tip>

The agent reads the [reference](/api-reference/introduction), writes the code, and runs it.
Start small, then build up.

## Prefer to do it yourself?

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Zero to a chat response with plain `curl`.
  </Card>

  <Card title="Go SDK" icon="golang" href="/tools/go-sdk">
    Typed Go client, one service per resource.
  </Card>

  <Card title="CLI" icon="terminal" href="/tools/cli/overview">
    The `chief` command for scripts, CI, and your shell.
  </Card>

  <Card title="API reference" icon="book-open" href="/api-reference/introduction">
    Every endpoint, with an interactive playground.
  </Card>
</CardGroup>
