> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://mpp.dev/api/mcp` to find what you need.

# CLI Reference \[Built-in command-line tool for paid HTTP requests]

The `mppx` package includes a CLI for making HTTP requests with automatic payment handling.

## Usage

The `mppx` CLI is bundled with the package.

:::code-group
```bash [npm]
$ npx mppx example.com
```

```bash [pnpm]
$ pnpm mppx example.com
```

```bash [bun]
$ bunx mppx example
```
:::

### Global install

To use the `mppx` CLI outside of a project, install globally.

:::code-group
```bash [npm]
$ npm install -g mppx
$ mppx example.com
```

```bash [pnpm]
$ pnpm add -g mppx
$ mppx example.com
```

```bash [bun]
$ bun add -g mppx
$ mppx example.com
```
:::

## Commands and options

:::terminal
```bash [terminal]
$ mppx --help
```

```txt
// [!include ~/snippets/cli-help.txt]
```
:::

## Validate command

Use `mppx validate` to automatically verify an MPP server implementation end-to-end. The command tests discovery, challenge formats, error handling, and the full payment flow.

```bash [terminal]
$ mppx validate https://api.example.com
```

To test a specific route that needs request data, pass a body or query parameters:

```bash [terminal]
$ mppx validate https://api.example.com --endpoint POST:/reports --body '{"format":"csv"}'
$ mppx validate https://api.example.com --endpoint GET:/quotes --query symbol=ETH
```

:::note[End-to-end payments]
Run `mppx validate` against both test and production versions of your server. On testnets and Stripe test mode, the CLI automatically completes roundtrip test payments. On mainnets, the CLI can complete real payments from the local `mppx` wallet.
:::

## Environment variables

| Variable | Description |
|----------|-------------|
| `MPPX_ACCOUNT` | Default account name |
| `MPPX_PRIVATE_KEY` | Use a private key directly instead of the keychain |
| `MPPX_RPC_URL` | Default RPC endpoint |
| `MPPX_STRIPE_SECRET_KEY` | Stripe secret key for Stripe payment methods (test mode only: `sk_test_...`) |
| `MPPX_STRIPE_SPT_URL` | Custom Stripe shared payment token endpoint (advanced) |

## Method options

Pass method-specific key-value pairs with `-M` (repeatable):

```bash [terminal]
$ mppx example.com/content -M channel=0x123 -M deposit=1000000
```

For Tempo session payments, use `channel` and `deposit`. For Stripe, use `paymentMethod`.

## JSON output

Pass `--format json` to commands that support structured output. This is useful when another tool calls `mppx`.

```bash [terminal]
$ mppx account list --format json
```

```json
{
  "accounts": [
    {
      "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
      "isDefault": true,
      "name": "main"
    }
  ]
}
```

## Init command

Create an `mppx.config.ts` file in the current directory:

```bash [terminal]
$ mppx init
```

Use `--force` to overwrite an existing config file:

```bash [terminal]
$ mppx init --force
```

## Sign command

Sign a payment Challenge and output the `Authorization` header value without making a request. Accepts a Challenge via `--challenge` or stdin.

```bash [terminal]
$ mppx sign --challenge 'Payment method="tempo-session";chain-id=4217;...'
```

```bash [terminal]
$ echo 'Payment method="tempo-session";chain-id=4217;...' | mppx sign
```

Use `--dry-run` to validate and parse a Challenge without signing:

```bash [terminal]
$ mppx sign --challenge 'Payment method="tempo-session";...' --dry-run
```

## Account commands

Manage local keychain-backed accounts with `mppx account`.

```bash [terminal]
$ mppx account create --account main
$ mppx account default --account main
$ mppx account list
$ mppx account view --account main
```

Export a local account private key when you need to import it into another wallet or tool:

```bash [terminal]
$ mppx account export --account main
```

:::warning
`mppx account export` prints the private key. Don't commit it, paste it into shared logs, or use it in client-side code.
:::

## Stripe payments

The CLI supports Stripe payment methods. Set your Stripe test-mode secret key and make requests to Stripe-enabled endpoints.

```bash [terminal]
$ export MPPX_STRIPE_SECRET_KEY=sk_test_...
$ mppx https://example.com/content
```

Pass method-specific options with `-M`:

```bash [terminal]
$ mppx https://example.com/content -M paymentMethod=pm_card_visa
```

## Agent integration

Register `mppx` as an MCP server for use with coding agents:

```bash [terminal]
$ mppx mcp add
```

Sync skill files to your agent's skill directory:

```bash [terminal]
$ mppx skills add
```

Generate shell completions:

```bash [terminal]
$ mppx completions
```
