DBHub (Postgres) MCP server

OfficialBytebase2,867Config last verified Jun 1, 2026

A universal database MCP gateway that connects agents to Postgres (and others) via a DSN.

DBHub is Bytebase's universal database MCP server, and it is the recommended Postgres option now that the legacy @modelcontextprotocol/server-postgres package is archived. You point it at a database with a standard DSN and it exposes a small, safe surface: execute SQL with transaction support and safety controls, and explore schema, tables, columns, indexes, and procedures with progressive disclosure so the agent does not have to swallow an entire schema at once. The same server speaks PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite, which keeps one integration across a mixed stack.

It runs over stdio via npx with a --transport stdio flag and a --dsn pointing at your Postgres instance, and it can also run as an HTTP service. Custom, parameterized SQL operations can be predefined in a dbhub.toml file so common queries become first-class tools rather than free-form SQL.

Quick install

Copy-paste configs are provided for all 8 supported clients. Pick your client below.

Add to ~/.claude.json

~/.claude.json
json
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@bytebase/dbhub",
        "--transport",
        "stdio",
        "--dsn",
        "postgres://user:password@localhost:5432/dbname"
      ]
    }
  }
}
Or via CLI
bash
claude mcp add postgres -- npx -y @bytebase/dbhub --transport stdio --dsn postgres://user:password@localhost:5432/dbname

Available tools

ToolDescription
execute_sqlExecutes SQL queries with transaction support and safety controls.
search_objectsSearches and explores schemas, tables, columns, indexes, and procedures with progressive disclosure.

What you can do with it

Query Postgres from an agent

Pass a DSN and let the agent answer data questions or draft migrations against a real Postgres database with transaction-aware SQL.

One server for a mixed stack

A team running Postgres alongside MySQL or SQLite uses a single DBHub integration instead of a different MCP server per engine.

FAQ

Is it free?
Yes. DBHub is open source under the MIT license and free to run.
Does it support remote/OAuth?
It can run as an HTTP service in addition to local stdio, but authentication is via the database DSN you supply, not OAuth.
← Browse all databases servers