# Neon MCP

> Neon MCP gives your agent full control over serverless PostgreSQL infrastructure. You can manage complex database projects, automatically clone entire datasets for testing, and audit resource usage without writing a single command line script. It helps you spin up isolated feature branches, provision new workspaces, or wipe out old environments just by talking to your AI client.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** postgresql, serverless, database-branching, cloud-native, autoscaling, infrastructure-as-code

## Description

Managing modern cloud databases is usually a nightmare of CLI commands and complex networking diagrams. This MCP lets you treat your entire serverless PostgreSQL environment like a conversation. You connect your Neon account through Vinkius, giving your agent the keys to everything: project structure, data branches, and user permissions.

Forget logging into ten different dashboards just to check storage caps or figure out where your application needs to point. Your AI client handles that complexity for you. Need to test a massive feature change? You can ask it to instantly create a zero-copy clone of the entire production dataset in an isolated branch. Want to verify if a user has permission to run certain queries? The agent lists and audits all roles, keeping your system secure. It's about getting immediate, conversational control over every part of your data stack—from provisioning whole new workspaces to inspecting deep execution footprints on specific branches.

## Tools

### create_branch
Clones an entire production dataset into a brand new, isolated testing branch for safe query execution.

### create_project
Provisions and initializes a completely empty Neon Project serverless workspace.

### delete_project
Permanently wipes out an entire database ecosystem, destroying all connected resources and data blocks.

### get_branch
Provides a detailed report on the execution activity and resource footprint of one specific data branch.

### get_project
Analyzes core routing logic for a project, providing details like regional metrics and storage size limits.

### list_branches
Maps all available Copy-on-Write branches associated with a main project source.

### list_databases
Identifies all internal SQL schemas and catalog namespaces mapped to a specific data branch, helping form correct connection strings.

### list_endpoints
Discovers the active connection routing endpoints used by your application drivers across the project.

### list_projects
Lists all managed serverless PostgreSQL projects and workspaces within the Neon account.

### list_roles
Extracts a list of all active PostgreSQL user roles operating on a branch, showing who can query the data.

## Prompt Examples

**Prompt:** 
```
List all serverless projects in my Neon account
```

**Response:** 
```
I've retrieved your Neon projects. Currently, you have 3 workspaces: 'prod-cluster' (Region: AWS us-east-1), 'staging-env', and 'dev-sandbox'. Would you like to see the active branches for the production cluster?
```

**Prompt:** 
```
Create a new branch called 'feat-user-auth' from the 'main' branch
```

**Response:** 
```
Spawning zero-copy clone… Success. I've created the 'feat-user-auth' branch (ID: br-12345) from your main source. This branch is now isolated and ready for queries. I'll provide the new compute endpoint URL for this branch immediately.
```

**Prompt:** 
```
What databases and roles are configured on branch 'br-12345'?
```

**Response:** 
```
Retrieving branch inventory… On 'br-12345', I've identified 2 databases: 'main_app' and 'analytics'. There are 3 active roles: 'neondb_owner', 'app_writer', and 'readonly_user'. I can help you verify the specific permissions for any of these roles if you'd like.
```

## Capabilities

### Analyze entire database environments
List all managed projects and retrieve metrics like regional caps and deployment stats for an overview of your entire infrastructure.

### Isolate data for testing
Instantly clone the entire production schema into a new, isolated branch. This lets developers test features against identical live data without touching the main database.

### Trace resource usage and schemas
Audit how much storage specific branches are using or map out all internal SQL schemas tied to a given project.

### Manage user access rights
List, audit, and manage the various PostgreSQL roles to ensure only authorized users can query specific data nodes.

### Provision or wipe out workspaces
Initialize brand new serverless projects or permanently delete entire database ecosystems with one command.

## Use Cases

### Testing a major API rewrite
A backend developer needs to test how a new payment module interacts with live data. Instead of manually setting up a staging database, they ask the agent to `create_branch` from main. The branch is ready in minutes, isolated and perfectly mirroring production.

### Preparing for quarterly cleanup
A platform engineer knows several old development workspaces are unused. They use the MCP to run `list_projects`, identify the targets, and then issue a single command using `delete_project` to wipe out the entire ecosystem safely.

### Debugging connection strings
The application team is having connectivity issues. The DBA asks the agent to run `list_endpoints` and `get_project`. The agent provides a list of active routing endpoints, solving the connection string problem instantly.

### Compliance audit prep
A security officer needs to know exactly who can access the production data. They run `list_roles` on the specific branch and get an immediate audit report of all defined user identities and their permissions.

## Benefits

- Spin up isolated testing environments instantly. Use `create_branch` to clone production data, allowing developers to test major features without ever impacting the live system.
- Get full infrastructure visibility with `list_projects`. You can see all your workspaces and understand their regional deployment metrics in one chat session.
- Debug connection issues quickly. Run `list_endpoints` to discover the exact routing addresses needed for your application drivers, eliminating guesswork.
- Maintain security through conversation. Audit user access rights by calling `list_roles`, ensuring only authorized personnel can query sensitive data nodes.
- Control your lifecycle efficiently. Use `delete_project` when a workspace is deprecated, or use `create_project` to spin up fresh environments on demand.

## How It Works

The bottom line is that this MCP turns complex database administration into simple natural language chat commands.

1. Subscribe to this MCP on Vinkius and provide your Neon API Key.
2. Connect your preferred AI client (Claude, Cursor, etc.) to the service.
3. Ask your agent a question like, 'Can you create a testing branch from main?' and let it handle the rest.

## Frequently Asked Questions

**How do I list all my Neon projects using the Neon MCP?**
You run `list_projects`. This tool gives you a complete map of every serverless workspace you own, letting you see which environments are active and where they are located.

**What is the difference between creating a project and creating a branch with Neon MCP?**
Creating a project (`create_project`) builds an entirely new, empty serverless workspace. Creating a branch (`create_branch`) clones all of the data from an existing source into a new testing area.

**Can I wipe out an entire database using Neon MCP?**
Yes, you use `delete_project`. This command permanently destroys every resource and connection associated with that project. Use it carefully; there's no undo.

**How can I find the correct connection string for my application?**
The agent uses `list_endpoints` to discover all active connection routing points across your Neon project, giving you the precise URLs needed for your drivers.