
PostgreSQL MCP Server
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 toolsPublic 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.
connectionStringstringquerystringtimeoutnumbervaluesarraySponsors
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
Details
- Repository
- github.com/neverinfamous/postgresql-mcp
- Category
- Databases
- Package
@neverinfamous/postgres-mcp- Transport
- STDIO
- Registry
- MCP registry, active