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.
- ctxlint Lint AI agent context files (CLAUDE.md, AGENTS.md, etc.) against your actual codebase ★ 10
- Tailscale MCP Server Tailscale MCP server for managing your tailnet from AI assistants ★ 29
- AWS MCP Server AWS MCP server - call any AWS API from AI assistants, with first-class SSO re-login ★ 5
- Caddy MCP Server MCP server for managing Caddy web servers via the admin API ★ 11
- MCP Compliance CLI tool and MCP server that tests MCP servers for spec compliance ★ 2
- LemonSqueezy MCP Server LemonSqueezy MCP server for managing your store from AI assistants ★ 4
05 · Facts
- repository
- github.com/yawlabs/postgres-mcp
- 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)
Alternatives to PostgreSQL MCP Server (yawlabs)
Maintained database servers if PostgreSQL MCP Server (yawlabs) isn't the fit.
- Dbx Query databases from AI agents using connections configured in DBX. ★ 20,017 · 2026-09-18
- Toolbox for Databases MCP Toolbox for Databases enables your agent to connect to your database. ★ 16,449 · 2026-09-18
- Butterbase Ai MCP Server Butterbase MCP server - manage your backend: schemas, auth, functions, storage, RAG, deploys. ★ 3,562 · 2026-09-18
- Dbhub Minimal, token-efficient Database MCP Server for PostgreSQL, MySQL, SQL Server, SQLite, MariaDB ★ 3,534 · 2026-09-18
- LINQ to DB Inspect database schemas and execute SQL queries across multiple database providers with LINQ to DB. ★ 3,328 · 2026-09-17
- Supabase MCP server for interacting with the Supabase platform ★ 2,910 · 2026-09-17
Pairs well with
Servers that cover what PostgreSQL MCP Server (yawlabs) doesn't - only shown when the pairing reason fits the companion.
- Server Chart → data & analytics companion data & analytics · ★ 4,367
- ClaudeR - RStudio MCP Server → data & analytics companion data & analytics · ★ 342
- Server Filesystem → filesystem companion filesystem · ★ 39,038
- Pdf MCP → filesystem companion filesystem · ★ 135
- Telnyx → API integration companion API integration · ★ 197
- Microsoft 365 MCP Server → API integration companion API integration · ★ 980
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