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

# Installation

> Install the Phantom CLI, authenticate, and configure your environment.

## Requirements

* Node.js 18 or later

## Install

Install globally with npm, yarn, or pnpm:

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

  ```bash yarn theme={null}
  yarn global add @phantom/cli
  ```

  ```bash pnpm theme={null}
  pnpm add -g @phantom/cli
  ```
</CodeGroup>

This installs the `phantom` binary. Verify the installation:

```bash theme={null}
phantom --version
```

## Authenticate

On first use, run:

```bash theme={null}
phantom login
```

This opens a browser window and prompts you to sign in with Google, Apple, or your Phantom extension. Once authenticated, the session is persisted locally and refreshed automatically.

To check your current session status without making an API call:

```bash theme={null}
phantom wallet status
```

## Use as an MCP server

To register the CLI as an MCP server with your AI agent (Claude Desktop, Cursor, etc.):

```bash theme={null}
phantom mcp add
```

Or run it manually as an stdio MCP server:

```bash theme={null}
phantom --mcp
```

See the [MCP server setup guide](/phantom-mcp-server/setup) for full configuration instructions for each agent.

## Configuration

| Variable               | Description                                                            |
| ---------------------- | ---------------------------------------------------------------------- |
| `PHANTOM_API_BASE_URL` | Override the Phantom API base URL (default: `https://api.phantom.app`) |

## Update

```bash theme={null}
npm update -g @phantom/cli
```
