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

# Installation

> Install the MutagenT CLI and SDK

# Installation

Install MutagenT tools for your development environment.

## CLI (Recommended)

The CLI is the primary developer interface for MutagenT. It handles authentication, framework integration, and trace management.

<CodeGroup>
  ```bash bun (recommended) theme={null}
  bun add -g @mutagent/cli
  ```

  ```bash npm theme={null}
  npm install -g @mutagent/cli
  ```
</CodeGroup>

### Verify Installation

```bash theme={null}
mutagent --version
# @mutagent/cli v0.1.186
```

### Authenticate

After installing, log in to connect the CLI to your MutagenT account. The CLI presents two authentication methods interactively: browser-based OAuth or pasting an API key.

```bash theme={null}
mutagent auth login
```

You can also specify the authentication method directly:

```bash theme={null}
# Browser-based OAuth flow
mutagent auth login --browser

# Direct API key (for CI/CD pipelines)
export MUTAGENT_API_KEY=mt_xxxxxxxxxxxx
# OR use non-interactive mode:
mutagent auth login --non-interactive
```

Check your authentication status at any time:

```bash theme={null}
mutagent auth status
```

<Tip>
  For CI/CD environments, set the `MUTAGENT_API_KEY` environment variable (no login needed). The CLI also respects `CI=true` and `MUTAGENT_NON_INTERACTIVE=true` to auto-select browser auth.
</Tip>

See [CLI Documentation](/cli/overview) for full details.

## SDK (Optional)

The SDKs provide programmatic access for advanced use cases: direct API access, custom integrations, or scripting.

<Tabs>
  <Tab title="TypeScript">
    The TypeScript SDK (`@mutagent/sdk` v0.2.137):

    <CodeGroup>
      ```bash bun theme={null}
      bun add @mutagent/sdk
      ```

      ```bash npm theme={null}
      npm install @mutagent/sdk
      ```

      ```bash yarn theme={null}
      yarn add @mutagent/sdk
      ```

      ```bash pnpm theme={null}
      pnpm add @mutagent/sdk
      ```
    </CodeGroup>

    ```typescript theme={null}
    import { Mutagent } from '@mutagent/sdk';

    const client = new Mutagent({
      security: { apiKey: process.env.MUTAGENT_API_KEY },
    });

    console.log('MutagenT TypeScript SDK installed successfully');
    ```
  </Tab>

  <Tab title="Python">
    The Python SDK (`mutagent-sdk` v0.1.1) — requires Python 3.10+:

    ```bash theme={null}
    pip install mutagent-sdk
    ```

    ```python theme={null}
    from mutagent import Mutagent

    client = Mutagent()  # reads MUTAGENT_API_KEY from environment
    print('MutagenT Python SDK installed successfully')
    ```

    See the [Python SDK Installation guide](/sdk/python/installation) for full setup.
  </Tab>
</Tabs>

## Integration Packages

Most developers use integration packages that auto-trace LLM framework calls. Install the one matching your framework.

<Tabs>
  <Tab title="TypeScript">
    <CodeGroup>
      ```bash LangChain theme={null}
      bun add @mutagent/langchain
      ```

      ```bash LangGraph theme={null}
      bun add @mutagent/langgraph
      ```

      ```bash OpenAI theme={null}
      bun add @mutagent/openai
      ```

      ```bash Mastra (Coming Soon) theme={null}
      # @mutagent/mastra is not yet published — coming soon
      # bun add @mutagent/mastra
      ```

      ```bash Vercel AI theme={null}
      bun add @mutagent/vercel-ai
      ```
    </CodeGroup>

    <Note>
      You do not need to install integration packages manually if you use `mutagent integrate`. The CLI generates the integration code and tells you which package to install.
    </Note>
  </Tab>

  <Tab title="Python">
    <Warning>
      The Python integration packages are pending publication to PyPI. Until then, install from source. See [Python Integrations](/integrations/python/overview) for setup guides.
    </Warning>

    See [Python Integrations](/integrations/python/overview) for setup guides.
  </Tab>
</Tabs>

## Environment Variables

| Variable                   | Purpose                                        | Default                   |
| -------------------------- | ---------------------------------------------- | ------------------------- |
| `MUTAGENT_API_KEY`         | API key for authentication (SDK and CLI)       | --                        |
| `MUTAGENT_ENDPOINT`        | Custom API endpoint                            | `https://api.mutagent.io` |
| `MUTAGENT_DEBUG`           | Enable debug logging for span start/end events | No                        |
| `MUTAGENT_NON_INTERACTIVE` | Set to `true` to skip interactive prompts      | `false`                   |

## System Requirements

### TypeScript / Node.js

| Requirement | Version            |
| ----------- | ------------------ |
| Node.js     | 18.0+              |
| Bun         | 1.0+               |
| TypeScript  | 5.0+ (recommended) |

### Python

| Requirement | Version |
| ----------- | ------- |
| Python      | 3.10+   |
