DBHub — two tools and one connection string, and your assistant asks your database
DBHub is a small MCP server that gives your assistant access to six different databases with one setup and only two tools, so it keeps its head free for the work you care about. In our test it started without a database, without an account, and without a key, answered correctly, and when we asked for a table that did not exist, the error came back as a response rather than a crash.

What it does
Nine articles in this column have passed through code tools, security checks, library knowledge, and workflows. None of them touched the data. This tenth one shows the simplest and the hardest thing at once: how your assistant reaches your real data.
A database is the program that keeps the facts of your work in rows: customers, orders, payments, salaries. It is not a text file. It is a service with its own language, SQL, and its own access rights. When you say “I want the customers who did not pay,” someone has to write that query correctly.
The term MCP means “a protocol for connecting tools to an assistant.” Think of a socket. Your assistant has one port, and every tool that fits that port gives it new abilities. The MCP server is the device that plugs into the socket.
DBHub is one such MCP server, and it does one job: it connects your assistant to six different databases — PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite — through the same interface. The maker says it is minimal, and means something specific: instead of twenty-eight tools that fill up the assistant’s memory before you even ask, this one exposes two (execute_sql and search_objects).
Those two tools do this. search_objects looks through the database structure: which tables exist, which columns they have. execute_sql runs the query. There is no third, fourth, or fifth tool to remember.
How does it connect? With a connection string, called a DSN (Data Source Name) in the field. It is one line that says everything in order: what kind of database it is, which user you enter with, on which machine, on which port, in which database. See the shape:
postgres://user:password@localhost:5432/mydb
Read it as: PostgreSQL, user user, password password, machine localhost, port 5432, database mydb. If you have worked with databases, you know it. If not, this one line is the whole setup.
What it does not do
Its boundary is one thing: do not expect it to act as a bridge between the assistant and the database. It only exposes two commands: search_objects and execute_sql. It does not transform data, it is not an ETL tool, and it does not read spreadsheets or NoSQL stores. Do not ask it to load CSV, merge sources, or build analytics tables — you will just see the SQL statement and the result the database returns.
It does not replace a DBA. It does not optimize queries, it does not suggest clever indexes, and it does not run guarded migration or schema-diff processes. The readonly flag limits what it can do, but by itself it is not full security: if you give a wrong DSN or turn readonly off, the assistant can write. The word filters are not flawless either — complex SQL constructions or functions can get around them.
It does not handle secrets, auditing, or result visualization. We ran it for quick questions and checks. If you want a full data-ops platform with governance and dashboards, DBHub will not cover your needs.
Who it is for
For anyone who has data in a database and spends the day asking it by hand.
If you open a database manager and write queries yourself, or if you message the developer for a simple “how many customers bought this month,” this tool is for you. You ask your assistant, it checks the structure, writes the query, and gives you the results.
It is also useful for a second, quieter job: verification. You have a program that fills the database. You want to know whether it wrote what it should. You ask instead of opening the tool and searching.
It is also useful for anyone with many databases. Instead of setting up a separate server for each one, one setup holds them all together, and each source name sits next to the tool name. The maker says this in the documentation, and we did not test it ourselves with many databases together.
It makes no sense if your data lives in spreadsheets. SQL is not the strong point there, and DBHub does nothing about that.
Installation
The package is called @bytebase/dbhub, lives on npm, and the stable release is 1.5.0, published on October 9, 2026. Its license is MIT, one of the freest there is: you can use it in commercial work without having to hand over your own code. It is written in TypeScript, by Bytebase.
It needs Node on the machine, version 22.5.0 or newer, because it relies on Node’s built-in SQLite support. Check what you have, from any folder you like:
node --version
Before you touch your own database, try it without one. DBHub has a demo mode with its own sample data, which asks for no account and no key:
npx -y @bytebase/dbhub@latest --demo --transport stdio
We run that below and show what it answers. --transport stdio means the server talks to the client through terminal input and output, with no network. It is the default, and we write it here so it is clear.
For your real database, the one line is this:
npx @bytebase/dbhub@latest --transport stdio --dsn "postgres://user:***@localhost:5432/mydb"
If you have more than one database, or if you want per-tool settings, you do it with a TOML file passed with --config. --dsn and --config do not combine, you choose one. Passwords stay out of the file in the form ${VAR}, which is the method the documentation recommends.
This is where the setting that matters comes in, and I will explain why immediately. The repository only makes sense if you know what you allow, so readonly is the first thing you write:
[[tools]]
name = "execute_sql"
source = "production"
readonly = true
With this readonly = true, your assistant asks, it does not touch. The documentation says the restriction applies at two levels: every statement goes through an allowlist check, and the database itself enters read-only mode. The switch could just as well be false, and then your assistant gains the right to delete a table with one bad moment. You choose, but now you know that you are choosing.
Use in each LLM
DBHub is an MCP server, so the command you give is the same in every program. What changes is where the configuration goes. One note that applies to all of them: DBHub is the official example in Claude Code’s documentation for connecting to PostgreSQL, which is a recommendation in itself.
Claude Code
The configuration lives in a JSON file named .mcp.json, inside the project folder. Its content is this:
{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": ["-y", "@bytebase/dbhub@latest", "--transport", "stdio", "--dsn", "postgres://user:password@localhost:5432/mydb"]
}
}
}
Put your own connection string in place of the example. Then open Claude Code in the project folder. It will see the configuration, connect the server, and from there you can ask it “show me the database structure” or “how many customers were created last month.”
Codex CLI
In Codex CLI the configuration is not JSON. It is written in a TOML file named config.toml, inside the .codex folder of your profile. The setting is this:
[mcp_servers.dbhub]
command = "npx"
args = ["-y", "@bytebase/dbhub@latest", "--transport", "stdio", "--dsn", "postgres://user:password@localhost:5432/mydb"]
The command inside is exactly the same, only the file shape changes, because Codex reads TOML.
Cursor
In Cursor the configuration goes into a file named mcp.json, inside the .cursor folder of the project:
{
"mcpServers": {
"dbhub": {
"command": "npx",
"args": ["-y", "@bytebase/dbhub@latest", "--transport", "stdio", "--dsn", "postgres://user:password@localhost:5432/mydb"]
}
}
}
Same shape as Claude Code, same command. Open Cursor and the server appears connected.
One honest note for the three above. We tested the server itself, through stdio, and saw exactly what it answers. We did not run all three clients from start to finish. The file locations are the usual ones for each program. If something does not work for you, start there.
Where it wins, where it loses
It wins at the simplest point, and that is not a small thing. One setup, two tools, six databases. You do not learn a new tool every time the database changes.
It wins in how little space it wastes. Your assistant has limited room for what you give it, and every tool you load takes some of that room. The maker states in the documentation that DBHub’s two tools cost about 1.4k tokens instead of 19k and twenty-eight tools in other packages. That is the maker’s claim, from the repository page, not our measurement. We are carrying it over as such.
It wins at the most practical thing of all: errors come back as data. When we asked for a table that does not exist, the agent did not fall over. It got back a clean error message with a code. That means your assistant can correct itself, because it sees what went wrong instead of getting stuck.
It also wins in its health. The repository at github.com/bytebase/dbhub has 3,643 stars and 318 forks, was last updated yesterday, October 13, 2026, and is not archived. On npm it records 178,238 downloads in the last month. That is a tool in use, not an experiment.
Now the parts that hurt, and I will say all of them.
First, the two tools are at once a choice and a limit. It does not give you a ready table catalog with descriptions. Your assistant has to explore the structure first and only then ask questions. If it rushes and fires a query blind, it will get an error. The maker knows this, which is why it gives its own skill that teaches the right order — first the schema, then the query. We found it in the repository, in the skills folder, and you add it with one command:
npx skills add bytebase/dbhub
Second, on SQL Server there is no integrated security. In other words, you cannot enter with your Windows account without a password, the way Microsoft tools do. The documentation says it plainly: the driver is pure JavaScript and does not have Kerberos, so it needs a name and password, or Azure AD. Anyone coming from Windows tools will hit that, and it is better to know before, not after.
Third, and this needs care. If you start DBHub with HTTP transport, with no extra configuration it listens on every interface of the machine — the default address is 0.0.0.0, which we saw in the parameter documentation. That means if you are on a network, your database is open to anyone who finds the port. The documentation warns about this itself and suggests limiting the address and adding a key:
npx @bytebase/dbhub@latest --transport http --host 127.0.0.1 --port 8080 --auth-token "s3cr3t-token" --dsn "postgres://user:password@localhost:5432/mydb"
The key it asks for is a shared secret, not a user identity. The documentation says that too, in its own words. It is not a role-based system with history; it answers only the question of “do you have the secret or not.”
Fourth, the repository is quiet. Two open issues in 3,643 stars means many people use it without asking much. My estimate: many run it without trouble, and whatever stops you you will solve yourself by reading the code. That is not bad for this kind of tool, but you should know what you are taking.
Fifth, and I say it here too because it is the most important part: all of the above is controlled by readonly. DBHub can be the assistant that explores your database, or the assistant that changes its data. The difference is not another tool, not another package, not another license. It is one line in the configuration file. Put the real one in before you let your assistant inside.
Test
It really ran, on this machine, Windows 11, with Node 26.7, and with no database set up anywhere, using demo mode.
I started the server through stdio with “npx -y @bytebase/dbhub@latest –demo –transport stdio”. On the first message, the initialize, it answered that it is the DBHub MCP Server, version 1.5.0, with protocol 2025-06-18. Startup took about two seconds, because it does not build anything before answering.
I asked for the list of tools. It returned exactly two: execute_sql and search_objects. Not one more.
Then I asked search_objects for the tables with type “table.” It returned six, the sample tables: department, dept_emp, dept_manager, employee, salary, title. In other words, the assistant really sees the structure, it does not guess it.
Third, I asked for data with execute_sql, the query “SELECT * FROM department LIMIT 3”. The response was success: true and three rows: Marketing, Finance, Human Resources. Clean data, in a structure the assistant reads without effort.
The fourth part is the one that matters most, and we saw it in practice. I asked for a table that does not exist: “SELECT * FROM employees LIMIT 3”. The server did not crash, and it did not close the connection. It returned this:
{"success": false, "error": "no such table: employees", "code": "EXECUTION_ERROR"}
That means the error is data. The agent reads it, understands what it did wrong, and corrects itself on the next move. That is the difference between an assistant that works and one that leaves you guessing why it froze.
What did not run on our side. I did not set up a real PostgreSQL database, so anything I wrote about the DSN and the six systems comes from the maker’s documentation, which I read, not from our own connection. I did not test TOML with multiple sources, nor HTTP transport with a key, nor the readonly mode in practice. I did not put the server inside the three clients all the way through. Everything that did run ran in demo mode, and the numbers I give for the repository and downloads I pulled today from GitHub and npm.
Verdict
DBHub takes a hard job and turns it into one line of configuration. One DSN, two tools, and your assistant reads your database — any one of the six.
The strongest part is not that it is small. It is that errors come back as data. The assistant does not fall; it corrects itself. And it is the official Claude Code example for PostgreSQL, which means someone at Anthropic read the code and approved it.
The objections are serious, and you know them now. On SQL Server you do not enter with the Windows account. In HTTP transport it listens on every interface unless you tell it otherwise. And it needs Node, and a fairly new one at that.
None of that touches the core, because the core is a tool that does the minimum correctly — and the minimum is exactly what you want when you are speaking to the database that runs your work. Start with demo mode, set readonly = true before touching production, and then let it in.
Score: 8.6/10.
See also
In the same category, we also tested:
- ty: Astral’s type checker that catches the mistake before it runs
- cf: Cloudflare’s new CLI that does not guess flags
- ast-grep: the grep that understands code, not text
Sources:
https://github.com/bytebase/dbhub
https://www.npmjs.com/package/@bytebase/dbhub
https://dbhub.ai/config/command-line
https://dbhub.ai/tools/execute-sql
https://code.claude.com/docs/en/mcp
https://github.com/bytebase/dbhub/blob/main/skills/dbhub/SKILL.md
Εγκατάσταση
4 ΒΗΜΑΤΑ- npx -y @bytebase/dbhub@latest --demo --transport stdio
- npx @bytebase/dbhub@latest --transport stdio --dsn "postgres://user:***@localhost:5432/mydb"
- npx skills add bytebase/dbhub
- npx @bytebase/dbhub@latest --transport http --host 127.0.0.1 --port 8080 --auth-token "s3cr3t-token" --dsn "postgres://user:password@localhost:5432/mydb"