@yawlabs/postgres-mcp weekly downloads statistics
By yawlabs (2 listings) · npm · Claude Code
PostgreSQL MCP server, read-only by default: query, schema introspection, EXPLAIN plans, index advisor, and DBA health checks.
@yawlabs/postgres-mcp has 1,913 recorded weekly downloads on npm, a decrease of 11.9% over the past 30 days, ranking #1901 of 3,247 tracked listings.
About @yawlabs/postgres-mcp
@yawlabs/postgres-mcp
One click adds this to your local Yaw MCP config so it's available in every Yaw Terminal session. Tested with Yaw MCP 1.1.18 or newer. Or install manually below.
Query a PostgreSQL database from Claude Code, Cursor, and any MCP client. SQL runs in read-only transactions by default, and writes opt in via a single env var. Connect with a least-privilege role: the role, not this server, is the security boundary.
Built and maintained by Yaw Labs.
What's new in 0.14
0.14 is a hardening release: the read-only paths refuse more, results and run time are bounded, and the server checks the role it was given. Full detail in the CHANGELOG.
- Read-only paths refuse statements that step around
BEGIN READ ONLY--SET,DO,CALL,COPY,VACUUMand more by leading keyword, plus direct calls to functions such asset_configanddblink*(the full list).pg_index_advisorruns the same check on its workload. - Results are bounded in bytes, and calls in time. A result over
POSTGRES_MAX_RESULT_BYTES(default 16 MiB) fails, and a statement that outlivesstatement_timeoutis terminated atPOSTGRES_QUERY_DEADLINE_MS. - Session state does not survive a call. The connection runs
DISCARD ALLafter every SQL call. - Startup role check. The server prints a
WARNINGon stderr for each way theDATABASE_URLrole reaches past read-only, and the banner no longer says "read-only". See Configuring access. pg_explainwithanalyzeoff no longer executes anything.sql: "ANALYZE SELECT ..."used to becomeEXPLAIN ANALYZE SELECT ...and run.
Coming from 0.13.x? 0.14.0 has four breaking changes. On read-only paths the statements and functions above now fail instead of running. A result over POSTGRES_MAX_RESULT_BYTES fails rather than returning (raise the variable if you need more). Session state set by one call -- a SET search_path, a temp table, a prepared statement -- is gone by the next, even with POSTGRES_POOL_MAX=1; put settings on the role or in DATABASE_URL. And text that scripts may match on changed: the startup banner, the audit sql of a plain pg_explain (now EXPLAIN (COSTS ON) ...), and the redacted sqlKeyword of a statement behind a leading comment (its first word, where it used to be UNKNOWN). Details in the 0.14.0 changelog entry.
Still on 0.12.0? Upgrade. 0.12.1 closes a stacked-query hole in pg_index_advisor: SQL in its statements argument could carry several commands, so SELECT 1; COMMIT; DROP SCHEMA public CASCADE; escaped the read-only transaction of a tool that hosts often run without a prompt.
Added in 0.12 and still current: pg_index_advisor, opt-in audit logging, an outputSchema and structuredContent on every tool (alongside the unchanged text block), and both MCP protocol eras (the legacy 2025 revisions and 2026-07-28).
Coming from 0.10.x? 0.11.0 has three breaking changes: pg_seq_scan_tables, pg_unused_indexes and pg_top_queries return an envelope (read data.rows where you used to read data), pg_explain with analyze: true emits BUFFERS (pass buffers: false for the old output), and Node 22 is the floor. Details in the 0.11.0 changelog entry.
Backstory
Anthropic's reference Postgres MCP server, @modelcontextprotocol/server-postgres, was archived in May 2025 and marked deprecated on npm in July 2025. Anthropic has not shipped a replacement. Despite the deprecation, the last published version (v0.6.2) is still pulled more than 100,000 times per week (npm download counts, November 2026) - a lot of agents are pointed at an unmaintained package.
That unmaintained package also has a known, publicly documented stacked-query SQL injection (Datadog Security Labs) that bypasses its BEGIN READ ONLY wrapper with input like COMMIT; DROP SCHEMA public CASCADE;. It has never been patched at npm.
A handful of community forks have appeared, but each fills a narrow slice:
@zeddotdev/postgres-context-server- Zed's fork, primarily a security patch on the original shape.- Postgres MCP Pro (Crystal DBA) - focused on index tuning and hypothetical-index / buffer-cache diagnostics.
- AWS Labs Postgres MCP - tied to Aurora / RDS Data API + Secrets Manager.
None of them position themselves as a general-purpose daily driver you'd hand to Claude Code or Cursor against an arbitrary Postgres: modern introspection, perf helpers, role/privilege awareness, and a write-safety posture out of the box. That's the gap @yawlabs/postgres-mcp fills.
Why this one?…
Description from the npm listing.
- postgres
- postgresql
- database
- mcp
- mcp-server
- model-context-protocol
- ai
- agent
- claude
- claude-code
- cursor
- llm
- sql
- schema
- explain
- dba
- index-advisor
- query-optimization
- ai-agents
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm Claude Code plugins
All 20 @yawlabs/postgres-mcp alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@yawlabs/postgres-mcp. First seen Oct 16, 2026; last successful collection Dec 2, 2026. See the methodology.