
PostgreSQL MCP Server
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 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/postgres-mcp
- Category
- Databases
- Package
docker.io/writenotenow/postgres-mcp-enhanced:v1.2.0- Transport
- STDIO
- Registry
- MCP registry, active