Skip to content
MCP Shelf

DBHub MCP Server

One small server for Postgres, MySQL, MariaDB, SQL Server, Oracle and SQLite.

View on GitHub
  • Needs your setup first
  • ★ 3.7K GitHub stars
  • 17.1K downloads a week
  • Last commit 26 Oct 2026

What is DBHub?

DBHub is Bytebase's open source MCP server that lets AI assistants query PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite databases through one small, read-only-capable gateway.

Tools
2
Runs on
Your computer
Licence
MIT
GitHub stars
3.7K

Good for

  • Schema questions and query writing in a coding agent
  • One server for a project that uses more than one kind of database
  • Read-only access for people who should look but not change

You'll need

  • Node.js 22.5 or newer
  • A connection string (DSN) for your database

Needs your setup firstIt needs something our Linux test machine does not have (an account, a desktop app, a Mac or a running service), so on 27 Oct 2026 we listed its tools from its package instead of running this config.

MCP Shelf take

DBHub needs something our Linux test machine does not have (an account, an app or a service), so on 27 Oct 2026 we ran its package and counted 2 tools. 1 of the 2 only read; the other 1 can change things. Every tool comes with a useful description, all of them say whether they change things, and the tool list costs about 100 tokens of context before you ask a thing. It sits 3rd of 6 in its category on our shelf by GitHub stars (3.7K, with 17.1K downloads a week).
MCP Shelf tests: numbers from our own runs, not the README · tested on 27 Oct 2026

What can DBHub read and change?

It can read

  • Any table, view or object the database user can see

It can change

  • Rows and schema, through execute_sql, unless readonly is set in dbhub.toml

Safer setup: Connect as a database user with read rights only, and set readonly and max_rows in dbhub.toml. The database's own permissions are the real boundary.

DBHub in more detail

DBHub is Bytebase's deliberately small database server. By default it shows the model just two tools, one to run SQL and one to search the schema, so it costs far less context than servers with dozens of tools. A single process can hold connections to several databases at once through a TOML file, and you can add your own named, parameterised queries as extra tools.

For safety its config file can make a tool read-only, cap the rows returned and time out slow queries, and it can reach databases through an SSH tunnel. It also has a small web workbench for trying queries by hand.

Made by
Bytebase
Latest version
1.5.0 (9 Oct 2026)
npm package
@bytebase/dbhub
Downloads
17.1K a week
Last commit
26 Oct 2026
Setup checked
27 Oct 2026
Page updated
27 Oct 2026

What's in the pod

What tools does DBHub have?

We found 2 tools when we ran its package, before any sign-in or app was connected, on 27 Oct 2026. 1 only read. The rest can change things, so keep your app's "ask before each tool call" setting on for them.

How we tested it: Started @bytebase/dbhub 1.5.0 with --demo, its bundled sample SQLite database, because the placeholder DSN has no database behind it. These are the two default tools; explain_sql, health_check and your own custom tools appear only when you switch them on in dbhub.toml.

Runs commands1 tool · Can start programs or run code.

ToolWhat it is for
execute_sqlRuns SQL against a connected database, with transactions, row limits and read-only checks applied.

Only reads1 tool · Looks things up and changes nothing.

ToolWhat it is for
search_objectsSearches schemas, tables, columns, indexes and procedures, starting with names and going into detail only when asked.

Grouped and described by us. The README on GitHub lists the inputs each tool takes.

How clearly it describes its tools to your assistant

Tools with a description
2 of 2
Say if they change things
2 of 2
Context it takes, at least
~100 tokens

Every tool says whether it only reads or can change things, so a client can ask before the risky ones.

From the tool list it sent us. The token figure counts names, descriptions and input names; the full schemas your client loads add more.

How do I install DBHub?

Install steps from the DBHub README

The project's own instructions, copied from its README on GitHub on 27 Oct 2026 under its MIT licence. They are the source of truth; the ready-made configs further down are built from them. The rest of the README is in the README tab.

Installation

npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"

Also available as:

See the Installation Guide for all options, Command-Line Options for parameters, and Multi-Database Configuration for connecting several databases at once.

What you need first

  • Node.js 22.5 or newer
  • A connection string (DSN) for your database

Add DBHub to your app

Pick your app for a ready-to-paste snippet and where it goes, built from the steps above.

Where it goes: Your terminal, in the project folder

Claude Code
claude mcp add dbhub -- npx -y @bytebase/dbhub@latest --transport stdio --dsn postgres://user:password@localhost:5432/dbname

Bytebase also ships a Claude Code plugin; see dbhub.ai/claude-code-plugin. Put the DSN in quotes if the password has special characters, and URL-encode them.

Use "--demo" in place of --dsn to try it on a bundled sample database. Read-only mode, row limits and several databases are set in a dbhub.toml file passed with --config instead of --dsn.

Checked against the project's own install docs on 27 Oct 2026: bytebase/dbhub README, dbhub.ai/installation.

Did this work for you?

Projects change their install steps often. If DBHub did not install, or something here no longer matches the project, tell us and we will check it against the README and fix the page.

New to this? See the setup guides for Claude Code, Cursor, Claude Desktop, VS Code, Codex and ChatGPT. If it will not start, test it in MCP Inspector and look up the error in Fixing MCP server errors.

DBHub not working? Common fixes

It exits as soon as the client starts it
It could not reach the database in the DSN. Check the host, port and password, and add ?sslmode=disable for a local Postgres without TLS.
A special character in the password breaks the DSN
URL-encode it, for example @ as %40.
It will not start on an older Node
DBHub needs Node.js 22.5 or newer for its built-in SQLite support.
explain_sql or health_check is missing
They are off by default. Switch them on in dbhub.toml.

How do I configure DBHub?

Names are exactly as the project spells them. Required ones are marked.

SettingWhat it does
--dsnCommand line flag · requiredThe connection string, such as postgres://, mysql://, sqlserver://, oracle:// or sqlite:///path. Also read from DSN in env or a .env file.postgres://user:password@localhost:5432/dbname?sslmode=disable
readonlyConfigA per-tool option in dbhub.toml that only lets read statements through (SELECT, SHOW, DESCRIBE, EXPLAIN). It cannot be set on the command line.[[tools]] name = "execute_sql" source = "main" readonly = true
max_rowsConfigA per-tool option in dbhub.toml that caps how many rows a query returns.max_rows = 1000
query_timeoutConfigA per-source limit in dbhub.toml, in seconds, after which a query is stopped.query_timeout = 30
--configCommand line flagA dbhub.toml file for several databases, per-source limits, SSH tunnels, the optional tools and your own named SQL tools.--config ./dbhub.toml
--demoCommand line flagStarts with a bundled sample SQLite database instead of your own.
--transportCommand line flagstdio for clients that start it, or http with --port to serve it, together with the web workbench.--transport http --port 8080

DBHub FAQ

How do I add DBHub to Claude Code?

Run claude mcp add dbhub -- npx -y @bytebase/dbhub@latest --transport stdio --dsn followed by your connection string, or use --demo to try it on a bundled sample database first.

Which databases does DBHub support?

PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite, each through a standard connection string passed with --dsn or listed in dbhub.toml.

How do I make DBHub read-only?

Set readonly and max_rows in a dbhub.toml file passed with --config, and connect as a database user that can only read. The database's own permissions are the real boundary.

Is DBHub free?

Yes. It is MIT licensed. Bytebase sells a separate product with approval flows and audit logs for larger teams, which DBHub does not need.

Why does DBHub have only two tools?

To keep context small: Bytebase measures about 1,400 tokens for the default set of execute_sql and search_objects. More tools can be turned on in dbhub.toml when you need them.

Can DBHub connect to several databases at once?

Yes. List them as sources in dbhub.toml, and each tool then takes the source you want to query.

Why won't DBHub start?

It needs Node.js 22.5 or newer, and a password with special characters can break the DSN. Upgrade Node, quote the DSN and URL-encode characters such as @ or #.

DBHub or Postgres MCP Pro?

DBHub covers six database engines with a deliberately small tool set. Postgres MCP Pro is PostgreSQL only but adds index tuning and health checks, so pick by whether you need breadth or Postgres depth.

DBHub README

This is the project's own README from bytebase/dbhub, written by Bytebase, and shared under its MIT licence. We copied it on 27 Oct 2026, so the version on GitHub may be newer.

Note:
If you need an enterprise-level database MCP server with built-in guardrails like approval flow, access control, data masking, and audit logging beyond what DBHub offers, check out Bytebase.

DBHub Logo

            +------------------+    +--------------+    +------------------+
            |                  |    |              |    |                  |
            |  Claude Desktop  +--->+              +--->+    PostgreSQL    |
            |                  |    |              |    |                  |
            |  Claude Code     +--->+              +--->+    SQL Server    |
            |                  |    |              |    |                  |
            |  Cursor          +--->+    DBHub     +--->+    Oracle        |
            |                  |    |              |    |                  |
            |  VS Code         +--->+              +--->+    SQLite        |
            |                  |    |              |    |                  |
            |  Copilot CLI     +--->+              +--->+    MySQL         |
            |                  |    |              |    |                  |
            |                  |    |              +--->+    MariaDB       |
            |                  |    |              |    |                  |
            +------------------+    +--------------+    +------------------+
                 MCP Clients           MCP Server             Databases

DBHub is a minimal MCP server: token-efficient, zero-dependency, and just two tools by default with opt-in extras. This lightweight gateway allows MCP-compatible clients to connect to and explore different databases:

  • Minimal: Zero dependency, token efficient with a minimal set of MCP tools to maximize context window
  • Multi-Database: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, and SQLite through a single interface
  • Multi-Connection: Connect to multiple databases simultaneously with TOML configuration
  • Guardrails: Read-only mode, row limiting, and query timeout to prevent runaway operations
  • Secure Access: SSH tunneling and SSL/TLS encryption

DBHub is the official example in the Claude Code docs for connecting to PostgreSQL via MCP.

Token Efficiency

DBHub loads just 2 tools by default at 1.4k tokens — 13-14x fewer than alternatives — keeping the context window open for your actual work.

MCP Server Default Config Default Tools
DBHub 1.4k 2 (execute_sql, search_objects)
MCP Toolbox 19.0k 28
Supabase MCP 19.3k all

Use Cases

  • Local Development: Schema exploration, query validation, and data debugging with Claude Code, VS Code, Cursor, etc.
  • Non-Technical Access: Expose curated, read-only views to non-technical staff via Claude Desktop, VS Code, Cursor, etc.
  • Multi-Database Consolidation: Replace separate MCP servers for each database with a single DBHub process
  • Production Troubleshooting: Read-only diagnostics with guardrails against runaway queries

Supported Databases

PostgreSQL, MySQL, SQL Server, MariaDB, Oracle, and SQLite.

MCP Tools

DBHub implements MCP tools for database operations:

  • execute_sql: Execute SQL queries with transaction support and safety controls
  • search_objects: Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure
  • explain_sql (opt-in): Show a query's execution plan without running it
  • health_check (opt-in): Report connection pool state and buffer cache hit ratio
  • Custom Tools: Define reusable, parameterized SQL operations in your dbhub.toml configuration file

Workbench

DBHub includes a built-in web interface for interacting with your database tools. It provides a visual way to execute queries, run custom tools, and view request traces without requiring an MCP client.

workbench

Installation

npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"

Also available as:

See the Installation Guide for all options, Command-Line Options for parameters, and Multi-Database Configuration for connecting several databases at once.

Development

Requires Node.js >= 22.5.0 (DBHub uses the built-in node:sqlite module).

# Install dependencies
pnpm install

# Run in development mode
pnpm dev

# Build and run for production
pnpm build && pnpm start --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"

See Testing and Debug.

Contributors

Star History

Two peas, one chat

Chat with AI about DBHub

Opens a chat primed with DBHub’s README and setup docs from this page, or add it in Cursor to use its tools.

The Cursor button opens Cursor and asks before it adds the server. Fill in any keys it needs in Cursor’s MCP settings.

Peas in a pod

What are the alternatives to DBHub?

How DBHub lines up against its neighbours on the shelf. See every databases and data server.

  • DBHubThis pea

    One small server for Postgres, MySQL, MariaDB, SQL Server, Oracle and SQLite.

    Tools
    2
    Runs on
    Your computer
    Licence
    MIT
    Stars
    3.7K
  • Postgres MCP Pro

    SQL, query plans, health checks and index advice for Postgres.

    Tools
    9
    Runs on
    Your computer
    Licence
    MIT
    Stars
    3.4K
  • Supabase

    Manage Supabase projects, tables, migrations, logs and Edge Functions.

    Tools
    29
    Runs on
    Hosted
    Licence
    Apache-2.0
    Stars
    3K
  • MCP Toolbox for Databases

    Google's toolbox for Postgres, MySQL, BigQuery, Spanner and other databases.

    Tools
    29
    Runs on
    Your computer
    Licence
    Apache-2.0
    Stars
    16.7K
  • Qdrant

    Store notes and find them by meaning in a Qdrant vector collection.

    Tools
    2
    Runs on
    Your computer
    Licence
    Apache-2.0
    Stars
    1.6K
  • Excel MCP Server

    Create, edit, format and chart .xlsx files, no Excel needed.

    Tools
    46
    Runs on
    Your computer
    Licence
    MIT
    Stars
    4.3K
Full docs on GitHubbytebase/dbhub

Something wrong on this page? Tell us.

For bots & AI agents

Machine-readable versions of DBHub and MCP Shelf. Fetch these instead of parsing this page.

This listing (.md)llms.txtllms-full.txtai.txtFull catalog (.md)API specMCP serverMCP manifestDeveloper docs