# Neon MCP

> Neon MCP lets your AI agent manage serverless PostgreSQL databases entirely through conversation. You provision projects, clone development branches instantly, create read-only endpoints, and set up database roles—all without touching a graphical console.

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

## Description

You shouldn't have to click through five different tabs in the Neon dashboard just to set up a new feature environment. This MCP lets your AI agent handle all of that complex infrastructure work via natural conversation.

Need to spin up a test database for a pull request? You tell your agent, and it handles the cloning process using copy-on-write technology. It can create brand new projects in specific AWS regions or provision read-only compute endpoints for testing. Forget remembering connection URIs; just ask your AI client, and it delivers the ready-to-use psql string.

Managing a growing stack of services—from creating dedicated database roles to listing every active project—used to be a manual chore. Now, you simply talk to your agent. Because this MCP is hosted on Vinkius, connecting it to your existing workflow means all the power of Neon's serverless PostgreSQL infrastructure is available directly within your preferred AI client.

## Tools

### get_connection_uri
Retrieves the full connection string for a specified or default Neon branch, ready for use in psql tools or applications.

### create_branch
Clones an instant new development branch from another point-in-time using copy-on-write technology.

### create_database
Establishes a brand new, isolated database container within an existing Neon branch.

### create_endpoint
Provisions the necessary compute host for a specific branch, choosing either full read-write or limited read-only access.

### create_project
Initializes an entirely new Neon workspace, setting the region and PostgreSQL version from scratch.

### create_role
Creates a dedicated, authenticated user role within a branch and generates its initial secure password.

### delete_branch
Permanently deletes an entire isolated branch, destroying all associated data. (Cannot delete the primary branch).

### delete_project
Deletes all resources within a project workspace; note that this action is irreversible.

### get_branch
Retrieves detailed metadata for a specific Neon branch using its ID and parent project's ID.

### get_project
Fetches all configuration details for an entire Neon project workspace.

### list_branches
Lists every existing branch within a project, detailing its status and parent ID.

### list_databases
Provides a list of all databases contained within a specific Neon branch.

### list_endpoints
Lists the compute endpoints for a given branch, detailing their type and current connection state.

### list_projects
Retrieves an overview of every Neon project account you manage, including region and version details.

### list_roles
Lists all users (roles) that have been created within a specific branch for access control.

### set_primary_branch
Promotes one existing branch to be the default primary source for new development work in the project.

### update_project
Allows you to change the human-readable name of an entire Neon project workspace.

## Prompt Examples

**Prompt:** 
```
List all my Neon projects and show me which regions they're in.
```

**Response:** 
```
I found 3 projects in your Neon account: 'prod-analytics' (aws-us-east-2, PG 16), 'staging-api' (aws-eu-central-1, PG 15) and 'dev-sandbox' (aws-us-east-2, PG 17). Would you like more details on any of them?
```

**Prompt:** 
```
Create a new branch called 'feature-auth' from the primary branch of my project.
```

**Response:** 
```
I've created branch 'feature-auth' (br-wispy-leaf-789012) in your project. It was cloned instantly from the primary branch using copy-on-write. The branch is ready with its own compute endpoint and databases. Want me to get the connection URI?
```

**Prompt:** 
```
Get the connection URI for the main branch of my project.
```

**Response:** 
```
Here's your connection URI: `postgresql://neondb_owner:xxxxxxxx@ep-cool-darkness-123456.us-east-2.aws.neon.tech/neondb?sslmode=require`. You can use this with psql, your ORM or any PostgreSQL client. The password was auto-generated by Neon.
```

## Capabilities

### Provision and Modify Projects
You can create entirely new Neon projects with specific AWS regions or PostgreSQL versions, or update existing project names.

### Manage Database Branches
Instantly clone a branch from any point-in-time using copy-on-write, set the primary development source, and delete old branches when they're done.

### Configure Endpoints and Connections
Provision both read/write compute hosts or dedicated read-only endpoints for specific branches, and fetch complete connection URIs for psql tools.

### Create and Control Resources
Build new databases within a branch, set up secure access by creating database roles with unique passwords, and list all existing resources across the project.

### Audit and Govern Access
Retrieve detailed lists of every database, role, and endpoint associated with a specific Neon branch or project for compliance checks.

## Use Cases

### A developer needs a feature branch for testing.
The dev asks their agent to clone the main branch into 'feature-auth'. The MCP executes `create_branch`, instantly giving them an isolated, working environment without needing to manually copy settings or worry about data overlap.

### A DBA needs to audit all credentials.
The DBA asks their agent to run `list_roles` and then `list_databases`. The agent gathers all the necessary role names, creation dates, and database containers in a single response for review.

### An ops engineer needs to provision a staging read-only copy.
The engineer instructs their agent to create a `read_only` compute endpoint using `create_endpoint`. This ensures the testing team can hit production data without risking any writes.

### A developer needs credentials for a microservice test.
Instead of visiting the console, the dev asks their agent to generate the connection string. The MCP uses `get_connection_uri` and returns the full, working URI immediately.

## Benefits

- Instant Environment Setup: Instead of manually clicking to clone a branch, you ask your agent to create an instant development environment from the primary source. This saves minutes on every feature build.
- Zero-Touch Connectivity: Getting connection strings is simple. Your agent handles the `get_connection_uri` tool and provides psql-ready credentials immediately, saving copy/pasting time.
- Granular Resource Control: You don't need to mess with global settings. Use tools like `create_database` or `create_role` to manage resources only within a specific branch context.
- Simplified Scaling: Provisioning compute hosts is effortless. Your agent provisions either read-write endpoints (`create_endpoint`) or dedicated, low-cost read-only replicas on demand.
- Full Lifecycle Management: Need to clean up? You can run `delete_project` or `delete_branch` commands via conversation, ensuring your infrastructure remains tidy and costs are controlled.

## How It Works

The bottom line is you manage complex, multi-step infrastructure changes using simple natural language prompts.

1. Subscribe to this MCP on Vinkius and provide your unique Neon API Key.
2. Connect your AI client (Claude, Cursor, etc.) to the catalog. Your agent now has full control over your PostgreSQL infrastructure.
3. Simply ask your agent for a specific action, like 'Create a read-only endpoint for my staging branch' or 'List all database roles in Project X'.

## Frequently Asked Questions

**How do I start using the Neon MCP to manage my databases?**
You first subscribe to this MCP on Vinkius and enter your unique API Key. Then, you can instruct your agent to list all projects with `list_projects` to begin.

**Can I use Neon MCP to create a staging copy of my data?**
Yes, you use the `create_branch` tool. This instantly clones an isolated development branch from your primary source using copy-on-write technology.

**What if I need credentials for a new service user? Do I use Neon MCP?**
Yes, you create the user by calling `create_role`. You specify the project and branch IDs needed to set up the dedicated role and its password.

**Is there an easy way to get a connection URI for my main development branch?**
You use the `get_connection_uri` tool. You just need to ask your agent, and it returns the full psql string ready for immediate use.

**Does Neon MCP handle resource cleanup when I delete a project?**
The `delete_project` tool deletes all associated resources—branches, databases, and endpoints. Remember that this action destroys all data in the project.