Connects MCP-compatible clients to PostgreSQL for querying, schema inspection, performance analysis, and optional writes.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag โ we're steadily working through the catalog.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Postgres MCP.
queryExecute read-only SQL queries against the database
executeExecute write operations (INSERT/UPDATE/DELETE) when enabled
explain_queryGet EXPLAIN plan for query optimization
list_schemasList all schemas in the database
list_tablesList tables in a specific schema
describe_tableGet table structure (columns, types, constraints)
JaviMaligno/postgres_mcp MCP server connects MCP-compatible clients to PostgreSQL databases. It provides tools for running read-only SQL, inspecting database structure, examining indexes and constraints, reviewing table statistics, and retrieving database information. The server also includes an optional write tool for INSERT, UPDATE, and DELETE operations when write access is enabled.
The repository contains equivalent TypeScript and Python implementations. The TypeScript package is the recommended option for Smithery deployments and requires Node.js 20 or newer. The Python package requires Python 3.10 or newer. Both implementations support the documented MCP protocol revision and retain compatibility with clients using the earlier initialization style.
JaviMaligno/postgres_mcp MCP server reads connection settings from the process environment rather than accepting credentials as tool arguments. A single connection can use PostgreSQL host, port, user, password, database, and SSL mode variables. For multiple databases, POSTGRES_CONNECTIONS defines named aliases; each tool can select an alias with its optional database argument, while omitted arguments use the configured default.
Multiple connections are opened lazily, so an unused configured database does not open a connection pool. The server can also apply per-connection write permissions. If no connection is explicitly marked as default, the first declared connection is used. Credentials are not returned by list_databases, which reports aliases and non-secret connection details instead.
MCP prompts support guided database exploration, query construction, performance analysis, and schema documentation. MCP resources expose browsable schema, table, and database information through postgres:// resource URIs.
The TypeScript implementation can be run with npx @javiagui/postgresql-mcp or installed globally with npm. The Python implementation is installed with pipx install postgresql-mcp and runs as postgresql-mcp. Configuration examples are provided for Claude Code and Cursor, and the README states compatibility with Claude Desktop and other MCP clients.
For a basic connection, POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB are required. POSTGRES_HOST defaults to localhost, POSTGRES_PORT defaults to 5432, and POSTGRES_SSLMODE defaults to prefer. ALLOW_WRITE_OPERATIONS defaults to false. QUERY_TIMEOUT defaults to 30 seconds, and MAX_ROWS defaults to 1,000 returned rows.
POSTGRES_CONNECTIONS and the individual POSTGRES_* settings are mutually exclusive. Connection entries can use discrete fields or a PostgreSQL URL, with discrete fields taking precedence when both are present.
JaviMaligno/postgres_mcp MCP server exposes tools for:
EXPLAIN plans for query optimization.Write operations are disabled by default and must be enabled explicitly. The server enforces query limits through the configured timeout and maximum-row settings. Connection credentials must remain in the environment; callers cannot supply a host, user, password, or connection string through a tool argument. The README identifies MIT as the project license.
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/javimaligno-postgres-mcp)<a href="https://allmcps.com/mcp/javimaligno-postgres-mcp"><img src="https://allmcps.com/api/badge/javimaligno-postgres-mcp?style=directory" alt="Postgres MCP on AllMCPs" /></a>