Skip to main content

Requirements

  • Node.js 18 or later

Install

Install globally with npm, yarn, or pnpm:
npm install -g @phantom/cli
This installs the phantom binary. Verify the installation:
phantom --version

Authenticate

On first use, run:
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:
phantom wallet status

Use as an MCP server

To register the CLI as an MCP server with your AI agent (Claude Desktop, Cursor, etc.):
phantom mcp add
Or run it manually as an stdio MCP server:
phantom --mcp
See the MCP server setup guide for full configuration instructions for each agent.

Configuration

VariableDescription
PHANTOM_API_BASE_URLOverride the Phantom API base URL (default: https://api.phantom.app)

Update

npm update -g @phantom/cli