PostgreSQL MCP Server
A Model Context Protocol (MCP) server that provides PostgreSQL integration tools for Claude Code.
Features
- List Databases: List all databases on the PostgreSQL server
- List Schemas: List all schemas in the current database
- List Tables: List tables in a specific schema with optional metadata (size, row count)
- Describe Table: Get detailed table structure (columns, types, constraints, defaults)
- Execute Query: Execute read-only SQL queries (SELECT and WITH statements only)
- List Indexes: List indexes for a specific table with usage statistics
- Explain Query: Get execution plans for SQL queries to analyze performance
- Get Table Stats: Get detailed statistics for tables (row count, size, etc.)
- Security-first design with read-only operations by default
- Compatible with Claude Code's MCP architecture
Prerequisites