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 | MCP protocol | Installation |
|---|---|---|---|---|
| TypeScript | /typescript |
✅ Recommended (Smithery) | 2026-07-28 (SDK v2) |
npm install -g @javiagui/postgresql-mcp |
| Python | /python |
✅ Stable | 2026-07-28 (SDK v2) |
pipx install postgresql-mcp |
Note: The TypeScript version is used for Smithery deployments. Both versions provide identical functionality.
Protocol compatibility: both servers speak the
2026-07-28revision and are dual-era — clients that still open with the 2025-erainitializehandshake are served exactly as before, so no client needs upgrading. The TypeScript package requires Node.js 20+; the Python package requires Python 3.10+.
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






