• ISOLATION
  • AUTOMATION
  • VISIBILITY
  • HUMAN

How to create database branches with your AI

Connect Neon to your AI client to manage database environments through natural language. You'll move from production to isolated testing environments in seconds.

Ask AI about this page

Short answer

How can I use AI to branch my Neon database?

Your AI uses the Neon MCP to find your projects and branches, then triggers a new branch creation. This gives you a perfect copy of your data for testing. You'll see how the process works below.

The end results.

What you get from branching

The AI handles the infrastructure setup so you can focus on your code.

ISOLATION

Safe testing zones

The AI creates a branch that mirrors your data. You get a sandbox where you can run migrations or tests without breaking anything.

AUTOMATION

Instant environments

Instead of clicking through a dashboard, you just tell your agent to make a branch. It handles the API calls to Neon for you.

VISIBILITY

Project oversight

Your AI can look through your existing Neon setup to see what projects and branches are already running. It keeps track of your infrastructure.

HUMAN

Manual control

You decide when a branch is ready to be merged or deleted. The AI prepares the environment, but you keep control over the final data state.

The workflow

What your AI does when the request arrives.

The AI follows a specific sequence to ensure it's working on the right database.

  1. Locate your data

    The AI first finds your Neon projects to make sure it has the right context for the request.

    list_projects
  2. Check existing branches

    It looks at the current branches within a project to avoid naming conflicts or duplicate environments.

    list_branches
  3. Spin up the branch

    Once the target is identified, the AI tells Neon to create the new isolated environment.

    create_branch
  4. Confirm readiness

    The AI verifies the branch exists and provides you with the status.

    list_branches

Try it

Copy these to start.

Use these prompts to trigger the Neon MCP.

Starting points

These are opening lines. Swap out the project names or branch names to match your actual Neon setup.

Neon Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_Wyz38ZBi3SeTs6Rve6ru1Zk6eusbP8f3rO1EXQtp/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat — Neon capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "neon-serverless-postgresql-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_Wyz38ZBi3SeTs6Rve6ru1Zk6eusbP8f3rO1EXQtp/mcp"
    }
  }
}
Copy into chat04
  • List all my Neon projects so I can see what's available.

  • Show me the branches currently running in my 'production-db' project.

  • Create a new branch named 'feature-test-v2' from my main production branch.

  • Check if there is already a branch named 'staging-env' in my active project.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Neon once, then ask.

You only need to link your Neon account one time. After that, your AI client can manage your branches whenever you need.

Connect Neon to your AI

FAQ

How this task behaves

  • 01

    Can the AI delete my production database?

    No. The current tools only allow the AI to list projects, list branches, and create new branches. It cannot delete anything.

  • 02

    Does the AI see my actual table data?

    No. The AI manages the database structure and branches through the Neon API, but it does not read the rows of data inside your tables.

  • 03

    How does the AI know which project to branch from?

    You should specify the project name in your prompt. If you don't, the AI will use the list_projects tool to find your projects and ask you for clarification.

  • 04

    Can I use this to run SQL queries?

    No. This MCP is designed for environment management like branching and listing projects, not for executing SQL commands.

  • 05

    Will creating a branch cost me extra?

    Branching is a feature of Neon. The AI simply triggers the action; any costs associated with Neon usage depend on your specific Neon plan.

  • More questions about Neon? See everything the Neon Connector can do

Connect Neon to Claude, Cursor, ChatGPT & more