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

# Installation

> Install BoltzPay SDK, MCP server, or CLI.

## Prerequisites

* **Node.js** >= 20.0.0
* **Package manager**: npm, pnpm, or yarn

## SDK

Install the SDK in your TypeScript or JavaScript project:

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install @boltzpay/sdk
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add @boltzpay/sdk
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn add @boltzpay/sdk
    ```
  </Tab>
</Tabs>

The SDK works in **explore mode** with zero configuration: you can quote prices, diagnose endpoints, and discover APIs without any credentials.

To enable payments, install the Coinbase CDP SDK peer dependency:

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install @coinbase/cdp-sdk
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add @coinbase/cdp-sdk
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn add @coinbase/cdp-sdk
    ```
  </Tab>
</Tabs>

<Tip>
  `@coinbase/cdp-sdk` is an optional peer dependency. The SDK loads it lazily on the first `fetch()` call, so your bundle stays lean if you only use explore mode.
</Tip>

## MCP Server (Claude Desktop)

No install needed. Run directly with `npx`:

```bash theme={null}
npx -y @boltzpay/mcp
```

Add it to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):

```json theme={null}
{
  "mcpServers": {
    "boltzpay": {
      "command": "npx",
      "args": ["-y", "@boltzpay/mcp"]
    }
  }
}
```

This gives Claude 7 tools: `fetch`, `quote`, `diagnose`, `budget`, `history`, `discover`, and `wallet`. The `discover` tool now supports protocol, score, and query filters to narrow results.

## CLI

No install needed. Run directly with `npx`:

```bash theme={null}
npx @boltzpay/cli quote https://invy.bot/api
```

Or install globally:

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install -g @boltzpay/cli
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add -g @boltzpay/cli
    ```
  </Tab>
</Tabs>

Then use the `boltzpay` command directly:

```bash theme={null}
boltzpay quote https://invy.bot/api
boltzpay discover --protocol mpp --min-score 70
boltzpay fetch https://invy.bot/api --json
```

## Credentials Setup

### Coinbase CDP (required for payments)

BoltzPay uses Coinbase CDP to sign on-chain transactions (USDC on Base). You need three values:

<Steps>
  <Step title="Create an account">
    Go to [portal.cdp.coinbase.com](https://portal.cdp.coinbase.com) and create an account.
  </Step>

  <Step title="Create an API key">
    You will get an API Key ID and an API Key Secret.
  </Step>

  <Step title="Create a wallet">
    Note the Wallet Secret.
  </Step>

  <Step title="Set environment variables">
    ```bash theme={null}
    export COINBASE_API_KEY_ID="your-api-key-id"
    export COINBASE_API_KEY_SECRET="your-api-key-secret"
    export COINBASE_WALLET_SECRET="your-wallet-secret"
    ```
  </Step>
</Steps>

<Warning>
  Keep your secrets out of source code. Use a `.env` file or your platform's secret management.
</Warning>

### Tempo (MPP protocol)

For MPP endpoints using the Tempo payment channel network. You need a private key (hex-encoded).

```bash theme={null}
export TEMPO_PRIVATE_KEY="0x..."
```

Or in the SDK constructor via the `wallets` array:

```typescript theme={null}
const agent = new BoltzPay({
  wallets: [
    {
      type: "tempo",
      name: "main",
      tempoPrivateKey: process.env.TEMPO_PRIVATE_KEY!,
    },
  ],
});
```

<Info>
  Tempo wallets enable both one-shot MPP payments and streaming sessions via payment channels. See [Sessions](/concepts/sessions) for the streaming API.
</Info>

For the MCP server, pass credentials via the `env` block in your Claude Desktop config:

```json theme={null}
{
  "mcpServers": {
    "boltzpay": {
      "command": "npx",
      "args": ["-y", "@boltzpay/mcp"],
      "env": {
        "COINBASE_API_KEY_ID": "your-api-key-id",
        "COINBASE_API_KEY_SECRET": "your-api-key-secret",
        "COINBASE_WALLET_SECRET": "your-wallet-secret",
        "BOLTZPAY_DAILY_BUDGET": "5.00"
      }
    }
  }
}
```

### NWC (optional, for L402 protocol)

If you want to pay L402-compatible endpoints (Bitcoin Lightning payments), you need a **Nostr Wallet Connect (NWC)** connection string from a Lightning wallet.

#### How to get your NWC connection string

1. **[Coinos](https://coinos.io)** (recommended) — Free web wallet. Sign up with a username and password, then go to **☰ Menu > ⚙️ Preferences > Nostr > Copy NWC**. Your `nostr+walletconnect://...` string is ready.
2. **[Primal](https://primal.net)** — Free mobile app with built-in Lightning wallet and NWC support.
3. **[Alby Hub](https://albyhub.com)** — Your own Lightning node. Available as a cloud service (\$12.90/mo) or free self-hosted (Docker). Go to **Connections > Add Connection** to generate the NWC URI.
4. **Any NWC wallet** — [Umbrel](https://umbrel.com), [Start9](https://start9.com), or any wallet listed on [nwc.dev](https://nwc.dev).

#### Set the connection string

```bash theme={null}
export NWC_CONNECTION_STRING="nostr+walletconnect://relay.getalby.com/v1?secret=...&relay=wss://relay.getalby.com"
```

Or in the SDK constructor:

```typescript theme={null}
const agent = new BoltzPay({
  coinbaseApiKeyId: process.env.COINBASE_API_KEY_ID,
  coinbaseApiKeySecret: process.env.COINBASE_API_KEY_SECRET,
  coinbaseWalletSecret: process.env.COINBASE_WALLET_SECRET,
  nwcConnectionString: process.env.NWC_CONNECTION_STRING,
});
```

<Info>
  Most endpoints today use the x402 protocol (USDC). L402 is a Lightning-native protocol from [Lightning Labs](https://lightning.engineering). You can enable both simultaneously — the SDK auto-detects which protocol each endpoint uses.
</Info>
