A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/@neondatabase/mcp-server-neon below:

@neondatabase/mcp-server-neon - npm

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

The Model Context Protocol (MCP) is a new, standardized protocol designed to manage context between large language models (LLMs) and external systems. This repository offers an installer and an 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:

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

[!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

You have two options for connecting your MCP client to Neon:

  1. Remote MCP Server (Preview): 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.

  2. Local MCP Server: Run the Neon MCP server locally on your machine, authenticating with a Neon API key.

For Local MCP Server setup, you also need a Neon API key. See Neon API Keys documentation for instructions on generating one.

Option 1. Remote Hosted MCP Server (Preview)

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.

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

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

{
  "mcpServers": {
    "Neon": {
      "url": "https://mcp.neon.tech/mcp",
      "headers": {
        "Authorization": "Bearer <$NEON_API_KEY>"
      }
    }
  }
}

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

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.

Option 2. Local MCP Server

Run the Neon MCP server on your local machine with your Neon API key. This method allows you to manage your Neon projects and databases without relying on a remote MCP server.

Add the following JSON configuration within the mcpServers section of your client's mcp_config file, replacing <YOUR_NEON_API_KEY> with your actual Neon API key:

{
  "mcpServers": {
    "neon": {
      "command": "npx",
      "args": [
        "-y",
        "@neondatabase/mcp-server-neon",
        "start",
        "<YOUR_NEON_API_KEY>"
      ]
    }
  }
}

If your client does not use JSON for configuration of MCP servers (such as older versions of Cursor), you can use the following command when prompted:

npx -y @neondatabase/mcp-server-neon start <YOUR_NEON_API_KEY>
Troubleshooting on Windows

If you are using Windows and encounter issues while adding the MCP server, you might need to use the Command Prompt (cmd) or Windows Subsystem for Linux (wsl) to run the necessary commands. Your configuration setup may resemble the following:

{
  "mcpServers": {
    "neon": {
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@neondatabase/mcp-server-neon",
        "start",
        "<YOUR_NEON_API_KEY>"
      ]
    }
  }
}
{
  "mcpServers": {
    "neon": {
      "command": "wsl",
      "args": [
        "npx",
        "-y",
        "@neondatabase/mcp-server-neon",
        "start",
        "<YOUR_NEON_API_KEY>"
      ]
    }
  }
}

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.

Project Management:

Branch Management:

SQL Query Execution:

Database Migrations (Schema Changes):

Query Performance Optimization:

Compute Management:

Neon Auth:

Neon Auth:

Migrations are a way to manage changes to your database schema over time. With the Neon MCP server, LLMs are empowered to do migrations safely with separate "Start" (prepare_database_migration) and "Commit" (complete_database_migration) commands.

The "Start" command accepts a migration and runs it in a new temporary branch. Upon returning, this command hints to the LLM that it should test the migration on this branch. The LLM can then run the "Commit" command to apply the migration to the original branch.

Development with MCP CLI Client

The easiest way to iterate on the MCP Server is using the mcp-client/. Learn more in mcp-client/README.md.

npm install
npm run build
npm run watch # You can keep this open.
cd mcp-client/ && NEON_API_KEY=... npm run start:mcp-server-neon
Development with Claude Desktop (Local MCP Server)
npm install
npm run build
npm run watch # You can keep this open.
node dist/index.js init $NEON_API_KEY

Then, restart Claude each time you want to test changes.

To run the tests you need to setup the .env file according to the .env.example file.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4