
This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that gives AI assistants standardized tools for securely querying, modifying, and inspecting Neon PostgreSQL databases.
Neon PostgreSQL MCP Server is cataloged as an MCP server attributed to spragginsdesigns. A Model Context Protocol server that gives AI assistants standardized tools for securely querying, modifying, and inspecting Neon PostgreSQL databases. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT License. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Neon PostgreSQL MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes. One server instance can serve several Neon projects, with pools created lazily per project on first use.
Projects listed in NEON_PG_READONLY_PROJECTS have the execute tool refused outright, while reads still work.
The query tool only accepts SELECT, WITH, and EXPLAIN statements and runs them in a read-only transaction with results capped at 100 rows.
README.md · 5ad5b87a3e80 · Fetched 2026-11-13 12:51:25 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
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.
This MCP server allows AI assistants to:
The server implements multiple versions to demonstrate different approaches:
pg-mcp-server.js - Modern ES module implementation using the latest MCP SDKindex.js - CommonJS implementation with class-based architecturebasic-pg-server.js - Simplified implementation with basic MCP protocol handlingsrc/index.ts - TypeScript implementation (requires compilation)git clone <repository-url>
cd neon-pg-server
npm install
export NEON_PG_CONNECTION_STRING="postgresql://user:password@host/database?sslmode=require"
| Variable | Required | Purpose |
|---|---|---|
NEON_PG_CONNECTION_STRING | one of the two | Single connection string, registered as the project named default. The original single-database setup — still fully supported. |
NEON_PG_CONNECTIONS | one of the three | JSON object mapping project names to connection strings, e.g. {"versemind":"postgresql://...","linecrush":"postgresql://..."}. Can be combined with NEON_PG_CONNECTION_STRING. |
NEON_PG_CONNECTIONS_FILE | one of the three | Path to a JSON file with the same name → connection-string map. Useful for sharing one connections map across many MCP registrations on a machine (keep the file out of version control, e.g. ~/.secrets/neon-connections.json). |
NEON_PG_READONLY_PROJECTS | no | Comma-separated project names for which the execute tool is refused outright (reads still work). |
At least one of the first three must be set. Sources merge in order — NEON_PG_CONNECTION_STRING (as default), then NEON_PG_CONNECTIONS_FILE, then NEON_PG_CONNECTIONS — with later sources overriding earlier ones per name (a warning is logged to stderr on override).
One server instance can serve several Neon projects. Pools are created lazily per project on first use, so configuring six projects does not open six pools at startup.
{
"neon-pg": {
"command": "node",
"args": ["/path/to/neon-pg-server/pg-mcp-server.js"],
"env": {
"NEON_PG_CONNECTION_STRING": "postgresql://user:pw@ep-old-host.aws.neon.tech/verceldb?sslmode=require",
"NEON_PG_CONNECTIONS": "{\"versemind\":\"postgresql://user:pw@ep-vm-host.aws.neon.tech/neondb?sslmode=require\",\"linecrush\":\"postgresql://user:pw@ep-lc-host.aws.neon.tech/verceldb?sslmode=require\"}",
"NEON_PG_READONLY_PROJECTS": "linecrush"
}
}
}
With this config:
get_tables with no arguments runs against default (the legacy connection string) — existing setups keep working unchanged.get_tables with project: "versemind" runs against the versemind database.execute with project: "linecrush" is refused because linecrush is in NEON_PG_READONLY_PROJECTS.list_projects shows all three names with their host and database (never credentials).Default project resolution: the project named default (from NEON_PG_CONNECTION_STRING or a default key in NEON_PG_CONNECTIONS) is the default for read tools. If no default exists but exactly one project is configured, that one is the default. With multiple named projects and no default, read tools require an explicit project argument.
These exist so it is impossible to read a tool result — or run a write — without knowing which database it touched:
execute always requires an explicit project argument. There is no default and no inference for writes; a missing or unknown project is an error that lists the valid names and runs nothing.source block (project, database, host) — success or error, read or write. Error text is prefixed with [project=... database=...].NEON_PG_READONLY_PROJECTS hard-blocks execute per project, even with an explicit project argument.neon://...) are served from the default project only.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:
# First compile
npm run build
# Then run
node build/index.js
{
"neon-postgres": {
"command": "node",
"args": ["/path/to/neon-pg-server/pg-mcp-server.js"],
"env": {
"NEON_PG_CONNECTION_STRING": "your-connection-string-here"
}
}
}
Production pg-mcp-server.js exposes 9 tools. Each tool includes Claude/Codex-friendly titles, read/write annotations, structured output schemas, and JSON text fallbacks.
Every tool except list_projects accepts an optional project argument selecting the named connection to run against (default: the default project). On execute the project argument is required. Every result includes a source block stating the project, database, and host it ran against.
List the configured project connections: name, host, database, default flag, and read-only flag. Never returns credentials.
Parameters: None
Execute read-only SELECT, WITH, and EXPLAIN queries to retrieve data from your database.
The query tool runs inside a read-only transaction and safely caps unbounded top-level result sets at 100 rows, so agents can omit LIMIT during exploration. A trailing semicolon is accepted.
Parameters:
sql (required): SQL SELECT, WITH, or EXPLAIN statement to executeparams (optional): Array of query parameters for parameterized queriesExample:
SELECT * FROM users WHERE age > $1
Execute SQL statements that modify data (INSERT, UPDATE, DELETE, DDL).
Parameters:
sql (required): SQL statement to executeproject (required): Named project to write to — no default is applied for writesparams (optional): Array of statement parametersRefused outright for projects listed in NEON_PG_READONLY_PROJECTS.
Example:
INSERT INTO users (name, email) VALUES ($1, $2)
List the slowest statements tracked by pg_stat_statements.
Parameters:
limit (optional): Max queries to return, default 10, hard cap 25order_by (optional): Sort metric, one of mean_exec_time, total_exec_time, calls, or rowsmin_mean_ms (optional): Minimum mean execution time in millisecondsIf pg_stat_statements is not installed, the tool returns a structured setup note instead of a cryptic database error.
List public schema tables with approximate size and column counts.
Parameters: None
Return schema overview: table names, sizes, row estimates, column counts, and pagination metadata.
Parameters:
tables (optional): Specific public tables to includelimit (optional): Max tables to return, default 50, hard cap 200offset (optional): Tables to skip for paginationinclude_all (optional): Include backup/archive tablesGet detailed structure information about a specific public table.
Parameters:
table (required): Name of the table to describeReturns:
Return a few rows from a public table plus inferred JSONB structure.
Parameters:
table (required): Name of the table to samplelimit (optional): Number of rows, default 3, hard cap 10Search public table and column names by case-insensitive text pattern.
Parameters:
pattern (required): Text to search for in table and column namespg_stat_statements entry point before they start tuning queries.execute requires an explicit project argument and honors NEON_PG_READONLY_PROJECTSLIMITThe server uses the following default pool settings:
You can modify these in the connection pool initialization:
this.pool = new pg.Pool({
connectionString: CONNECTION_STRING,
ssl: { rejectUnauthorized: true },
max: 10, // Adjust as needed
idleTimeoutMillis: 30000 // Adjust as needed
});
neon-pg-server/
├── pg-mcp-server.js # Main ES module implementation
├── index.js # CommonJS implementation
├── basic-pg-server.js # Basic implementation
├── src/
│ └── index.ts # TypeScript implementation
├── build/ # Compiled TypeScript output
├── package.json # Project dependencies
├── tsconfig.json # TypeScript configuration
└── README.md # This file
If you want to use the TypeScript version:
# Install dev dependencies
npm install
# Compile TypeScript
npx tsc
# Run compiled version
node build/index.js
Contributions are welcome! Please:
MIT License - see LICENSE file for details
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Neon PostgreSQL MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/neon-pg-mcp-server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that lets AI assistants run SQL queries against AWS Athena databases and retrieve results.

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.