neverinfamous avatar

PostgreSQL MCP Server

neverinfamous/postgres-mcp

Connects Claude to PostgreSQL 12-18 with 278 tools spanning schema introspection, query execution, migration tracking, and extension support for pgvector, PostGIS, pg_cron, and others. The standout feature is Code Mode, which runs multi-step operations inside a V8 isolate to cut token overhead by up to 90% instead of chaining dozens of individual tool calls. Ships with OAuth 2.1 authentication, granular scopes, deterministic error translation to prevent AI hallucinations, and 24 resources that surface real-time health metrics and replication stats. You also get 21 built-in prompts for query tuning and schema design. Reach for this when you need enterprise-grade PostgreSQL access with proper audit trails, connection pooling, and semantic diffing before restoring data.

GitHub stars
8
tool
1
transport
STDIO
last updated
Dec 9, 2025

Tools

1 tools

Public tool metadata for what this MCP can expose to an agent.

execute_custom_queryExecute a custom SQL query against the database. WARNING: Use with care. Do not expose to untrusted input.4 params

Execute a custom SQL query against the database. WARNING: Use with care. Do not expose to untrusted input.

Parameters* required
connectionStringstring
PostgreSQL connection string
querystring
SQL query to execute
timeoutnumber
Optional query timeout in milliseconds
valuesarray
Optional parameter values for the query

Sponsors

Readme

postgres-mcp

PostgreSQL MCP Server binding the Model Context Protocol to a secure PostgreSQL sandbox.

Features Code Mode — a revolutionary approach that provides access to all 278 tools through a secure, true V8 isolate (worker_threads), eliminating the massive token overhead of multi-step tool calls. Also includes schema introspection, migration tracking, smart tool filtering, deterministic error handling, connection pooling, HTTP/SSE Transport, OAuth 2.1 authentication, and extension support for citext, ltree, pgcrypto, pg_cron, pg_stat_kcache, pgvector, PostGIS, and HypoPG.

278 Specialized Tools · 24 Resources · 21 AI-Powered Prompts


View the full README on GitHub

Details

Repository
github.com/neverinfamous/postgres-mcp
Category
Databases
Package
docker.io/writenotenow/postgres-mcp-enhanced:v1.2.0
Transport
STDIO
Registry
MCP registry, active

More from neverinfamous

Related Databases MCP servers

View all
1hovecapital avatarRead Only Local Mysql Mcp Serverhovecapital/read-only-local-mysql-mcp-serverMCP server for read-only MySQL database queries in Claude Desktop6stars
2afgong avatarAfgong Sqlite Mcp Serverafgong/sqlite-mcp-serverExplore your Messages SQLite database to browse tables and inspect schemas with ease. Run flexible…0stars
3bluwork avatarMongo Scout Mcpbluwork/mongo-scout-mcpScout your MongoDB databases with AI - safety features, live monitoring, and data quality0stars
4musaddiq-dev avatarMySQL MCP Servermusaddiq-dev/mysql-mcp-serverPython MCP server for MySQL database inspection and querying0stars
5tthanh2k6 avatarSupabase Rls Checktthanh2k6/supabase-rls-checkRead-only Supabase RLS checks: explain rules, analyze/diff SQL exports, scan public env vars.0stars
6crystaldba avatarPostgres MCP Procrystaldba/postgres-mcpPostgres MCP Pro provides configurable read/write access and performance analysis for you and your AI agents.2.8Kstars