Neon PostgreSQL MCP Server

by spragginsdesigns

264 downloads
Not rated
GitHub

Description

# Neon PostgreSQL MCP Server A Model Context Protocol (MCP) server that provides secure access to Neon PostgreSQL databases, enabling AI assistants like Claude to interact with your database through standardized tools. ## Overview This MCP server allows AI assistants to: - Query…

About

# Neon PostgreSQL MCP Server A Model Context Protocol (MCP) server that provides secure access to Neon PostgreSQL databases, enabling AI assistants like Claude to interact with your database through standardized tools. ## Overview This MCP server allows AI assistants to: - Query data using SELECT statements - Execute…

Details

Author
spragginsdesigns
Downloads
264
Categories
Database

- Secure SSL/TLS encrypted connections to Neon PostgreSQL.
- Connection pooling with configurable maximum connections and idle timeout.
- Input validation and type safety for all operations.
- Comprehensive error handling with meaningful messages.
- Full implementation of the Model Context Protocol specification.
- Multiple server implementations (ES module, CommonJS, basic, TypeScript).

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Neon PostgreSQL MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, install dependencies with npm install, and set the NEON_PG_CONNECTION_STRING environment variable to your Neon PostgreSQL connection string. Run one of the provided server implementations (e.g., node pg-mcp-server.js for the ES module version) and configure your MCP-compatible client (e.g., Claude Desktop or Cursor IDE) to point to the server script with the environment variable set.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "neon postgresql mcp server": {
            "neon-pg-mcp-server": {
                "command": "node",
                "args": [
                    "pg-mcp-server.js"
                ]
            }
        }
    }
}

McpServers

{
    "neon-pg-mcp-server": {
        "command": "node",
        "args": [
            "pg-mcp-server.js"
        ]
    }
}

Neon PostgreSQL MCP Server

A Model Context Protocol (MCP) server that provides secure access to Neon PostgreSQL databases, enabling AI assistants like Claude to interact with your database through standardized tools.

Overview

This MCP server allows AI assistants to:
- Query data using SELECT statements
- Execute data modifications (INSERT, UPDATE, DELETE)
- List available tables
- Describe table structures

The server implements multiple versions to demonstrate different approaches:
- pg-mcp-server.js - Modern ES module implementation using the latest MCP SDK
- index.js - CommonJS implementation with class-based architecture
- basic-pg-server.js - Simplified implementation with basic MCP protocol handling
- src/index.ts - TypeScript implementation (requires compilation)

Features

- Secure Connection: SSL/TLS encrypted connections to Neon PostgreSQL
- Connection Pooling: Efficient database connection management
- Type Safety: Input validation for all operations
- Error Handling: Comprehensive error handling with meaningful messages
- MCP Compliance: Full implementation of the Model Context Protocol specification

Prerequisites

- Node.js 18+
- A Neon PostgreSQL database account and connection string
- An MCP-compatible client (e.g., Claude Desktop, Cursor IDE)

Installation

1. Clone this repository:

git clone <repository-url>
cd neon-pg-server

2. Install dependencies:

npm install

3. Set up your Neon PostgreSQL connection string as an environment variable:

export NEON_PG_CONNECTION_STRING="postgresql://user:password@host/database?sslmode=require"

Usage

Running the Server

Choose one of the available implementations:

ES Module version (recommended):

node pg-mcp-server.js

CommonJS version:

node index.js

Basic version:

node basic-pg-server.js

TypeScript version:
```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.