PostgreSQL MCP Server
MCP server for PostgreSQL database operations. Works with Claude Code, Claude Desktop, Cursor, and any MCP-compatible client.
Language Versions
This repository contains both TypeScript and Python implementations:
| Version | Directory | Status | Installation |
|---|---|---|---|
| TypeScript | /typescript |
✅ Recommended (Smithery) | npm install -g postgresql-mcp |
| Python | /python |
✅ Stable | pipx install postgresql-mcp |
Note: The TypeScript version is used for Smithery deployments. Both versions provide identical functionality.
Features
- Query Execution: Execute SQL queries with read-only protection by default
- Schema Exploration: List schemas, tables, views, and functions
- Table Analysis: Describe structure, indexes, constraints, and statistics
- Performance Tools: EXPLAIN queries and analyze table health
- Security First: SQL injection prevention, credential protection, read-only by default
- MCP Prompts: Guided workflows for exploration, query building, and documentation
- MCP Resources: Browsable database structure as markdown






