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

# Claude Code

> Connect StackOne MCP to Claude Code using built-in MCP commands.

## Overview

[Claude Code](https://code.claude.com/) is Anthropic's CLI for developers. It provides built-in commands for managing MCP servers.

<Info>
  For complete Claude Code MCP documentation, see the [official MCP guide](https://code.claude.com/docs/en/mcp).
</Info>

## Environment Variables (Recommended)

Set your API key once in your shell profile (`~/.bashrc`, `~/.zshrc`, etc.) to reuse across multiple servers:

<Tabs>
  <Tab title="macOS / Linux">
    ```bash theme={null}
    export STACKONE_AUTH_TOKEN=$(echo -n "{stackone_api_key}:" | base64)
    ```
  </Tab>

  <Tab title="Windows (PowerShell)">
    ```powershell theme={null}
    $env:STACKONE_AUTH_TOKEN = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("{stackone_api_key}:"))
    ```

    To persist across sessions, add to your PowerShell profile (`$PROFILE`).
  </Tab>
</Tabs>

Reload your shell or run `source ~/.zshrc` (macOS/Linux) to apply.

## Setup

<Steps>
  <Step title="Add StackOne MCP Server">
    Run the following command in your terminal:

    ```bash theme={null}
    claude mcp add \
      --transport http \
      --header "Authorization: Basic $STACKONE_AUTH_TOKEN" \
      gsheets \
      "https://api.stackone.com/mcp?x-account-id={account_id}"
    ```

    **Replace:**

    * `{account_id}`: Your StackOne linked account ID

    <Tip>
      Use short names for easier CLI usage: `gsheets`, `slack`, `hubspot-sales`. You can prefix with `stackone-` or `s1-` if you have other MCP servers, but it's not required.
    </Tip>

    <Accordion title="Alternative: Account ID as header">
      You can also pass the account ID as a header:

      ```bash theme={null}
      claude mcp add \
        --transport http \
        --header "Authorization: Basic $STACKONE_AUTH_TOKEN" \
        --header "x-account-id: {account_id}" \
        gsheets \
        https://api.stackone.com/mcp
      ```
    </Accordion>
  </Step>

  <Step title="Verify Connection">
    Check the server status:

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

    <Frame caption="Screenshots show 'stackone-' prefix — this is optional.">
      <img src="https://mintcdn.com/stackone-60/77sEEdKO-IR2XOp6/images/mcp/claude-code-mcp-list.png?fit=max&auto=format&n=77sEEdKO-IR2XOp6&q=85&s=4bc371fc35be224f126d66e30de76659" alt="claude mcp list output showing multiple connected MCP servers" width="1079" height="181" data-path="images/mcp/claude-code-mcp-list.png" />
    </Frame>

    Within a Claude Code session, use the `/mcp` command to view server details and available tools:

    <Frame>
      <img src="https://mintcdn.com/stackone-60/77sEEdKO-IR2XOp6/images/mcp/claude-code-mcp-server-details.png?fit=max&auto=format&n=77sEEdKO-IR2XOp6&q=85&s=1423f74c2f8d1ae3d90101f521a5a6fd" alt="Claude Code /mcp command showing server details including status, URL, capabilities and tool count" width="1654" height="556" data-path="images/mcp/claude-code-mcp-server-details.png" />
    </Frame>

    Select "View tools" to browse available operations:

    <Frame>
      <img src="https://mintcdn.com/stackone-60/77sEEdKO-IR2XOp6/images/mcp/claude-code-mcp-tools.png?fit=max&auto=format&n=77sEEdKO-IR2XOp6&q=85&s=d93dba2b3e2786c6a081d1dc2d7981e8" alt="Claude Code /mcp command showing list of available tools for googlesheets server" width="1334" height="396" data-path="images/mcp/claude-code-mcp-tools.png" />
    </Frame>
  </Step>
</Steps>

## Adding Multiple Accounts

Add additional servers with distinct names:

```bash theme={null}
# Google Sheets account
claude mcp add \
  --transport http \
  --header "Authorization: Basic $STACKONE_AUTH_TOKEN" \
  gsheets \
  "https://api.stackone.com/mcp?x-account-id={google_sheets_account_id}"

# Slack account
claude mcp add \
  --transport http \
  --header "Authorization: Basic $STACKONE_AUTH_TOKEN" \
  slack \
  "https://api.stackone.com/mcp?x-account-id={slack_account_id}"
```

## Scope Options

Control where the configuration is stored:

| Scope   | Flag              | Storage Location                    | Use Case                                |
| ------- | ----------------- | ----------------------------------- | --------------------------------------- |
| Local   | (default)         | `.claude.json` in current directory | Project-specific                        |
| Project | `--scope project` | `.mcp.json` at project root         | Team collaboration (version controlled) |
| User    | `--scope user`    | `~/.claude.json`                    | Personal tools across all projects      |

**Example with user scope** (available across all projects):

```bash theme={null}
claude mcp add \
  --transport http \
  --scope user \
  --header "Authorization: Basic $STACKONE_AUTH_TOKEN" \
  gsheets \
  "https://api.stackone.com/mcp?x-account-id={account_id}"
```

## Management Commands

```bash theme={null}
claude mcp list                           # View all configured servers
claude mcp get gsheets     # Show details for specific server
claude mcp remove gsheets  # Remove a server
```

## Programmatic Integration

For programmatic integration with Anthropic's Claude API, see the [Anthropic SDK Framework Guide](/mcp/framework-guides/anthropic-sdk).

## Next Steps

<CardGroup cols={2}>
  <Card title="Claude Desktop" icon="desktop" href="/mcp/app-guides/claude-desktop">
    Set up MCP in the Claude Desktop app
  </Card>

  <Card title="Authentication Guide" icon="lock" href="/mcp/auth-security">
    Configure authentication and security
  </Card>
</CardGroup>
