Most auth bugs show up only after you ship. Here’s how to catch them early with Neon Auth + branches

Neon CLI commands — init

Use the Neon CLI to manage Neon directly from the terminal

Before you begin

  • Before running the init command, ensure that you have installed the Neon CLI.
  • If you have not authenticated with the neon auth command, running a Neon CLI command automatically launches the Neon CLI browser authentication process. Alternatively, you can specify a Neon API key using the --api-key option when running a command. See Connect.

The init command

The init command initializes your app project with Neon using your AI coding assistant. It installs the Neon MCP (Model Context Protocol) Server, which enables your AI assistant to help set up your Neon integration.

This command will:

  • Authenticate via OAuth (opens your browser)
  • Create a Neon API key for you automatically
  • Configure your editor to connect to Neon's remote MCP server

The init command supports: Cursor, VS Code with GitHub Copilot, and Claude Code. It automatically detects which IDE you have installed and configures the MCP server accordingly.

Usage

From the CLI:

You can run it from the Neon CLI to install the Neon MCP (Model Context Protocol) Server and authenticate.

neon init

npx

You can also run the init command in the root directory of your app with npx instead of installing the Neon CLI locally:

npx neonctl@latest init

After running the command, restart your IDE and ask your AI assistant to "Get started with Neon" to launch an interactive onboarding guide. The Neon MCP Server uses AI rules defined in neon-get-started.mdc to help you get started with Neon, including helping you configure a database connection.

note

For Cursor users, you can also ask: "Get started with Neon using MCP Resource"

Options

This command supports global options only.

Example

Navigate to the root directory of your application and run the neonctl@latest init command:

cd /path/to/your/app
npx neonctl@latest init

The command outputs progress as it completes each step:

npx neonctl@latest init

  Adding Neon to your project

  Which editor(s) would you like to configure? (Space to toggle each option, Enter to confirm your selection)
 Cursor
 VS Code
 Claude CLI

  Authenticating
┌────────┬──────────────────┬────────┬────────────────┐
 Login Email Name Projects Limit
├────────┼──────────────────┼────────┼────────────────┤
 alex alex@domain.com Alex 60
└────────┴──────────────────┴────────┴────────────────┘
  Authentication successful

  Installed Neon MCP server

  Success! Neon is now ready to use with Cursor / VS Code.


  What's next? ─────────────────────────────────────────────────────────────╮
│                                                                            │
│  Restart Cursor / VS Code and type in "Get started with Neon" in the chat  │
│                                                                            │
├────────────────────────────────────────────────────────────────────────────╯

Supported AI Assistants

The init command supports:

  • Cursor — Ask: "Get started with Neon using MCP Resource"
  • VS Code with GitHub Copilot — Ask: "Get started with Neon"
  • Claude Code CLI — Ask: "Get started with Neon"

The command automatically detects your IDE and configures the appropriate MCP server integration.

Manual setup

If you prefer to configure manually or need to set up for other IDEs, create a Neon API key in the Neon Console and use this configuration:

Example configuration for Cursor:

{
  "mcpServers": {
    "Neon": {
      "url": "https://mcp.neon.tech/mcp",
      "headers": {
        "Authorization": "Bearer <$NEON_API_KEY>"
      }
    }
  }
}

For detailed manual setup instructions for all editors, see Connect MCP clients.

Need help?

Join our Discord Server to ask questions or see what others are doing with Neon. For paid plan support options, see Support.

Last updated on

Was this page helpful?