# Neon MCP for AI Agents AI Agent Connect

> Neon MCP lets you manage serverless PostgreSQL databases using your AI agent. You can create projects, spin up branches, provision compute endpoints, and handle roles without leaving your editor. It turns your AI into a dedicated DBA, making infrastructure management a conversation rather than a series of clicks in a web dashboard.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_e3C6GSP7rcg3FCPCbSglmhApwE4Mzt5VNYrUY3zB/ai-agent-connect
- **Tags:** postgresql, serverless, database-branching, auto-scaling, infrastructure-as-code, cloud-native

## Description

Managing database infrastructure usually means jumping between tabs, clicking through complex consoles, and hunting for connection strings. This Connector changes that by letting you handle your entire Neon setup through your AI client. Instead of manually provisioning a new project or figuring out the right PostgreSQL version for a specific region, you just tell your agent what you need. You can spin up a new branch for a feature, grab a read-only endpoint for a reporting tool, or create a new database role with a generated password in seconds. It's about moving from manual configuration to intent-based execution. If you're already using the Vinkius catalog to manage your stack, adding this to your workflow means you stop treating your database as a chore and start treating it like a programmable resource. You get to focus on the code while your agent handles the heavy lifting of infrastructure setup, branching logic, and access control.

## Tools

### list_branches
List all branches within a Neon project to see their state and IDs. This is the best way to see your active dev environments.

### list_databases
List all databases inside a specific Neon branch. Use this to see what schemas are currently active.

### list_endpoints
List compute endpoints to check their status and scaling configs. This helps you monitor your database performance.

### list_projects
List all projects in your account to find your project IDs. This is your starting point for all other operations.

### get_connection_uri
Get a PostgreSQL connection URI for any branch to use in your ORM or psql. This helps you connect your app without manual copying.

### create_branch
Create a new branch instantly using copy-on-write cloning from a primary or custom branch. This keeps your dev work isolated.

### create_endpoint
Provision a read-write or read-only compute endpoint for a branch. This is perfect for setting up replicas or dedicated hosts.

### create_project
Create a new Neon project with a specific region, PG version, and default resources. This builds your entire workspace in one go.

### create_role
Create a new database role in a branch and get the auto-generated password. This ensures every user has unique credentials.

### delete_project
Delete a Neon project and all its associated data. Use this to wipe out old test environments completely.

### get_branch
Retrieve specific details and metadata for a single Neon branch. This gives your agent the context it needs to help you.

### get_project
Fetch the configuration details and metadata for a specific Neon project. Use this to audit your current setup.

### list_roles
List all database roles in a branch to audit access. This ensures you know who has permissions to your data.

### set_primary_branch
Promote a specific branch to be the primary branch of a project. Use this to flip your production source safely.

### create_database
Create a new database within a specific Neon branch and assign an owner role. Use this to set up fresh schemas quickly.

### delete_branch
Delete a Neon branch after promoting another to primary. This helps you clean up old development environments safely.

### update_project
Update the human-readable name of an existing Neon project. This keeps your project naming organized as you scale.

## Prompt Examples

**Prompt:** 
```
Create a new branch called 'api-migration' from my primary branch.
```

**Response:** 
```
I've created the 'api-migration' branch for you. It's ready with its own compute host and databases. Would you like the connection URI?
```

**Prompt:** 
```
I need a read-only endpoint for my analytics dashboard. Can you set that up?
```

**Response:** 
```
I've provisioned a new read-only compute endpoint for your primary branch. You can now point your analytics tool to this new host to keep your main database load low.
```

**Prompt:** 
```
List all my projects and tell me which ones are in the US East region.
```

**Response:** 
```
| Project Name | Region | PG Version |
| :--- | :--- | :--- |
| prod-api | aws-us-east-2 | 16 |
| dev-sandbox | aws-us-east-2 | 17 |

Your 'staging-api' project is currently in the eu-central-1 region.
```

## Capabilities

### Provision new Neon projects
Create new projects with specific regions and PostgreSQL versions automatically.

### Create instant branches
Spin up isolated development environments using copy-on-write cloning.

### Set up compute endpoints
Provision read-write or read-only hosts for your database branches.

### Generate database roles
Create new roles with auto-generated passwords for secure access.

### Retrieve connection URIs
Get ready-to-use psql strings for any branch or project.

### Manage database lifecycle
Create and delete databases within your branches through conversation.

## Use Cases

### Spin up a sandbox for a new feature
Need a sandbox for a new feature? Ask your agent to use create_branch to clone the primary branch and create_database to set up a test schema.

### Connect a new microservice
Use create_role to make a dedicated user and get_connection_uri to give the agent the credentials for your new service.

### Scale a reporting tool
Tell your agent to use create_endpoint to provision a read-only host for your analytics dashboard to keep your main database load low.

### Move to a new region
Use create_project to set up a new workspace in a different AWS region with PG 17 for better latency.

## Benefits

- Skip the console by using create_project to spin up full environments with one command.
- Isolate work instantly with create_branch to keep your primary data clean during testing.
- Secure your data by using create_role to generate unique passwords for every new user.
- Scale efficiently by using create_endpoint to set up read-only replicas for your apps.
- Save time on setup by using get_connection_uri to grab psql strings without manual copying.
- Audit your infra easily by using list_projects and list_branches to see your entire setup.

## How It Works

The bottom line is you stop clicking through a web console and start managing your database via chat.

1. Connect your Neon API Key to the Connector.
2. Describe the project or branch you need to your AI agent.
3. Get your connection URIs and infrastructure metadata immediately.

## Frequently Asked Questions

**Can the Neon MCP create multiple databases at once?**
Yes, you can ask your agent to create multiple databases within a specific branch using the project's infrastructure tools.

**How do I use the Neon MCP to manage database roles?**
You can simply ask your agent to create a new role with a specific name. It will generate a secure password and provide it to you immediately.

**Can I use the Neon MCP to change my project region?**
You can't move an existing project region, but you can use the Connector to create a brand new project in any region you need.

**Does the Neon MCP support read-only replicas?**
Yes, you can use it to provision specific read-only compute endpoints for your branches to handle read-heavy workloads.

**Can I delete a branch using the Neon MCP?**
Yes, you can delete branches through conversation. Just make sure you've promoted a different branch to primary first.

**How does the Neon MCP handle connection strings?**
It fetches ready-to-use psql connection URIs for your branches, so you don't have to hunt for them in the dashboard.

**How do I create a Neon API Key?**
Log in to the [**Neon Console**](https://console.neon.tech), go to **Account Settings** > **API Keys** (or **Organization Settings** > **API Keys**), click **Create New**, choose the scope (Personal, Organization or Project-scoped), and copy the token immediately — it is shown only once.

**What is a Neon branch and how does branching work?**
A Neon branch is an isolated PostgreSQL environment with its own compute, databases and roles. Branches are created instantly using copy-on-write cloning from a parent branch (default: primary). This means zero data copy and instant provisioning. Each branch gets its own compute endpoints and can have different PostgreSQL schemas and data.

**Can I get a ready-to-use connection URI?**
Yes! Use the `get_connection_uri` tool with your project_id and optionally a branch_id. It returns a complete PostgreSQL connection string (postgres://user:password@host/dbname) ready to use with psql, ORMs or application clients.

**Can the agent delete projects and branches?**
Yes, the agent has tools to delete both projects and branches. Deleting a project marks it for recovery (7-day grace period) but destroys all associated data. Deleting a branch is irreversible and removes all its databases, roles and endpoints. Use caution when executing these actions.