Neon MCP server

Databases

Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.

Your AI app calls the Neon MCP server, which does the work through tools like get_connection_string, run_sql_transaction, prepare_database_migration and prepare_query_tuning and sends the result back to the chat.

About Neon

Neon is the official MCP server from neondatabase, filed in our directory under databases. Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.

Neon runs as a remote server at https://mcp.neon.tech/mcp, so there is nothing to install: your AI app connects over streamable HTTP, and most remote servers ask you to sign in with OAuth the first time.

The README for Neon lists tools such as get_connection_string, run_sql_transaction, prepare_database_migration and prepare_query_tuning, which your AI app can call once the server is connected.

Neon is listed in the official MCP registry as com.neon/mcp, version 2.0.0.

At a glance

Publisher
neondatabase, the company behind the product
Runs
As a hosted remote server
Written in
TypeScript
License
MIT
GitHub stars
667
Official MCP registry
com.neon/mcp

Tools Neon gives your AI app

  • get_connection_string(the connection string carries a privileged role password, so it is withheld in read-only mode; copy it from the Neon Console instead).
  • run_sql_transaction(its statements run in one session, so a COMMIT or SET TRANSACTION READ WRITE statement would end the read-only transaction).
  • prepare_database_migration, completedatabasemigration.
  • prepare_query_tuning, completequerytuning.
  • neon_auth
  • data_api
  • null(tools without a scope category: search, fetch, sendfeedback).
  • list_projectsLists Neon projects. limit caps how many items come back.
  • count_projectsReturns the number of active projects in an organization. orgid is optional and resolves the same way as on listprojects.
  • describe_projectFetches a Neon project by id ({ "projectid": "…" }).
  • get_project_consumption, getbranchconsumption: Consumption metrics per project or per branch, grouped by billing period. Take orgid, metrics, from, to, and granularity, and need a Lau
  • create_projectCreates a Neon project and waits for the default compute. Does not return a connection string. Arguments are { "name": "…", "orgid": "…", "regionid": "…" }. Cal
  • delete_projectDeletes an existing Neon project. Arguments are { "projectid": "…" }.
  • list_organizationsLists all organizations that the current user has access to. Optionally filter by organization name or ID using the search parameter.
  • list_branchesLists branches in a project. Use it to resolve a branch name to a br-… id.
  • list_credentials, createcredential, revokecredential, rotatecredential: Branch-scoped credentials for Object Storage and the AI Gateway. reveal is not a tool; rotation replaces
  • create_branchCreates a branch with a read-write compute and waits until it is ready. Does not return a connection string. Arguments are { "projectid": "…", "name": "feature-
  • reset_from_parentResets a branch to its parent's current HEAD ({ "projectid": "…", "branchid": "br-…" }). Discards writes since the branch diverged. preserveundername is require
  • delete_branchDeletes a branch ({ "projectid": "…", "branchid": "br-…" }).

Tool names as the Neon README lists them. Your AI app shows the live list once Neon is connected.

How to set up Neon

  1. Nothing to install: Neon is a remote server, so all you need is an AI app that accepts a remote MCP URL.
  2. Check the Neon README for keys or settings; the registry lists none that Neon requires.
  3. Add Neon to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Neon tools to confirm the connection.
  5. Run one read-only task with Neon first, such as a call to get_connection_string, before you allow anything that writes or sends.

Neon compared with similar servers

  • Yacy Grid by yacy has fewer GitHub stars than Neon (652 against 667); Neon is official while Yacy Grid is a community server, and Yacy Grid runs on your own machine and Neon runs as a remote server.
  • Supabase (alexander-zuev) by alexander-zuev has more GitHub stars than Neon (837 against 667); Neon is official while Supabase (alexander-zuev) is a community server, and Supabase (alexander-zuev) runs on your own machine and Neon runs as a remote server. The Supabase (alexander-zuev) README lists 10 tools to Neon's 19.
  • Redis by redis has fewer GitHub stars than Neon (647 against 667); both are official servers, and Redis runs on your own machine and Neon runs as a remote server. The Redis README lists 7 tools to Neon's 19.

Before you connect Neon

  • Give Neon its own sign-in or token with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Neon tool call until you trust what it does with them.
  • Treat text that Neon fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Neon on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Neon

How marketing and sales teams put Neon to work, by company size. Pick the size closest to yours and start Neon on one use case.

Small business

  • A small business with its own app can ask Neon plain questions about customers and orders, without writing SQL.
  • Owners can use Neon to pull a list of customers who haven't bought in 90 days and plan a win-back email.
  • Neon runs as a remote server, so a small team can connect it in a few minutes with no install to maintain.

Mid-market

  • Marketing analysts can connect Neon to answer campaign questions from the warehouse directly, instead of waiting on the data team's queue.
  • Lifecycle teams can use Neon to build audience lists from product data and check counts before a send.
  • Start with get_connection_string and run_sql_transaction, the tools Neon lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises should point Neon at a read replica with a read-only role, so agents query freely without risk to production data.
  • Data teams can expose curated views through Neon, so marketing gets self-serve answers without access to raw customer tables.
  • Because Neon comes from neondatabase, the company behind the product, it follows that product's own auth and permissions, which security teams usually prefer.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Neon README

From neondatabase/mcp-server-neon on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Neon MCP Server

Neon MCP Server is an open-source tool that lets you interact with your Lakebase Postgres databases on Neon in natural language.

The Model Context Protocol (MCP) is a standardized protocol designed to manage context between large language models (LLMs) and external systems. This repository provides a remote MCP Server for Neon.

Neon's MCP server acts as a bridge between natural language requests and the Neon API. Built upon MCP, it translates your requests into the necessary API calls, enabling you to manage tasks such as creating projects and branches, running queries, and performing database migrations seamlessly.

Some of the key features of the Neon MCP server include:

  • Natural language interaction: Manage Neon databases using intuitive, conversational commands.
  • Simplified database management: Perform complex actions without writing SQL or directly using the Neon API.
  • Accessibility for non-developers: Empower users with varying technical backgrounds to interact with Neon databases.
  • Database migration support: Leverage Neon's branching capabilities for database schema changes initiated via natural language.

For example, in Claude Code, or any MCP Client, you can use natural language to accomplish things with Neon, such as:

  • Let's create a new Postgres database, and call it "my-database". Let's then create a table called users with the following columns: id, name, email, and password.
  • I want to run a migration on my project called "my-project" that alters the users table to add a new column called "created_at".
  • Can you give me a summary of all of my Neon projects and what data is in each one?

[!WARNING]
Neon MCP Server Security Considerations
The Neon MCP Server grants powerful database management capabilities through natural language requests. Always review and authorize actions requested by the LLM before execution. Ensure that only authorized users and applications have access to the Neon MCP Server.

The Neon MCP Server is intended for local development and IDE integrations only. We do not recommend using the Neon MCP Server in production environments. It can execute powerful operations that may lead to accidental or unauthorized changes.

For more information, see MCP security guidance →.

Setting up Neon MCP Server

There are a few options for setting up the Neon MCP Server:

  1. Quick Setup with API Key (Cursor, VS Code, and Claude Code): Run neon@latest init to automatically configure Neon's MCP Server, agent skills, and VS Code extension with one command.
  2. Remote MCP Server (OAuth Based Authentication): Connect to Neon's managed MCP server using OAuth for authentication. This method is more convenient as it eliminates the need to manage API keys. Additionally, you will automatically receive the latest features and improvements as soon as they are released.
  3. Remote MCP Server (API Key Based Authentication): Connect to Neon's managed MCP server using API key for authentication. This method is useful if you want to connect a remote agent to Neon where OAuth is not available. Additionally, you will automatically receive the latest features and improvements as soon as they are released.
Prerequisites
  • An MCP Client application.
  • A Neon account.
  • Node.js (>= v18.0.0): Download from nodejs.org.
  • If IP Allow is enabled, add 34.192.103.46 and 23.22.233.166 to your allowlist (mcp.neon.tech static IPs).

For development, you'll need Node.js 22+ (pnpm is provided via Corepack, run corepack enable to activate it).

Option 1. Quick Setup with API Key

Don't want to manually create an API key?

Run neon@latest init to automatically configure Neon's MCP Server with one command:

npx neon@latest init

This works with Cursor, VS Code (GitHub Copilot), and Claude Code. It will authenticate via OAuth, create a Neon API key for you, and configure your editor automatically.

Option 2. Remote Hosted MCP Server (OAuth Based Authentication)

Connect to Neon's managed MCP server using OAuth for authentication. This is the easiest setup, requires no local installation of this server, and doesn't need a Neon API key configured in the client.

Run the following command to add the Neon MCP Server for all detected agents and editors in your workspace:

npx add-mcp "https://mcp.neon.tech/mcp?category=projects&category=branches&category=endpoints&category=querying&category=schema"

That URL publishes projects, branches, compute endpoints, querying, and schema. Preview it with /api/list-tools?category=projects&category=branches&category=endpoints&category=querying&category=schema. The unfiltered URL publishes every category:

npx add-mcp https://mcp.neon.tech/mcp

Add the -g flag to add the Neon MCP Server to the global MCP server list instead of project-scoped.

Alternatively, you can add the following "Neon" entry to your client's MCP server configuration file (e.g., mcp.json, mcp_config.json):

{
  "mcpServers": {
    "Neon": {
      "type": "http",
      "url": "https://mcp.neon.tech/mcp?category=projects&category=branches&category=endpoints&category=querying&category=schema"
    }
  }
}

Kiro: Add the following to your Kiro MCP config file (~/.kiro/settings/mcp.json for global, or .kiro/settings/mcp.json for project-scoped):

{
  "mcpServers": {
    "Neon": {
      "url": "https://mcp.neon.tech/mcp?category=projects&category=branches&category=endpoints&category=querying&category=schema"
    }
  }
}

Or use the "Add to Kiro" button at the top of this README to install the Neon Kiro Power, which includes the Neon MCP Server. For more information, see the Kiro MCP documentation.

  • Restart or refresh your MCP client.
  • An OAuth window will open in your browser. Follow the prompts to authorize your MCP client to access your Neon account.

With OAuth-based authentication, the MCP server will, by default, operate on projects under your personal Neon account. To access or manage projects that belong to an organization, you must explicitly provide either the org_id or the project_id in your prompt to MCP client.

Option 3. Remote Hosted MCP Server (API Key Based Authentication)

Remote MCP Server also supports authentication using an API key in the Authorization header if your client supports it.

Create a Neon API key in the Neon Console. Next, run the following command to add the Neon MCP Server for all detected agents and editors in your workspace:

npx add-mcp "https://mcp.neon.tech/mcp?category=projects&category=branches&category=endpoints&category=querying&category=schema" --header "Authorization: Bearer <$NEON_API_KEY>"

Alternatively, you can add the following "Neon" entry to your client's MCP server configuration file (e.g., mcp.json, mcp_config.json):

{
  "mcpServers": {
    "Neon": {
      "type": "http",
      "url": "https://mcp.neon.tech/mcp?category=projects&category=branches&category=endpoints&category=querying&category=schema",
      "headers": {
        "Authorization": "Bearer <$NEON_API_KEY>"
      }
    }
  }
}

Provide an organization's API key to limit access to projects under the organization only.

Scopes and Read-Only Mode

Neon MCP advertises OAuth scopes read and write. Your MCP client can request these, or you can make the selection in the OAuth permissions UI. * is treated as write if a client still sends it.

Read-only mode restricts which tools are available, disabling write operations like creating projects, branches, or running migrations. Read-only tools include listing projects, describing schemas, querying data, and viewing performance metrics.

You can set read-only mode in two ways:

  1. Default MCP URL (editable consent): Connect with https://mcp.neon.tech/mcp and uncheck Allow writes on the authorization page. You can also choose one project, a Postgres role for SQL, and a subset of tool categories there.
  2. Parameterized MCP URL (fixed consent): Put readonly, projectId, category, roleName, and/or secrets on the MCP server URL. The authorization page confirms that grant and does not offer editors. Change the URL and authorize again to change the grant.
{
  "mcpServers": {
    "Neon": {
      "url": "https://mcp.neon.tech/mcp?readonly=true"
    }
  }
}

How the query param behaves:

  • API key flow: readonly=true is the way to enable read-only mode (there is no OAuth scope exchange in this flow). URL changes apply on the next request.
  • OAuth flow: projectId, category, readonly, roleName, and secrets on the MCP URL are a fixed grant confirmed at authorization. readonly=true cannot be widened to writes on that page. After a token is issued, changing the URL does not widen that token; authorize again.

For OAuth registration, x-read-only is an initial Allow-writes default on editable consent. It does not lock confirmation, and it does not reduce a parameterized URL that includes readonly=false. API-key requests still honor x-read-only per request, below the readonly query param.

Note: Read-only mode restricts which tools are available. run_sql stays available and runs each query in a READ ONLY transaction. run_sql_transaction is not available; run each statement with run_sql. Those calls run separately and do not share a transaction. For transaction semantics, use a connection with writes allowed.

URL Query Params for Access Control

Grant context (scope categories, project scoping, read-only mode, pinned Postgres role, secrets in tool results) is configured via URL query params on the MCP server URL. API-key requests apply those params on each request. OAuth tokens store the grant confirmed or edited at authorization.

Param Description Example
readonly Enable read-only mode (true/false) ?readonly=true
category Restrict to specific tool categories (repeated or CSV) ?category=querying&category=schema
projectId Scope all operations to a single project ?projectId=proj-123
roleName Run all SQL as this Postgres role instead of the owner ?roleName=app_reader
secrets Which secrets tool results show (setup, all, none) ?secrets=none

Read-only + project-scoped example:

{
  "mcpServers": {
    "Neon": {
      "url": "https://mcp.neon.tech/mcp?readonly=true&projectId=my-project-id"
    }
  }
}

Category-filtered example (only querying and schema tools):

{
  "mcpServers": {
    "Neon": {
      "url": "https://mcp.neon.tech/mcp?category=querying&category=schema"
    }
  }
}

Pinned Postgres role example (read-only, one project, SQL as app_reader):

{
  "mcpServers": {
    "Neon": {
      "url": "https://mcp.neon.tech/mcp?readonly=true&projectId=my-project-id&roleName=app_reader"
    }
  }
}

roleName pins the Postgres login role for the whole connection. Every SQL the server runs for you (run_sql, run_sql_transaction, explain_sql_statement, get_database_tables, describe_table_schema, describe_branch, list_slow_queries, inspect_database, and the SQL inside migrations and query tuning) logs in as that role, so Postgres grants decide what the agent can read or change. Without it, SQL runs as the database owner. Read-only mode still wraps queries in a READ ONLY transaction; the pinned role adds a limit that Postgres enforces on the login itself, so SQL that gets out of the transaction still has only the role's privileges.

  • The server resolves the role's credentials internally and never returns them. get_connection_string is not available on a pinned connection.
  • A role_name tool argument that differs from the pinned role is rejected. Omitting it uses the pinned role, never the owner.
  • If the role does not exist or cannot log in (for example ALTER ROLE … NOLOGIN), the call fails before any SQL runs. It does not retry as another role.
  • The value must be one exact Postgres role name: letters, digits, _ or $, starting with a letter or _, at most 63 characters. Anything else (empty, repeated, quoted, hyphenated) is rejected with 400, not ignored.
  • The role must be able to log in (LOGIN) and must exist on each branch you query. Roles created in SQL (CREATE ROLE app_reader LOGIN PASSWORD '…') work, as do roles created in the Neon Console or API. A role with the privileges it needs, and no more, is what makes the pin useful: for read-only agents, grant SELECT on the tables they should see and do not add it to neon_superuser. create_postgres_role with access: "read_only" creates such a role from a connection without roleName; roles it creates without access join neon_superuser.
  • OAuth: roleName on the MCP URL makes a fixed grant. The authorization page shows the role, and the issued token keeps it through refresh. Changing the URL later does not change the token; authorize again. With the default URL (editable consent), enter the role in the optional Postgres role field instead; leave it empty to keep the database owner. Tokens issued before this option have no pinned role and behave as before.
  • API key: the role is read from the URL on each request. Anyone who can edit the connection URL and holds the API key can change or remove it, so keep the URL in configuration the agent does not control.
  • The pin applies to SQL connections only. Management API tools still act with the API key or OAuth token's own access; compare_database_schema, for example, is computed by the Neon API and is not limited by the role's grants. Combine roleName with readonly=true and category to limit those tools too.
Secrets in tool results

secrets on the MCP server URL chooses which secrets tool results show. Hidden values read ***redacted***.

secrets Tool results show
setup (default) Credentials Neon issues: connection strings, Postgres role passwords, credential tokens, presigned URLs, and the Neon Auth server key, OAuth client and Realtime secrets
all Setup credentials, plus the secrets you stored in Neon Auth: OAuth provider client secrets and the SMTP password
none No secrets. get_connection_string, get_realtime_secret, reset_postgres_role_password, rotate_credential, rotate_auth_oauth_client_secret, and presign_storage_object are withheld
{
  "mcpServers": {
    "Neon": {
      "url": "https://mcp.neon.tech/mcp?secrets=none"
    }
  }
}
  • The header X-Neon-Secrets can show fewer secrets than the URL or the OAuth grant allows, never more: X-Neon-Secrets: none on a default connection hides every secret, and X-Neon-Secrets: all changes nothing without ?secrets=all.
  • Read-only connections show no secrets.
  • A pinned role (roleName) withholds get_connection_string and hides the passwords in list_postgres_roles and get_postgres_role, so the pinned role's password stays on the server.
  • OAuth: with the default URL, choose Setup credentials, All secrets, or No secrets on the authorization page. secrets on the MCP URL is a fixed grant. The token keeps the choice through refresh. A request's secrets param or header can show fewer secrets than the token allows, never more. Tokens issued before this option get setup.
  • A value other than one of setup, all, or none is rejected with 400.
  • Creates still run under none, so a secret the API returns only once, such as a confidential OAuth client's client_secret, is not recoverable from that call.

You can preview which tools are visible for any configuration using the /api/list-tools endpoint (no auth required):

curl "https://mcp.neon.tech/api/list-tools?readonly=true&category=querying"
Tools available in read-only mode

Custom tools: list_organizations, describe_branch, run_sql, get_database_tables, describe_table_schema, list_slow_queries, explain_sql_statement, inspect_database, get_neon_auth_config, search, fetch, search_docs, get_doc, search_api, send_feedback, list_incidents.

Generated Management API tools that are GET and need no approval, plus query_logs (POST, read-only). Preview the exact set with /api/list-tools?readonly=true.

Tools requiring write access:

  • Generated Management API writes (create_project, create_branch, delete_project, …)
  • get_connection_string (the connection string carries a privileged role password, so it is withheld in read-only mode; copy it from the Neon Console instead)
  • run_sql_transaction (its statements run in one session, so a COMMIT or SET TRANSACTION READ WRITE statement would end the read-only transaction)
  • prepare_database_migration, complete_database_migration
  • prepare_query_tuning, complete_query_tuning
Transport compatibility

https://mcp.neon.tech/mcp uses stateless Streamable HTTP. It supports the MCP 2026-07-28 protocol and a stateless fallback for 2025-era clients. The deprecated HTTP+SSE /sse and /message endpoints return 410 Gone.

Connect Streamable HTTP clients to https://mcp.neon.tech/mcp. For clients that only support local stdio servers, put this in the client config so mcp-remote bridges to Streamable HTTP:

{
  "mcpServers": {
    "Neon": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.neon.tech/mcp"]
    }
  }
}

A request with a malformed Origin header receives 403 Forbidden. Any serialized origin is accepted, including web pages, browser extensions, desktop webviews and null, so browser-based clients can connect. Requests without an Origin are unaffected.

Remote Server Architecture

The remote server runs as a Next.js App Router application on Vercel at mcp.neon.tech.

[!NOTE] The root / path redirects to Neon MCP Server docs. There is no landing page.

Core implementation areas:

  • app/api/[transport]/route.ts: stateless Streamable HTTP endpoint (/mcp)
  • app/api/authorize/, app/callback/, app/api/token/, app/api/revoke/: OAuth flow endpoints
  • app/.well-known/: OAuth discovery metadata endpoints
  • mcp/: MCP server, tools, handlers, analytics, and Sentry integration
  • lib/: Next.js-compatible helpers (OAuth, configuration, error handling)
  • mcp/utils/read-only.ts: read-only mode and scope handling

Guides

Features

Supported Tools

The Neon MCP Server provides the following actions, which are exposed as "tools" to MCP Clients. You can use these tools to interact with your Neon projects and databases using natural language commands.

Read the rest of the Neon README on GitHub

Questions about Neon

What is the Neon MCP server?

Official Neon MCP server for managing Neon projects and Lakebase Postgres databases. Neon is published by neondatabase, the company behind the product, on GitHub at neondatabase/mcp-server-neon, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I add Neon to Claude Code?

Neon is a remote server, so you add its URL instead of installing a package: run claude mcp add --transport http neon https://mcp.neon.tech/mcp in your terminal. In other apps, add the Neon URL as a remote or custom connector.

Does Neon need an API key?

The registry lists no required keys for Neon. Check the Neon README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Neon an official MCP server?

Yes. Neon is published by neondatabase, the company that makes the product it connects to, so it follows that product's own API and auth.

What license is Neon under?

Neon is released under the MIT license, according to its GitHub repository. The license covers the code of Neon; the service it connects to has its own terms.