Neon MCP Server

Official

Serverless Postgres with database branching — point your assistant at Neon and let it work on disposable copies.

Local + remotestdiossestreamable-httpTypeScriptMIT 600

What is the Neon MCP server?

Neon is serverless Postgres with one killer primitive — copy-on-write branching — and its MCP server is built around it. Your assistant can create a full, isolated copy of a production-sized database in seconds, run experiments or schema migrations there, and throw it away or promote the changes when done. For AI-driven database work, that's the difference between "hope the model's ALTER TABLE was right" and "check the branch before merging."

Beyond branching, the server covers the Neon platform end to end: creating and listing projects, running SQL against any branch, inspecting connection details, and handling migrations through a deliberately two-step flow — the server prepares changes on a temporary branch first and applies them to the target only after confirmation. That built-in checkpoint is exactly the kind of guardrail LLM database tooling should have, and most don't.

Setup is minimal: a remote OAuth server at mcp.neon.tech means most clients connect with one URL and a browser approval — no API keys to manage, though key-based access exists for automation. Free-tier Neon projects work fine, which makes this one of the cheapest ways to give an assistant a real Postgres playground.

If you're comparing: the plain PostgreSQL MCP server gives you read-only queries against a database you already run; Neon's gives you the whole database lifecycle — provisioning, branching, migrating, querying — for databases hosted on Neon. Different jobs, and it's entirely reasonable to run both.

Practical branching patterns

  • Name branches after the task instead of accepting the generated ones. Neon keeps branches until you delete them, and a project holding twenty variations of br-quiet-frost-a1b2c3 is unreadable a week later.
  • The staged-migration flow hands back the temporary branch's connection string, so you can point a local app at the proposed schema and actually exercise it before calling complete_database_migration.
  • A branch captures its parent's data at creation time and diverges from there — when you need current production data again, cut a fresh branch rather than expecting the old one to catch up.
  • Compute on an idle branch scales to zero, so a forgotten branch costs only storage for its changed pages. Cheap, though not free once you have dozens.

What you can do with it

Safe AI-driven migrations

Schema changes stage on a temp branch and apply only after you confirm — a review gate built into the workflow.

Instant dev databases

Spin up a branch with production-shaped data for each experiment, then delete it.

Prototype provisioning

Let the assistant create the project, schema and connection string for a new app in one go.

Available tools

ToolWhat it does
list_projects / create_projectEnumerate and provision Neon projects
run_sqlExecute SQL against a chosen project and branch
create_branch / delete_branchCopy-on-write database branches in seconds
prepare_database_migrationStage a schema change on a temporary branch
complete_database_migrationApply a staged migration after confirmation
get_connection_stringFetch connection details for any branch
describe_table_schemaInspect table structure on a branch

How to install the Neon MCP server

claude mcp add --transport http neon https://mcp.neon.tech/mcp

Opens a browser to authorise your Neon account.

Configuration

A Neon account (free tier works). OAuth in the browser for remote mode; an API key only for automation.

VariableDescriptionRequired
NEON_API_KEYAPI key for non-OAuth local mode (automation/CI)e.g. napi_...Optional

Example prompts to try

  • Create a branch of my main database and test adding a soft-delete column to users there.
  • Prepare a migration adding an index on orders(created_at) and show me the plan before applying.
  • Spin up a new Neon project for a demo app and give me the connection string.

Frequently asked questions

Platform control. Generic Postgres servers query an existing database; Neon's also provisions projects, creates copy-on-write branches, stages migrations with a confirmation step and hands out connection strings. It manages the database lifecycle, not just queries.