Neon logo
Developer ToolsAuth: OAuthHosting: Hosted or self-hosted

Neon MCP Server

Manage serverless Postgres on Neon in natural language — create branches, run SQL, and migrate via MCP.

Updated

What is Neon MCP?

The Neon MCP server is a Model Context Protocol server that lets AI agents manage Neon serverless Postgres databases in natural language — creating projects and branches, inspecting and changing schema, running SQL, and performing database migrations.

It is an official, open-source server maintained by Neon (neondatabase/mcp-server-neon). Neon hosts it as a remote MCP server at https://mcp.neon.tech/mcp, so most users connect without running anything locally. The server acts as a bridge between an agent's requests and the Neon API, translating them into the underlying management and SQL calls.

Authentication is handled via OAuth: when a client connects, a browser window opens for you to authorize access to your Neon account, and you can opt into a read-only scope during that flow. An API-key-based connection is also supported for headless or programmatic setups. Neon recommends MCP for development and testing rather than production environments.

Tools the Neon MCP server exposes

ToolWhat it does
list_projectsList the Neon projects in your account.
create_projectCreate a new Neon project.
describe_projectReturn details about a specific project.
create_branchCreate a new branch within a project.
delete_branchDelete a branch from a project.
run_sqlExecute a SQL statement against a database.
run_sql_transactionExecute multiple SQL statements as a transaction.
get_database_tablesList the tables in a database.
describe_table_schemaDescribe the schema of a specific table.
prepare_database_migrationStage a database migration for review before applying.

Connect the Neon MCP server

Claude Code

  1. 1

    Add the Neon remote server

    Run: npx add-mcp https://mcp.neon.tech/mcp -a claude-code

  2. 2

    Authorize via OAuth

    When the browser window opens, click Authorize to connect Claude Code to your Neon account. Choose read-only scope if you only need inspection/query access.

  3. 3

    Verify

    Ask Claude to "list my Neon projects" to confirm the tools are available. If you hit auth errors, run rm -rf ~/.mcp-auth and reconnect.

Alternatively run `npx neonctl@latest init`, which authenticates via OAuth, creates an API key, and configures the MCP server for you.

Cursor

  1. 1

    Add the Neon remote server

    Run: npx add-mcp https://mcp.neon.tech/mcp -a cursor — or add it manually under mcpServers with command "npx" and args ["-y", "mcp-remote@latest", "https://mcp.neon.tech/mcp"].

  2. 2

    Authorize via OAuth

    Open Cursor's MCP settings, start the Neon server, and click Authorize in the browser window that opens.

  3. 3

    Verify

    In Cursor's chat, ask it to list your Neon projects to confirm the connection.

Sample use cases

A scheduled agent creates a fresh Neon branch, runs a test suite's migrations against it, and reports results.

Isolated, disposable database environments for CI-style checks without touching production.

An agent answers ad-hoc data questions by running read-only SQL against a Neon database.

Natural-language database querying with a read-only scope for safety.

A developer uses an MCP client to inspect schema and stage a migration for review before applying.

Faster, conversational schema iteration during development and testing.

Security & permissions

Authentication uses OAuth: connecting opens a browser authorization window where you grant the agent access to your Neon account, and you can select a read-only scope during the flow to limit it to non-mutating actions. An API-key-based connection is also supported. Because the agent can act on your projects, branches, schema, and data, Neon recommends using MCP for development and testing only, not production — prefer read-only scope and isolate write operations to disposable branches.

Using Neon MCP with Gamut

In Gamut, you add Neon as a connected tool and let an agent invoke it from an event- or schedule-triggered workflow — Gamut manages the OAuth connection and credentials so the agent can call the server's actions without you wiring up auth each run. A scheduled agent might, for example, spin up a Neon branch for a test run, execute read-only diagnostic SQL, and report the results, or inspect schema as part of a larger pipeline. Because Neon recommends MCP for development and testing, scope the connection to read-only where possible and reserve write actions for non-production branches.

Frequently asked questions

What is the Neon MCP server?

It is an official Model Context Protocol server from Neon that lets AI agents and MCP-compatible clients manage Neon serverless Postgres databases in natural language — creating projects and branches, inspecting and changing schema, running SQL, and performing migrations. Neon hosts it remotely at https://mcp.neon.tech/mcp.

Is the Neon MCP server free?

Yes — the MCP server itself is free and open source (neondatabase/mcp-server-neon). It operates on your own Neon account, which includes a free tier; any database and compute usage is billed according to Neon's standard pricing.

How do I connect the Neon MCP server to Claude or Cursor?

Run npx add-mcp https://mcp.neon.tech/mcp -a claude-code (or -a cursor), then click Authorize in the OAuth browser window. You can also run npx neonctl@latest init, which handles OAuth and configuration automatically, or add the server manually with npx mcp-remote@latest https://mcp.neon.tech/mcp.

Is the Neon MCP server hosted or self-hosted?

Both. Neon officially hosts a remote server at https://mcp.neon.tech/mcp that you connect to via OAuth with no local install. You can also self-host the open-source server from the neondatabase/mcp-server-neon repository if you prefer running it yourself.