
DBHub MCP Server: Setup for Claude, Cursor and Other Apps
Not the official PostgreSQL MCP server. This one is built by the community. PostgreSQL makes its own: MCP Toolbox for Databases →
Lets Claude, Cursor and other assistants explore your database and run SQL on PostgreSQL, MySQL, MariaDB, SQL Server, Oracle or SQLite.
This is a community server from Bytebase, not from a database vendor. It runs on your computer and connects with a database connection string that you give it. It loads only two tools by default, one to run SQL and one to look around the schema.
By default it can change data, because the SQL tool runs whatever it is given. To make it read-only, use the config file or the one-click bundle, which the docs say is read-only by default.
Good for
- Developers who want the assistant to inspect a schema and write queries
- Teams who keep one server for several databases
- Support and ops staff who need read-only access to production data
- Anyone tired of tool lists that fill the assistant's memory
Works in
12 should work
Tap an app to see how to set it up and any known problems.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Supports local MCP servers.
Client does not support this transport.
Client does not support this transport.
Install DBHub MCP
Claude Code
- 1
Copy this prompt.
Add the DBHub MCP server to Claude Code. Run this command: claude mcp add dbhub -e DSN=<DSN> -- npx -y @bytebase/dbhub Ask me for DSN and only put the values in that config, nowhere else. Then check that it loaded and tell me if I need to sign in or restart.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
Built from the package data we hold. Not yet tested by us.
Tools
Runs SQL statements on your database
Runs one or more SQL statements, including inserts, updates and deletes, and can wrap them in a transaction. It can be limited to read-only queries and a row cap in the config file.
Try: “Show the 10 most recent signups from the users table.”
Delete ·
execute_sqlFinds schemas, tables, columns, indexes and procedures
Searches the database structure by name pattern, from a short list of names up to full details. It returns only as much as you ask for, to save space.
Try: “Which tables have a column named customer_id?”
Read ·
search_objectsShows how the database would run a query, without running it
Returns the execution plan for one SQL statement and never executes it. It is off by default and must be turned on in the config file.
Try: “Explain the plan for this slow join.”
Read ·
explain_sqlReports connection counts and cache hit ratio
Shows how many sessions are open, idle or stuck, and how often reads come from cache. It works on PostgreSQL, MySQL, MariaDB, SQL Server and Oracle, and is off by default.
Try: “Is our Postgres connection pool close to its limit?”
Read ·
health_check
Read from the source code
Permissions
high risk · 3 things to watch · 3 advisories
High risk
It can read and change anything the database user can, including deleting rows or tables. Give it a read-only database user, and turn on read-only mode in the config file.
What it can do
- Read your data
- Create and change things
- Delete things
- Read-only modeHow to turn it on
Watch out for
It can change or delete data by default
The SQL tool runs any statement unless you set read-only mode in the config file. Connect with a database user that has only the rights you want the assistant to have. github.com
Network mode listens on every interface
With the HTTP transport, the default address is 0.0.0.0 and auth is off unless you set a token. Use a local address such as 127.0.0.1 or set a token. github.com
Password sits in the connection string
The database password is part of the DSN you put in your client config. Keep that file private, or use the config file with ${VAR} values. github.com
Security advisories
3 known advisories, all fixed in a newer version.
- DBHub HTTP transport DNS rebinding allows unauthenticated browser-origin SQL executioncritical · Fixed in 0.22.5 · GHSA-fm8p-53ww-hf6w
- Read-only mode can be bypassed on the MySQL and MariaDB connectors, allowing arbitrary writes and DDL (for example DROP TABLE) through a query that passes the read-only check. DBHub treats "--" as a…high · Fixed in 0.22.6 · GHSA-j656-3hf2-fvjc
- @bytebase/dbhub's read-only mode does not prevent database writeshigh · Fixed in 0.22.6 · GHSA-mwwr-p57h-56pf
Technical details
| Turning on read-only | Set readonly = true on the execute_sql entry in a TOML config file passed with --config. The old --readonly flag and READONLY variable are no longer supported. |
|---|---|
| Talks to | Your database host |
| Sign-in and keys | The database login sits in the connection string, which you pass as the DSN setting or a config file. DBHub does not store it. |
| Scopes |
|
Questions
Is DBHub official?
No for any database. DBHub is made by Bytebase, a database tooling company, and is not published by PostgreSQL, MySQL or the other databases. It ships from the project's own repository.
Which databases does it support?
PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite. You pick one with the connection string, or list several in a config file.
Can I make DBHub read-only?
Yes. Set readonly = true on the SQL tool in a TOML config file. The docs say the one-click bundle is read-only by default.
What do I need to run it?
Node.js 22.5 or newer, or Docker, and a connection string for your database. Put the connection string in the setting shown in the install box.
Does it use many tokens?
No. The README says it loads two tools by default, about 1.4k tokens, which it compares with servers that load about 19k.
Does it run locally or in the cloud?
Locally, on your computer, and it talks straight to your database. A network mode with a web interface also exists, for shared use.
Information
updated Nov 2, 2026
- Publisher
- Community
- Package
@bytebase/dbhub- Registry
- npm
- Transport
- stdio
- Auth
- token in env
- Version
- 1.5.0
- License
- MIT
- Last commit
- Oct 26, 2026
- Open issues
- 2
- Listed in
- Official MCP registry
Other PostgreSQL MCP servers
Sources
Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.
Show all 5Hide
- README.md · github.com
- overview.mdx · github.com
- command-line.mdx · github.com
- toml.mdx · github.com
- env.ts (rejects --readonly and READONLY) · github.com