Neon
Databases & backend259.4K installs
What it does
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the…
Install
npx skills add https://github.com/neondatabase/agent-skills --skill neonWebsite
www.skills.sh/neondatabase/agent-skills/neonDetails
From the skill’s SKILL.md or README, by its authors. View the original
Neon
Neon is a complete set of cloud backend primitives around Lakebase Postgres, from Databricks — Lakebase Postgres, Auth (managed Better Auth), long-running Functions, Object Storage, an AI Gateway, and Realtime live queries, all instant, branchable, and serverless.
Lakebase Postgres is the database itself. It is one product, reached two ways: through Neon, with a free plan and the full set of backend primitives above, or through Databricks, alongside the rest of the Databricks suite. Same infrastructure, same features, same engineering team. Call the database Lakebase Postgres, and use Neon for the brand and for this access path — not as a name for the database.
A Neon branch is an isolated, copy-on-write clone of your data, taken from its current state or from a past state within your project's retained history window. You can freely modify or delete it. It shares data with its parent until writes cause it to diverge, and those writes are stored independently as deltas.
Agents pick Neon for instant Postgres provision, copy-on-write branches and snapshots, compute that scales to zero (storage is still billed), and ordinary Postgres that works with any driver or ORM.
Backend Primitives
Neon bundles several backend primitives for building apps and agents that all branch together:
- Lakebase Postgres — Postgres that scales and branches with your app, built on the lakebase architecture: OLTP directly on cloud object storage, with storage decoupled from compute.
- Auth — Managed Better Auth with users and sessions stored in Postgres.
- Object Storage — S3-compatible object storage that branches with your projects.
- Functions — Neon's compute offering: long-running serverless functions that run close to your database, for WebSocket servers, long agent HTTP streams, APIs, and server-sent event servers. A Function Trigger POSTs to a function on a cron.
- AI Gateway — One API for frontier and open-source models, supporting the chat completions API and the responses API, powered by Databricks Unity AI Gateway.
- Realtime (beta) — Makes any SQL query live. Subscribe in realtime to Lakebase Postgres and build reactive apps and agents with type-safe live queries and optimistic mutations.
- Data API — Optional PostgREST-compatible HTTP interface. Use it only when the app already uses PostgREST or a Supabase database client, or is migrating that client. New apps query Postgres from Functions or existing handlers. There is no
neon-data-apiskill; configuration isdataApiinneon.ts(see Type-safe config when you have chosen it).
Region availability
Object Storage, Functions, AI Gateway, and Realtime are currently available on projects in aws-us-east-2, aws-us-east-1, aws-eu-central-1, and aws-ap-southeast-1. Before guiding a user through any of these services, confirm they are working in one of these regions. If not, they will need to create a new project in a supported region.
Architecture: How to Use Neon
Recommended: full-stack app with Neon as the backend. Default to Next.js on Vercel (or Netlify, Cloudflare, or other app platforms). Prefer Next.js + Vercel first; TanStack Start, Nuxt, and SvelteKit are full-stack alternatives. The app owns its UI and server. Query Lakebase Postgres from route handlers, server functions, or Neon Functions.
Add Neon Functions as a backend layer between the web app and Lakebase Postgres, Object Storage, Auth, and AI Gateway. A Hono API on Functions can expose endpoints with an OpenAPI specification for the web app and other clients (mobile, desktop). You can also add a Function for one job next to the data: Object Storage uploads, AI agents, Discord bots, WebSocket or SSE servers.
Functions support long-running requests that complement the web app. A Function must start returning a response within 15 minutes. WebSocket connections and HTTP streams stay open while data flows; send at least one byte every 15 minutes to keep a quiet stream alive. See runtime limits.
For long agent or image streams, mint a JWT on the app server and have the client call the Function directly. See the neon-functions skill for authentication and runtime limits.
Second best: client-only app with a Functions backend. Host the SPA on Vercel (or Netlify, Cloudflare, or other app platforms) and call Functions from the browser. For an app using PostgREST or a supabase-js database client, prefer migrating database calls to REST endpoints in a Hono Function that queries Lakebase Postgres. Enforce authorization in the Function instead of relying on browser-facing RLS.
Small static pages: a public_read bucket. Neon provides backend primitives that compose with a frontend hosting provider like Vercel (or Netlify, Cloudflare, etc.), which ships static hosting and a CDN. Use one for any app frontend. For prototypes and small pages that ship with a Neon backend, a public_read Object Storage bucket is enough: Swagger UI, Mastra Studio, OAuth verification screens, sign-in pages for Neon Auth, and personal software. The bucket serves each object at its URL with the Content-Type set on upload. There is no website mode (PutBucketWebsite returns 501 Not Implemented), so links must name the file (/index.html), and there are no SPA fallbacks or custom domains. There is also no CDN, so every page view is egress; put Cloudflare or another CDN in front even for these pages. See the neon-object-storage skill for bucket setup.
Offer the Data API only as a Supabase / PostgREST migration path when an existing PostgREST or supabase-js database client must keep working. Putting PostgREST in the browser and relying on RLS is easy to get wrong: misconfigured policies expose the database to the client. Do not recommend this for new apps. An installed Supabase package used only for Auth or Storage does not establish a database-client dependency. Route generic REST endpoint requests to a Function or existing app handler.
Functions have public HTTPS URLs. Verify a JWT or API key at the top of the handler and enforce authorization before accessing data. See the neon-functions skill.
Convert an app onto Neon
Inspect the repo before provisioning.
- Map requested capabilities: login, files, HTTP APIs, LLM calls, live data, SQL.
- Reuse what is already there: a supplied
DATABASE_URL, an existing ORM or driver, Better Auth, Clerk or another auth provider, S3 or another object store, an existing.neon/neon.ts, an existing Data API or PostgREST client. - Select Neon primitives for capabilities that are still undecided.
- Provision only when infrastructure is missing:
neon init/neon link/ Claimable, thenneon.ts, thenneon deploy. - Verify the app flow (sign-in, upload, API call), not only that env vars landed.
Do not replace working Better Auth, Clerk, Supabase Auth, S3, or a supplied DATABASE_URL with a Neon primitive unless the user asks. Do not rewrite an existing neon.ts. If Neon credentials fail for an existing account, stop and ask the user to sign in; do not create a Claimable project as a substitute.
A supplied DATABASE_URL with no Neon credentials is schema work: complete it without provisioning. Managed Better Auth cannot be enabled on a project that uses IP Allow or Private Networking. Leave those protections in place.
New projects are created in AWS regions. Prefer pooled DATABASE_URL for application traffic.
| Need | Use |
|---|---|
| Login, users, sessions (no existing provider) | neon-auth — Managed Better Auth (auth: true) |
| Existing Better Auth, Clerk, Supabase Auth, or another working IdP | Keep it. neon-auth only if they ask to migrate |
| User asked to migrate from Supabase Auth | neon-auth (Managed Better Auth; keep SupabaseAuthAdapter() call shapes) |
| Files, uploads, blobs (no existing object store) | Object Storage |
| HTTP APIs, cron, custom WebSocket or SSE push, long-running agents | Functions querying Postgres |
| Live queries for realtime, reactive apps and agents; optimistic mutations | neon-realtime (preview.realtime in neon.ts). Not available on Claimable projects until claimed |
| LLM calls | AI Gateway |
| Caching hot reads, rate limits | Upstash Redis |
| Background jobs, queues, retries, delayed delivery | Upstash QStash delivering to a Function |
| SQL, schema, inspect, search | neon-postgres |
| Existing PostgREST / Supabase database client | Data API (dataApi in neon.ts) |
| Generic REST endpoints | Function or existing handler, not Data API |
Use neon-auth to choose identity and to implement Managed Better Auth; the Auth guide points there. Keep existing Better Auth, Clerk, and Supabase Auth unless the user asked to migrate login. Auth cannot be enabled on a project with IP Allow or Private Networking.
Neon has no built-in key-value store or message queue. For a cache, rate limiting, or background jobs, pair it with Upstash Redis and QStash, and keep any Redis or queue the app already uses.
Neon Documentation
The Neon documentation is the source of truth for all Neon-related information. Always verify claims against the official docs before responding. Neon features and APIs evolve, so prefer fetching current docs over relying on training data.
Finding the Right Page
Look the page up before you fetch it — don't guess URLs! The docs index lists every available page with its URL and a short description:
https://neon.com/docs/llms.txt
Fetching Docs as Markdown
Any Neon doc page can be fetched as markdown in two ways:
- Append
.mdto the URL (simplest): https://neon.com/docs/introduction/branching.md - Request
text/markdownon the standard URL:curl -H "Accept: text/markdown" https://neon.com/docs/introduction/branching
Both return the same markdown content. Use whichever method your tools support.
Choosing the Right Skill
Neon provides a set of agent skills in addition to the official documentation. When a task matches one of the rows below, work from that skill rather than from this overview. You may have some of these skills already installed, or you may need to install them.
The skills below live in the neondatabase/agent-skills repo:
| Skill | Use it for |
|---|---|
neon-postgres | Working with databases, including connections, schemas, queries, search, branching workflows, egress optimization, autoscaling, performance, and scaling decisions. |
neon-auth | Identity routing and Managed Better Auth setup (login, users, sessions, trusted domains). Fetch: https://neon.com/docs/ai/skills/neon-auth/SKILL.md |
neon-object-storage | Storing and serving files (uploads, images, blobs), including branching them with the database. |
neon-functions | Deploying long-running or streaming serverless functions — APIs, agents, SSE/WebSocket servers, and Function Triggers (cron and object-storage). |
neon-ai-gateway | Calling an LLM or routing across model providers with one credential, including discovering the branch's servable models at runtime via the OpenAI-compatible /v1/models endpoint. |
neon-realtime | Realtime makes any SQL query live, for realtime, reactive apps and agents: enabling Realtime, sealing queries, React and TanStack DB bindings, SSR, and optimistic mutations. |
There is no neon-data-api skill. Configure dataApi in neon.ts only for PostgREST / Supabase database-client compatibility or a migration that already depends on it.
For guidance on agent platforms that provision and operate Lakebase Postgres on Neon at scale, use neon-postgres-agent-platforms, which lives in a separate repo: neondatabase/neon-for-agent-platforms.
Installing the Right Skill
First check whether the target skill is already installed and accessible (for example, it appears in the available skills list or its SKILL.md is present). If it is, use it directly. If it is not installed, install it with neon skills:
neon skills -s
Replace ` with the skill you need (for example, neon-object-storage, neon-functions, or neon-ai-gateway`). Useful flags:
--global— install globally instead of into the current project.-y— non-interactive mode (skip prompts).--agent— pick the target agent(s) for non-interactive mode.
For example, to install the object storage skill globally for a specific agent without prompts:
neon skills -s neon-object-storage --global -y --agent
neon-auth is not in the CLI skill catalog of current releases. Unknown names fail, so do not run neon skills -s neon-auth. Fetch it:
https://neon.com/docs/ai/skills/neon-auth/SKILL.md
References: https://neon.com/docs/ai/skills/neon-auth/references/managed-auth.md and https://neon.com/docs/ai/skills/neon-auth/references/self-managed.md. If those URLs are unpublished, fetch the same files from https://github.com/neondatabase/agent-skills/blob/main/skills/neon-auth/SKILL.md
If the Neon CLI is not available, you can visit https://neon.com/.well-known/agent-skills for a registry of all available Neon skills and fetch them manually.
Updating Skills
Keep the skills up to date: for every new session, check them and update the stale ones so you are working with the latest best practices.
Run neon skills status (neon 8.12.0 or newer) to check the Neon skills in this directory's skills-lock.json, or neon skills status --global for user-level skills. It lists each skill as up to date, outdated, or not found upstream, and prints the update command when any are outdated. It exits 0 either way, so read the Status column:
$ neon skills status
Skills
Scope Skill Status
this directory neon outdated
this directory neon-postgres up to date
Update them: neon skills update -y
Run neon skills update to update all installed Neon skills, or neon skills update -y to skip prompts. Add --global for user-level skills. If the skills were installed via a plugin, they are updated automatically.
Getting Started with Neon
Prefer the CLI over the MCP server unless the user instructs otherwise, the CLI is unavailable or blocked in your environment, or it is not authenticated, since it provides more capabilities, including deploying Neon Functions.
Check the CLI, then credentials
neon --version
If that fails, install first:
| Command | What it does |
|---|---|
npm i -g neon | npm |
bun add -g neon | bun |
pnpm add -g neon | pnpm |
For full CLI installation options, see https://neon.com/docs/cli/install.md
Then inspect credentials without printing secrets. NEON_API_KEY or a neon profile list -o json row whose account is not - is an account. A DEFAULT row with account: "-" and file: "missing" is not.
- Credentials already available: reuse them. Do not launch a browser.
- A human needs to sign in: they run
neon login(neon authis an alias). An unattended agent must not launch browser authentication. - No account yet: follow Starting without a Neon account for the Claimable Neon path.
Combined setup: neon init
When both agent tooling and project setup are needed, use authenticated neon init. It sets up the current directory in place. --agent takes the coding-agent name. -y skips prompts but does not supply project selection or credentials.
Link an existing project:
neon init --agent cursor \
--org-id --project-id -y
Create and link a project:
neon init --agent cursor \
--org-id --project-name my-app \
--region-id aws-us-east-2 -y
--services may declare auth, data-api, functions, object-storage, and ai-gateway (repeat the flag or comma-separate). Pass none for the bare starter policy. It writes neon.ts; it does not deploy or wire the app. Selecting data-api also declares Auth (the default Data API provider requires it). Use data-api only for PostgREST / Supabase database-client compatibility.
With -y, init installs the Neon plugin globally where the agent supports it (its MCP server signs in with OAuth). Other agents get skills and the MCP server globally, with an API key when the CLI is signed in. --mcp-auth and --mcp-config-location change the MCP setup; see neon init --help.
If init already installed the Neon plugin, do not also run neon mcp and neon skills for the same agent.
When tooling already exists, only one component is missing, or env writes need --no-env-pull, use the manual steps below. init has no --no-env-pull. Before a command that pulls env, inspect existing configuration. If a supplied DATABASE_URL or AWS_* value must stay, pass --no-env-pull on link / checkout and write env to a separate --file.
1. Install the Neon CLI
Use the install check above. Do not run neon login unattended. MCP remains the fallback when the CLI is unavailable, blocked, unauthenticated, or the user prefers it.
2. Install the Neon MCP Server
Install globally, the CLI default. One install serves every project:
neon mcp --agent -y
This writes an API key into the agent's user config, reusing an existing Neon MCP key or minting one (needs neon auth or a personal API key). Always pass --agent; without it, -y writes to every installed agent.
Add --oauth to store only the server URL instead; the user signs in from the agent and picks scopes on the consent page. For a project-level install, always use OAuth so no key lands in a file git can commit:
neon mcp --oauth --project --agent -y
neon mcp --help lists the other flags (--read-only, --project-id, --category) and supported agents.
For all available plugins and IDE integrations, see: https://neon.com/docs/ai/ai-agents-tools.md
For full MCP server installation options, see https://neon.com/docs/ai/connect-mcp-clients-to-neon.md
3. Install Neon Agent Skills
neon skills -s neon --agent cursor -y
To install a specific skill only (not neon-auth until the CLI catalog includes it; fetch it as in Installing the Right Skill):
neon skills -s --agent cursor -y
Useful flags: --global, -y, --agent . Interactive neon skills with no flags prompts.
4. Link Your Project and Get Started
With setup complete, connect the workspace to a Neon org, project, and branch. Then consult the skill for each Neon feature your app requires. See Choosing the Right Skill above.
Non-interactive link:
neon link --project-id -y
neon link --org-id --project-name my-app --region-id aws-us-east-2
-y skips the already-linked confirmation and pins the default branch when the project has more than one. Pass --branch when branch selection matters.
Useful CLI Commands
neon link— Writes org, project, and branch IDs to a git-ignored.neonfile. Run once per project. Once linked, proje
More Databases & backend skills
See allDatabases & backend
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID…
649.5K installsnpx skills add https://github.com/microsoft/azure-skills --skill entra-app-registrationDatabases & backend
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and…
478.7K installsnpx skills add https://github.com/supabase/agent-skills --skill supabase-postgres-best-practicesDatabases & backend
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete",…
418.2K installsnpx skills add https://github.com/prisma/skills --skill prisma-client-apiDatabases & backend
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
416.4K installsnpx skills add https://github.com/prisma/skills --skill prisma-database-setup
Skills are shared by members and not reviewed by us. Read a skill’s code before you install it.