neverinfamous avatar

PostgreSQL MCP Server

neverinfamous/postgresql-mcp

A comprehensive PostgreSQL integration that exposes 278 tools spanning schema introspection, data manipulation, and performance monitoring. The standout feature is Code Mode, which runs multi-step database operations inside a V8 isolate to drastically cut token consumption on complex workflows. You get deterministic error translation to prevent AI hallucinations, OAuth 2.1 authentication with granular scopes, and first-class support for extensions like pgvector, PostGIS, and pg_cron. Ships with 24 resources for real-time metrics and 21 AI-optimized prompts for query tuning. Reach for this when you need an AI agent to perform production-grade database work with audit trails, migration tracking, and semantic diffing built in.

GitHub stars
8
tool
1
transport
STDIO
last updated
Jan 25, 2026

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/postgresql-mcp
Category
Databases
Package
@neverinfamous/postgres-mcp
Transport
STDIO
Registry
MCP registry, active

More from neverinfamous

Related Databases MCP servers

View all
1timescale avatarPg Aiguidetimescale/pg-aiguideComprehensive PostgreSQL documentation and best practices, including ecosystem tools1.9Kstars
2neondatabase avatarNeonneondatabase/mcp-server-neonOfficial Neon MCP server for managing Neon projects and Lakebase Postgres databases.663stars
3yawlabs avatarPostgreSQL MCP Serveryawlabs/postgres-mcpPostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants10stars
4mistersandfr avatarMistersandfr Supabase Mcp Selfhostedmistersandfr/supabase-mcp-selfhostedManage Supabase projects end to end across database, auth, storage, realtime, and migrations. Moni…7stars
5edelciomolina avatarPostgres MCPedelciomolina/postgres-mcpPostgreSQL MCP wrapper with .env credential mapping, tool selection, and safe read-only defaults.5stars
6planetscale avatarPlanetScaleplanetscale/mcp-serverConnect to PlanetScale databases, branches, schema, query insights, and execute SQL0stars