databases

Neon

by neondatabase-labs

Easily manage serverless Postgres databases on Neon, with seamless AWS integration for scalable, efficient database solu

Manage Neon's serverless Postgres databases.

github stars

560

Natural language interfaceRemote — zero setupBuilt-in migration support

best for

  • / Non-developers who need database access
  • / Database schema changes and migrations
  • / Teams wanting conversational database management
  • / Rapid prototyping with serverless Postgres

capabilities

  • / Create projects and branches
  • / Run database queries in natural language
  • / Perform database migrations
  • / Manage Neon databases without writing SQL
  • / Execute Neon API operations through conversational commands

what it does

Lets you manage Neon's serverless PostgreSQL databases using natural language commands instead of SQL or API calls.

about

Neon is an official MCP server published by neondatabase-labs that provides AI assistants with tools and capabilities via the Model Context Protocol. Easily manage serverless Postgres databases on Neon, with seamless AWS integration for scalable, efficient database solu It is categorized under databases.

how to install

You can install Neon in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server supports remote connections over HTTP, so no local installation is required.

license

MIT

Neon is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

readme

Neon Logo fallback # Neon MCP Server [![Install MCP Server in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=Neon&config=eyJ1cmwiOiJodHRwczovL21jcC5uZW9uLnRlY2gvbWNwIn0%3D) **Neon MCP Server** is an open-source tool that lets you interact with your Neon Postgres databases in **natural language**. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) The Model Context Protocol (MCP) is a [standardized protocol](https://modelcontextprotocol.io/introduction) designed to manage context between large language models (LLMs) and external systems. This repository provides a remote MCP Server for [Neon](https://neon.tech). Neon's MCP server acts as a bridge between natural language requests and the [Neon API](https://api-docs.neon.tech/reference/getting-started-with-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 →](https://neon.tech/docs/ai/neon-mcp-server#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 [`neonctl@latest init`](https://neon.com/docs/reference/cli-init) to automatically configure Neon's MCP Server, [agent skills](https://github.com/neondatabase/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](https://console.neon.tech/signup). - **Node.js (>= v18.0.0):** Download from [nodejs.org](https://nodejs.org). For development, you'll also need [Bun](https://bun.sh) installed. ### Option 1. Quick Setup with API Key **Don't want to manually create an API key?** Run [`neonctl@latest init`](https://neon.com/docs/reference/cli-init) to automatically configure Neon's MCP Server with one command: ```bash npx neonctl@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: ```bash npx add-mcp https://mcp.neon.tech/mcp ``` Alternatively, you can add the following "Neon" entry to your client's MCP server configuration file (e.g., `mcp.json`, `mcp_config.json`): ```json { "mcpServers": { "Neon": { "type": "http", "url": "https://mcp.neon.tech/mcp" } } } ``` - 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](https://console.neon.tech/app/settings?modal=create_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: ```bash npx add-mcp https://mcp.neon.tech/mcp --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`): ```json { "mcpServers": { "Neon": { "type": "http", "url": "https://mcp.neon.tech/mcp", "headers": { "Authorization": "Bearer <$NEON_API_KEY>" } } } } ``` > Provide an organization's API key to limit access to projects under the organization only. ### Read-Only Mode **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 enable read-only mode in two ways: 1. **OAuth Scope Selection (Recommended):** When connecting via OAuth, uncheck "Full access" during authorization to operate in read-only mode. 2. **Header Override:** Add the `x-read-only` header to your configuration: ```json { "mcpServers": { "Neon": { "url": "https://mcp.neon.tech/mcp", "headers": { "x-read-only": "true" } } } } ``` > **Note:** Read-only mode restricts which _tools_ are available, not the SQL content. The `run_sql` tool remains available and can execute any SQL including INSERT/UPDATE/DELETE. For true read-only SQL access, use database roles with restricted permissions.
Tools available in read-only mode - `list_projects`, `list_shared_projects`, `describe_project`, `list_organizations` - `describe_branch`, `list_branch_computes`, `compare_database_schema` - `run_sql`, `run_sql_transaction`, `get_database_tables`, `describe_table_schema` - `list_slow_queries`, `explain_sql_statement` - `get_connection_string` - `search`, `fetch`, `list_docs_resources`, `get_doc_resource` **Tools requiring write access:** - `create_project`, `delete_project` - `create_branch`, `delete_branch`, `reset_from_parent` - `provision_neon_auth`, `provision_neon_data_api` - `prepare_database_migration`, `complete_database_migration` - `prepare_query_tuning`, `complete_query_tuning`
### Server-Sent Events (SSE) Transport (Deprecated) MCP supports two remote server transports: the deprecated Server-Sent Events (SSE) and the newer, recommended Streamable HTTP. If your LLM client doesn't support Streamable HTTP yet, you can switch the endpoint from `https://mcp.neon.tech/mcp` to `https://mcp.neon.tech/sse` to use SSE instead. Run the following command to add the Neon MCP Server for all detected agents and editors in your workspace using the SSE transport: ```bash npx add-mcp https://mcp.neon.tech/sse --type sse ``` ## Guides - [Neon MCP Server Guide](https://neon.tech/docs/ai/neon-mcp-server) - [Connect MCP Clients to Neon](https://neon.tech/docs/ai/connect-mcp-clients-to-neon) - [Cursor with Neon MCP Server](https://neon.tech/guides/cursor-mcp-neon) - [Claude Desktop with Neon MCP Server](https://neon.tech/guides/neon-mcp-server) - [Cline with Neon MCP Server](https://neon.tech/guides/cline-mcp-neon) - [Windsurf with Neon MCP Server](https://neon.tech/guides/windsurf-mcp-neon) - [Zed with Neon MCP Server](https://neon.tech/guides/zed-mcp-neon) # 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. ### Tool ---