# Claude Code

> Add IndexZero to Claude Code with one command and approve it in the browser.

Source: https://docs.indexzero.site/agents/claude-code



Claude Code supports remote MCP servers over Streamable HTTP with OAuth, so it needs only the endpoint URL.

<Steps>
  <Step>
    ### Add the server [#add-the-server]

    ```bash
    claude mcp add --transport http indexzero https://app.indexzero.site/mcp
    ```

    Add `--scope user` to make it available in every project on the machine rather than just the current directory, or `--scope project` to check the configuration into the repository's `.mcp.json` for the rest of your team.
  </Step>

  <Step>
    ### Approve the connection [#approve-the-connection]

    The first time Claude Code talks to the server, it opens a browser window on app.indexzero.site. Sign in if you are not already, then approve the connection. The consent screen names the client and the scopes it asked for (`mcp`, and `offline_access` if it wants a refresh token).
  </Step>

  <Step>
    ### Confirm it works [#confirm-it-works]

    In a Claude Code session, ask:

    > List my IndexZero projects.

    You should get the projects you see in the dashboard. Run `/mcp` inside Claude Code to see the server's status and re-authenticate if needed.
  </Step>
</Steps>

## Checking in the configuration [#checking-in-the-configuration]

For a project-scoped setup, `.mcp.json` at the repository root looks like this:

```json title=".mcp.json"
{
  "mcpServers": {
    "indexzero": {
      "type": "http",
      "url": "https://app.indexzero.site/mcp"
    }
  }
}
```

Each teammate goes through their own OAuth approval and connects their own workspace; the file holds no credentials.

## Using an API key instead [#using-an-api-key-instead]

If the machine cannot open a browser (a CI runner, a remote box), create an [API key](/agents/api-keys) and pass it as a header:

```bash
claude mcp add --transport http indexzero https://app.indexzero.site/mcp \
  --header "x-api-key: iz_your_key_here"
```

## Removing the server [#removing-the-server]

```bash
claude mcp remove indexzero
```

Revoking access on the IndexZero side is done from the app: delete the API key, or, for OAuth, disconnect the client from the AI & MCP page.
