PostgreSQL MCP Server (yawlabs)

Query a PostgreSQL database from Claude Code, Cursor, and any MCP client. Read-only by default - writes opt in via a single env var - so an agent can't silently drop your tables. Its 23 documented tools cover table, tables, advisor. It runs locally over stdio via the published package.

People who work with table, tables and advisor and want it reachable from Claude, Cursor, VS Code, or another MCP client. The project is written in TypeScript.

VERIFIED ACTIVE

LAST COMMIT 2026-09-14 · ★ 5 · #17 OF 168 MAINTAINED DATABASE · VERIFIED 2026-09-18

MIT · TypeScript servers · how we verify → /methodology

01 · Install PostgreSQL MCP Server (yawlabs)

before you install - you'll need

Set DATABASE_URL, ALLOW_WRITES, POSTGRES_MCP_RUNTIME, POSTGRES_SSL_REJECT_UNAUTHORIZED, POSTGRES_AUDIT_LOG_FILE before connecting.

Claude Code

claude mcp add yawlabs-postgres-mcp -- npx -y @yawlabs/postgres-mcp

Claude Desktop / Cursor / VS Code - add to config

{
  "mcpServers": {
    "yawlabs-postgres-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@yawlabs/postgres-mcp"
      ]
    }
  }
}

Same JSON for Cursor. For VS Code, rename the top-level key from `mcpServers` to `servers`.

Using another client? Same JSON, different key

Claude Desktop · mcpServers

Cursor · mcpServers

VS Code · servers

Windsurf · mcpServers

Zed · context_servers

Cline · mcpServers

Roo Code · mcpServers

Continue · mcpServers

LibreChat · mcpServers

Gemini CLI · mcpServers

Codex CLI · mcp_servers

Full setup guides: every client.

02 · Evidence

Security posture

What to check before giving this server access to your agent - from the registry, GitHub, and our own probes. We don't score safety; we show what's verifiable.

runs as local process (stdio) - runs on your machine with your user's permissions

license MIT - declared in the repository

npm package @yawlabs/postgres-mcp - published under the repo owner's npm scope (@yawlabs)

registry namespace io.github.YawLabs is GitHub-verified and matches the repo owner

03 · What PostgreSQL MCP Server (yawlabs) can do

Prose above is summarized from the project's README and registry record - no invented capabilities.

What you can build

With this server connected, an agent can list non-system schemas, list tables (and optionally views) in a schema with estimated row counts. Paginated via limit/offset, list views and materialized views in a schema, including their SQL definitions, and list functions, procedures, and aggregates in a schema with signatures and return types.

Capability map

Tools grouped from the project's README - what PostgreSQL MCP Server (yawlabs) lets an agent do.

Table

3 tools - e.g. Kind, columns, PK, outgoing FKs, incoming FKs (referenced_by), CHECK / UNIQUE / EXCLUDE constraints, indexes, and partition parent/children for a relation. Gene; Who has SELECT/INSERT/UPDATE/DELETE/etc.…

pg_describe_table · pg_table_privileges · pg_table_bloat

Readonly

1 tool - e.g. Run a SQL statement with no persistent data changes - always inside BEGIN READ ONLY, regardless of ALLOW_WRITES. The recommended tool for read access, and the o

pg_readonly

other

1 tool - e.g. Run a SQL query. Writes gated by the role in DATABASE_URL first, ALLOW_WRITES second. Supports parameterized queries via params. Result fields include dataTypeN

pg_query

Schemas

1 tool - e.g. List non-system schemas.

pg_list_schemas

Tables

1 tool - e.g. List tables (and optionally views) in a schema with estimated row counts. Paginated via limit/offset.

pg_list_tables

Views

1 tool - e.g. List views and materialized views in a schema, including their SQL definitions.

pg_list_views

Functions

1 tool - e.g. List functions, procedures, and aggregates in a schema with signatures and return types.

pg_list_functions

Extensions

1 tool - e.g. List installed extensions (pgvector, postgis, pg_stat_statements, etc.) with versions.

pg_list_extensions

Latest releases

v0.13.2 · 2026-09-14

Fixed · The server no longer exits when a connection it has checked out dies. · pg-pool listens for error on idle connections but removes that listener · while a connection is checked out, and node-pg emits error on…

v0.13.1 · 2026-09-14

Changed · npm and MCP Registry listing metadata: bugs URL, core keywords, and · server.json title/repository/websiteUrl. · release.sh writes a ## [x.y.z] changelog entry for every release -- · promoting [Unreleased]…

v0.13.0 · 2026-09-14

No runtime changes. · Changed · release.sh waits for npm to serve the version before publishing to the · MCP Registry. npm publish returns when the registry accepts the tarball, · but the version is not yet readable…

04 · Who maintains PostgreSQL MCP Server (yawlabs)

PostgreSQL MCP Server is maintained by yawlabs. We track 12 MCP servers from yawlabs - 12 actively maintained, 77 combined GitHub stars, oldest repo from Apr 2026. Full record: all servers from yawlabs.

  1. ctxlint Lint AI agent context files (CLAUDE.md, AGENTS.md, etc.) against your actual codebase ★ 10
  2. Tailscale MCP Server Tailscale MCP server for managing your tailnet from AI assistants ★ 29
  3. AWS MCP Server AWS MCP server - call any AWS API from AI assistants, with first-class SSO re-login ★ 5
  4. Caddy MCP Server MCP server for managing Caddy web servers via the admin API ★ 11
  5. MCP Compliance CLI tool and MCP server that tests MCP servers for spec compliance ★ 2
  6. LemonSqueezy MCP Server LemonSqueezy MCP server for managing your store from AI assistants ★ 4

05 · Facts

category
database - ranked #17 of 168 actively-maintained database servers as of 2026-09-18.
release cadence
10+ releases in the last 90 days (latest 2026-09-14)
registry
io.github.YawLabs/postgres-mcp (active, first published 2026-05-15 · 30 versions)
packages
npm:@yawlabs/postgres-mcp

06 · PostgreSQL MCP Server (yawlabs) FAQ

Is PostgreSQL MCP Server (yawlabs) still maintained?

Yes - as of 2026-09-18, its last commit was 2026-09-14 and it shipped 10+ releases in the last 90 days. We re-verify nightly.

What can PostgreSQL MCP Server (yawlabs) do?

With this server connected, an agent can list non-system schemas, list tables (and optionally views) in a schema with estimated row counts. Paginated via limit/offset, list views and materialized views in a schema, including their SQL definitions, and list functions, procedures, and aggregates in a schema with signatures and return types.

How do I install PostgreSQL MCP Server (yawlabs)?

Run `npx -y @yawlabs/postgres-mcp`. The README documents 5 environment variables (DATABASE_URL, ALLOW_WRITES, POSTGRES_MCP_RUNTIME…) to set first. Set DATABASE_URL, ALLOW_WRITES, POSTGRES_MCP_RUNTIME, POSTGRES_SSL_REJECT_UNAUTHORIZED, POSTGRES_AUDIT_LOG_FILE before connecting. You can also paste the ready-made client config above.

Does PostgreSQL MCP Server (yawlabs) run locally?

Yes - it's a stdio server: it runs on your machine (via npx) with your user's permissions. Your data stays local unless the server itself calls external APIs.

07 · Alternatives to PostgreSQL MCP Server (yawlabs)

More database MCP servers · Redis MCP Server · DB Connect MCP · Tgms · Open MCP Apps · A2db

More TypeScript MCP servers · SSH MCP Server (yawlabs) · Tailscale MCP Server · Thebrain · 1c Platform Tools · see all