claude mcp add postgres-mcp -- npx -y postgres_mcp
A pasteable skeleton generated from the repository name. Check the project README for the exact package and arguments.
Star count
12 โ ยท JaviMaligno/postgres_mcp ยท read from the repository page ยท (checked 2026-10-16 20:00:20)
Source
collected from the punkpeye/awesome-mcp-servers list ยท type: MCP server
Harvest history
first seen 2026-10-09 ยท last seen 2026-10-16 ยท seen 32ร ยท listed by 7 sources
Score
score 703 ยท 12 โ ยท 7 sources ยท mcp
FAQ (answers come from our records)
How do I install it?
We did not find an install command for this repository (our install coverage is only about 4%). Check its README or releases page.
Who is it for?
We filed it under these tags: MCP ๆๅก. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository JaviMaligno/postgres_mcp๏ผfirst catalogued 2026-10-09๏ผlast seen 2026-10-16ใThere is no official certification or quality rating here โ we record sources and dates only.
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-28 revision and are > **dual-era** โ clients that still open with the 2025-era initialize handshake 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 Quick Start TypeScript (Recommended for Smithery) Python **Full Installation Guide** - Includes database permissions setup, remote connections, and troubleshooting. Configuration Environment Variables | Variable | Required | Default | Description | |----------|----------|---------|-------------| | POSTGRES_HOST | | localhost | Database host | | POSTGRES_PORT | | 5432 | Database port | | POSTGRES_USER | โ | | Database user | | POSTGRES_PASSWORD | โ | | Database password | | POSTGRES_DB | โ | | Database name | | POSTGRES_SSLMODE | | prefer | SSL mode | | ALLOW_WRITE_OPERATIONS | | false | Enable INSERT/UPDATE/DELETE | | QUERY_TIMEOUT | | 30 | Query timeout (seconds) | | MAX_ROWS | | 1000 | Maximum rows returned | Multiple databases Most real work touches more than one database. Instead of editing this config and restarting your client every time, declare several connections and pick one per call by **alias**: - **list_databases** returns the configured aliases with host, database name, write permission and which is the default. **Credentials are never returned.** - Every other tool takes an optional **database** argument naming an alias. Omit it and you get the default connection โ so an existing single-database setup keeps working with no changes at all. - **allowWrite is per connection**, falling back to ALLOW_WRITE_OPERATIONS. A production replica stays read-only while a local database allows writes. - default: true marks the connection used when database is omitted; otherwise it is the first one declared. At most one connection may be marked default. - Each connection accepts either discrete fields (host, port, user, password, database, sslmode) or a url DSN โ and discrete fields override the DSN, so you can reuse a URL and change one part of it. - One pool per alias, opened lazily: a configured but unused database never opens a socket. POSTGRES_CONNECTIONS and the plain POSTGRES_* variables are **mutually