Set up and connect Neon Postgres the right way.
Neon's guide to working with its Postgres: setup, connection methods and drivers, and when to use pooled or direct connections.
Install this skill
npx skills add https://github.com/neondatabase/agent-skills --skill neon-postgresRuns the open-source skills CLI in your own terminal. It asks which agents to add the skill to. Read what it tells your agent to do before you install it.
Install for your agent
Claude Code
Run this in your project
npx skills add https://github.com/neondatabase/agent-skills --skill neon-postgres -a claude-codeAdd
-gto install it for every project instead.Or ask Claude Code to do it
Install the "neon-postgres" skill from https://github.com/neondatabase/agent-skills for Claude Code. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .claude/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.claude/skills/for this project, or~/.claude/skills/for all your projects.Picked up in the current session, no restart needed.
Claude Code skills docsClaude.ai
Upload the ZIP
- In Settings > Capabilities, turn on Code execution and file creation.
- Go to Customize > Skills, press +, then Create skill.
- Choose Upload a skill and pick the ZIP you downloaded.
Free, Pro and Max plans. On Team and Enterprise, an owner turns skills on in Organization settings first.
Claude.ai skills docsChatGPT
Upload the ZIP
- Open Skills in ChatGPT and select Create.
- Select Upload from your computer and pick the ZIP you downloaded.
- Wait for ChatGPT's safety scan. A skill marked Needs Review asks you to check it before use.
Skills that rely on scripts or a terminal may not work unchanged in ChatGPT.
ChatGPT skills docsCodex
Run this in your project
npx skills add https://github.com/neondatabase/agent-skills --skill neon-postgres -a codexAdd
-gto install it for every project instead.Or ask Codex to do it
Install the "neon-postgres" skill from https://github.com/neondatabase/agent-skills for Codex. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .agents/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.agents/skills/for this project, or~/.agents/skills/for all your projects.Restart Codex if the skill does not show up.
Codex skills docsCursor
Run this in your project
npx skills add https://github.com/neondatabase/agent-skills --skill neon-postgres -a cursorAdd
-gto install it for every project instead.Or ask Cursor to do it
Install the "neon-postgres" skill from https://github.com/neondatabase/agent-skills for Cursor. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .cursor/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.cursor/skills/for this project, or~/.cursor/skills/for all your projects.Run it by typing / and the skill name in chat.
Cursor skills docsGitHub Copilot
Run this in your project
npx skills add https://github.com/neondatabase/agent-skills --skill neon-postgres -a github-copilotAdd
-gto install it for every project instead.Or ask GitHub Copilot to do it
Install the "neon-postgres" skill from https://github.com/neondatabase/agent-skills for GitHub Copilot. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .github/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.github/skills/for this project, or~/.copilot/skills/for all your projects.Works in Copilot CLI, the cloud agent and agent mode in VS Code and JetBrains.
GitHub Copilot skills docsAntigravity
Run this in your project
npx skills add https://github.com/neondatabase/agent-skills --skill neon-postgres -a antigravityAdd
-gto install it for every project instead.Or ask Antigravity to do it
Install the "neon-postgres" skill from https://github.com/neondatabase/agent-skills for Antigravity. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .agents/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Antigravity skills docsOr copy the folder yourself
Unzip the download into
.agents/skills/for this project, or~/.gemini/config/skills/for all your projects.Gemini CLI
Run this in your project
npx skills add https://github.com/neondatabase/agent-skills --skill neon-postgres -a gemini-cliAdd
-gto install it for every project instead.Or ask Gemini CLI to do it
Install the "neon-postgres" skill from https://github.com/neondatabase/agent-skills for Gemini CLI. Copy the skill folder (the one containing SKILL.md, with any scripts or reference files next to it) into .gemini/skills/ in this project. Before copying, show me the SKILL.md and list any scripts it includes, and wait for me to confirm.
Or copy the folder yourself
Unzip the download into
.gemini/skills/for this project, or~/.gemini/skills/for all your projects.Run /skills to check it was found.
Gemini CLI skills docs
- Installs
- 160K via skills.sh
- GitHub
- 88 stars ↗
- Last updated
- 13 Sept 2026
- Licence
- Apache-2.0
Security checks
Run by independent scanners and published on skills.sh. Their results, not a Viberation review.
- 30 May 2026
Gen Agent Trust Hub Pass
This skill provides comprehensive guidance and setup tools for Neon Serverless Postgres. It uses official Neon CLI and MCP servers for configuration and fetches up-to-date documentation from the official Neon website. All activities are consistent with the skill's purpose as a vendor-provided integration guide.
- 30 May 2026
Socket Pass
No alerts
- 30 May 2026
Snyk Warning
Risk: MEDIUM · 2 issues
- 26 Feb 2026
Runlayer Pass
4/14 files flagged
- 15 Apr 2026
ZeroLeaks Pass
Score: 93/100 · 2 sections analyzed
What's inside (4 files)
references/full-text-search.md3.9K charsreferences/hybrid-search.md4.5K charsreferences/vector-search.md6.2K charsSKILL.md16.5K chars
SKILL.md, first part. Shown as plain text.
---
name: neon-postgres
description: >-
Guides and best practices for working with Lakebase Postgres, the database
behind Neon. Covers setup, connection methods and drivers, pooled vs direct
connections, branching, schema migrations, autoscaling, scale-to-zero, instant
restore, read replicas, connection pooling, IP allow lists, and logical
replication. Also covers Lakebase Search: semantic vector search, full-text
search with BM25 ranking, and hybrid search.
Use when users ask about "Lakebase Postgres", "Neon setup", "connect to Neon",
"Neon project", "DATABASE_URL", "serverless Postgres", "Neon CLI", "neon", "Neon MCP",
"Neon Auth", "@neondatabase/serverless", "@neondatabase/neon-js",
"scale to zero", "Neon autoscaling", "Neon read replica",
"Neon connection pooling", "schema migrations", "database troubleshooting",
"Postgres performance", "neon inspect db", "semantic search", "vector
search", "full-text search", "BM25", or "hybrid search".
metadata:
parent: neon
source: https://github.com/neondatabase/agent-skills/tree/main/skills/neon-postgres
---
**FIRST**: Use the parent `neon` skill for a Neon overview, getting started with Neon, Neon development best practices, and more.
If the `neon` skill is not installed, fetch it from https://neon.com/docs/ai/skills/neon/SKILL.md or install it with:
```bash
npx skills add neondatabase/agent-skills --skill neon
```
# Lakebase Postgres
Lakebase Postgres is the database at the core of Neon. It runs on the lakebase architecture — OLTP built directly on cloud object storage — which decouples storage from compute to offer autoscaling, branching, instant restore, and scale-to-zero. It's fully compatible with Postgres and works with any language, framework, or ORM that supports Postgres.
It is the same database whether you reach it through Neon or through Databricks; this skill covers the Neon access path.
## Setup Flow
### 1. Select the organization and project
Use the CLI (default) or MCP server to list organizations and projects. Let the user select an existing project or create a new one. Check the `.neon` file for an existing linked project or branch.
### 2. Get the connection string
Use the CLI (default), `neon env pull`, or the MCP server to get the connection string. Store it in `.env` as `DATABASE_URL`. Read the file first before modifying it, to avoid overwriting existing values.
#### When to use pooled vs direct connections
| Use case | Connection type |
| ---------------------------------------- | ---------------- |
| Web applications, serverless functions | Pooled (-pooler) |
| Schema migrations | Direct |
| pg_dump / pg_restore | Direct |
| Logical replication | Direct |
| Long-running analytics with temp tables | Direct |
| Admin tasks needing SET or session state | Direct |
| LISTEN / NOTIFY | Direct |
### 3. Pick the connection method and driver
Always pair Neon with an ORM such as **Drizzle** for easy schema management and migrations. Refer to the connection methods guide to pick the correct driver based on how the runtime treats your code: https://neon.com/docs/connect/choose-connection.md.
Recommendations:
- Drizzle as ORM (see https://neon.com/docs/guides/drizzle.md)
- On Vercel, use `node-postgres` (`npm install pg`) with Vercel Fluid compute and `import { attachDatabasePool } from "@vercel/functions";`
- On Cloudflare, use `node-postgres` with Cloudflare Hyperdrive
- On Neon Functions, use `node-postgres`, as the functions are long-running and reuse the pool across requests.
- Use the `@neondatabase/serverless` driver for serverless and edge environments (for example, when using Netlify) — HTTP transport for one-shot queries, WebSocket for transaction support. Link: https://neon.com/docs/serverless/serverless-driver.md
### 4. Set up the scKey info
- Pricing
- Open source
- Category
- Skills
Related reading
- Fundamentals
Row level security is the security boundary
If your database rows are protected by a check in your application code, they are not protected. Anything holding a key can talk to the database directly, an…
Expert