> ## 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>

## Setup

<Tip>
  The fastest way to get your configuration is directly from the StackOne dashboard — it generates a ready-to-paste `claude mcp add` command. See [Connect from Dashboard](/mcp/connect-from-dashboard).
</Tip>

<Steps>
  <Step title="Get your MCP URL from the dashboard">
    1. Go to **Connectors** in the left nav and open the connector you want to use
    2. Click **Use Connector** in the top right
    3. On the **Use** tab, click **MCP Server** under "Use with Agent Client"
    4. Select a linked account from the dropdown
    5. Choose **Claude Code** as the client
    6. Copy the generated command

    The command uses a single token URL — no API key encoding required.

    <Tip>
      The token expires after one year. Regenerate it at any time using the refresh button in the MCP tile.
    </Tip>
  </Step>

  <Step title="Add StackOne MCP Server">
    Run the command from the dashboard in your terminal. It looks like this:

    ```bash theme={null}
    claude mcp add \
      --transport http \
      gsheets \
      "https://api.stackone.com/mcp?token={session_token}"
    ```

    <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: Manual API key setup">
      If you prefer to use your API key and account ID directly, set your encoded API key as an environment variable first:

      <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}:"))
          ```
        </Tab>
      </Tabs>

      Then add the server:

      ```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}"
      ```
    </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

Get a separate token for each account from the dashboard, then add them as distinct servers:

```bash theme={null}
# Google Sheets account
claude mcp add \
  --transport http \
  gsheets \
  "https://api.stackone.com/mcp?token={google_sheets_session_token}"

# Slack account
claude mcp add \
  --transport http \
  slack \
  "https://api.stackone.com/mcp?token={slack_session_token}"
```

## 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 \
  gsheets \
  "https://api.stackone.com/mcp?token={session_token}"
```

## 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>
