Best MCP Servers for PostgreSQL (2026)

The best MCP servers for PostgreSQL — let AI agents run queries, inspect schemas, and read or write records in your Postgres database from Claude, Cursor, and other MCP clients.

Top 10 · ranked by installs, upvotes, stars and views · refreshed hourly

  1. Why it’s hereMost popular in this category on AllMCPs

    Minimal Database MCP Server for PostgreSQL, MySQL, SQL Server, SQLite, MariaDB

    Upvotes: 0Installs: 0GitHub stars: 3.8k
    Install
  2. Why it’s hereCommunity pick

    Manage multiple SSH servers from one MCP: command execution, file transfer/rsync, database dump/import/query (MySQL/PostgreSQL/MongoDB), backups & restore, health monitoring, persistent sessions, tunnels, ProxyJump/bastion, and opt-in per-server security modes (readonly/restricted) with audit log. Linux, macOS & Windows OpenSSH.

    Upvotes: 0Installs: 0GitHub stars: 531
    Install
  3. Why it’s hereCommunity pick

    自托管的抖音、TikTok、B 站数据采集与无水印视频下载 API,支持 AI agent 通过 MCP 调用与离线语音转文字,Docker 一键部署。| Self-hosted TikTok, Douyin & Bilibili scraper and no-watermark video downloader — async REST API, MCP server for AI agents, CLI and web console, plus offline speech-to-text for downloaded videos. Self-healing identity pool, PostgreSQL archive, one docker compose up.

    Upvotes: 0Installs: 0GitHub stars: 21k
    Install
  4. Why it’s hereCommunity pick

    x402 pay-per-call infra for agents: $0.03 image generation, Postgres, auth, storage, functions.

    Upvotes: 0Installs: 0GitHub stars: 24
    Install
  5. Why it’s hereCommunity pick

    SQL database to MCP tools and REST API: PostgreSQL, MySQL, SQL Server, Oracle, SQLite, Snowflake.

    Upvotes: 0Installs: 0GitHub stars: 167
    Install
  6. Robrain logo

    #6 Robrain

    adelinamart

    Why it’s hereCommunity pick

    Self-hosted decision memory for AI coding agents. Passively captures architectural decisions with the alternatives you rejected (structured rejected[]), then warns the agent before it re-proposes a rejected approach. Postgres + pgvector; cross-tool across Claude Code, Cursor, Copilot, and Codex. Install: npx robrain up && npx robrain install.

    Upvotes: 0Installs: 0GitHub stars: 88
    Install
  7. Why it’s hereCommunity pick

    MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.

    Upvotes: 0Installs: 0GitHub stars: 24
    Install
  8. Why it’s hereCommunity pick

    Self-hosted workspace for browsing and querying databases (Postgres, MySQL, SQLite, MongoDB, Redis and more), with an MCP server for agents.

    Upvotes: 0Installs: 0GitHub stars: 5k
    Install
  9. Why it’s hereCommunity pick

    PostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants

    Upvotes: 0Installs: 0GitHub stars: 10
    Install
  10. Why it’s hereCommunity pick

    PostgreSQL schema intelligence from a committed snapshot. No connection, no credentials.

    Upvotes: 0Installs: 0GitHub stars: 36
    Install

Which PostgreSQL MCP server should you use?

The official modelcontextprotocol/server-postgres and crystaldba/postgres-mcp are the two most widely deployed Postgres servers — both cover schema introspection and querying, and crystaldba/postgres-mcp additionally ships EXPLAIN-based query analysis, which is useful if you want the agent to help diagnose slow queries rather than just run them.

Connect with a read-only role first (`GRANT SELECT ON ALL TABLES IN SCHEMA public TO ...`). If you later want the agent to write, most Postgres servers gate that behind an explicit flag or a separate write-capable connection string — treat that as a deliberate opt-in, not the default.

For managed Postgres (Supabase, Neon, RDS), use the connection string your provider issues for a scoped/read replica role if one is available, rather than the primary admin connection string.

Frequently asked questions about PostgreSQL MCP servers

What is the best Postgres MCP server?

The official modelcontextprotocol/server-postgres and crystaldba/postgres-mcp are the most widely installed. This page ranks Postgres MCP servers by real usage across the AllMCPs directory so you can start with a proven one.

Can a Postgres MCP server write to my database?

Some support writes, but most default to read-only for safety. Connect with a least-privilege role scoped to only the tables the agent needs, and enable write mode explicitly if the server offers it.

How do I connect Claude to Postgres?

Install a Postgres MCP server in your client config, pass your connection string via an environment variable, and restart the client. Each listing links to its exact setup steps.