Skip to content
Skillpedia
● Free and open sourceπŸ’» LocalπŸ”“ No API keyData and databases

DBHub

Lets your AI agent explore and query PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite with safe limits.

3.8k stars on GitHubby BytebaseLicense MITUpdated 20 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add dbhub -- npx -y @bytebase/dbhub

What to fill in

NameWhat it isRequired
DSNDatabase connection string (e.g., postgres://user:pass@host:5432/db)No
DB_TYPEDatabase type: postgres, mysql, mariadb, sqlserver, oracle, sqliteNo
DB_HOSTDatabase hostnameNo
DB_PORTDatabase portNo
DB_USERDatabase usernameNo
DB_PASSWORDDatabase passwordNo
DB_NAMEDatabase name or SQLite file pathNo
TRANSPORTTransport mode: stdio or httpNo
PORTHTTP server port (default: 8080)No
IDInstance identifier for tool namesNo
SSH_HOSTSSH server hostnameNo
SSH_PORTSSH server port (default: 22)No
SSH_USERSSH usernameNo
SSH_PASSWORDSSH passwordNo
SSH_KEYPath to SSH private keyNo
SSH_PASSPHRASESSH key passphraseNo
SSH_AUTH_SOCKPath to SSH agent socketNo

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Show me the tables in this database and their columns.
How many orders did we get last week, grouped by country?

What it is

DBHub is a small MCP server that connects your agent to one or more databases. It exposes just two tools by default to save on tokens, one to run SQL and one to explore the schema. It has guardrails such as read-only mode, row limits and query timeouts.

What it can do

  • execute_sql: run SQL queries with transaction support and safety controls
  • search_objects: explore schemas, tables, columns, indexes and procedures
  • explain_sql (opt-in): show a query plan without running it
  • health_check (opt-in): report connection pool state and cache hit ratio
  • Custom tools: your own reusable SQL operations set in dbhub.toml

When to use

  • β€ΊWhen you want your agent to explore a database schema while you build.
  • β€ΊWhen you want staff to ask questions about read-only data in plain words.
  • β€ΊWhen you want one server for several databases instead of one for each.

What you need

Node.js (to run it with npx) or Docker, and a connection string (DSN) for your database. A TOML file is used to connect several databases.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it free and open source?

Yes. It is open source. For enterprise guardrails like approval flow and audit logging, the readme points to Bytebase.

Which databases work?

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

Is it safe to use on production?

It has guardrails such as read-only mode, row limiting and query timeouts, plus SSH tunneling and SSL/TLS. Use read-only mode for production checks.

Can I connect more than one database?

Yes. Use TOML configuration for several connections at once.

Is there a visual interface?

Yes. There is a built-in web Workbench to run queries and view request traces without an MCP client.

What is the install command?

npx @bytebase/dbhub@latest with a transport, port and DSN. There are also a Docker image, an MCP Bundle and a Claude Code plugin.

If it does not work

  • β€ΊCheck that the connection string (DSN) has the right user, password, host and database name.
  • β€ΊBuilding from source needs Node.js 22.5.0 or newer.
  • β€ΊRestart your AI client fully after changing the config.

5 new skills a week. 1 minute to read.