An open source MCP server that connects AI agents, IDEs and apps to databases with prebuilt tools or custom tool definitions.
bytebase/dbhub
A minimal, token-efficient MCP server that lets AI clients query and explore PostgreSQL, MySQL, SQL Server, Oracle, MariaDB and SQLite databases.
- Stars
- 3,689
- Forks
- 341
- Open issues
- 2
- Last commit
- 7 days ago
What is it?
DBHub is an MCP (Model Context Protocol) server that gives MCP-compatible clients such as Claude Desktop, Claude Code, Cursor and VS Code a single gateway to several SQL databases. It supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite, and can connect to multiple databases at once through TOML configuration.
By default it exposes just two tools, execute_sql and search_objects, which the project says load at about 1.4k tokens to keep the context window free. Opt-in extras include explain_sql and health_check, plus custom parameterized SQL tools defined in a dbhub.toml file. A built-in web workbench lets users run queries and tools without an MCP client.
Safety options include read-only mode, row limits, query timeouts, SSH tunneling and SSL/TLS encryption. It runs via npx, Docker, an MCP Bundle or a Claude Code plugin, and requires Node.js 22.5 or later.
Key features
- 01Two default MCP tools (execute_sql and search_objects) to keep token usage low.
- 02Supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite through one interface.
- 03Connects to multiple databases simultaneously via TOML configuration.
- 04Read-only mode, row limits and query timeouts as guardrails.
- 05SSH tunneling and SSL/TLS encryption for secure connections.
- 06Built-in web workbench for running queries and custom tools.
Use cases
- Exploring schemas and debugging data from Claude Code, Cursor or VS Code during local development.
- Giving non-technical staff read-only access to curated data through an AI client.
- Replacing separate MCP servers with one process that covers several databases.
- Running read-only production diagnostics with protection against runaway queries.
Quick start
- 1
Start DBHub with npx, pointing it at your database DSN
npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable" - 2
Alternatively, run the Docker image (see the Docker installation section)
Things to know
- Requires Node.js 22.5.0 or newer for development builds.
Topics
FAQ
- What is dbhub?
- A minimal, token-efficient MCP server that lets AI clients query and explore PostgreSQL, MySQL, SQL Server, Oracle, MariaDB and SQLite databases. DBHub is an MCP (Model Context Protocol) server that gives MCP-compatible clients such as Claude Desktop, Claude Code, Cursor and VS Code a single gateway to several SQL databases. It supports PostgreSQL, MySQL, MariaDB, SQL Server, Oracle and SQLite, and can connect to multiple databases at once through TOML configuration.
- Is dbhub free to use? What license does it have?
- dbhub is open source under the MIT license. Check the license terms before using it in commercial products.
- Is dbhub still maintained?
- Actively maintained. The last commit to dbhub was on Oct 13, 2026.
- What can I use dbhub for?
- Exploring schemas and debugging data from Claude Code, Cursor or VS Code during local development. Giving non-technical staff read-only access to curated data through an AI client. Replacing separate MCP servers with one process that covers several databases. Running read-only production diagnostics with protection against runaway queries.
- How do I install dbhub?
- Start DBHub with npx, pointing it at your database DSN: npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable" Alternatively, run the Docker image (see the Docker installation section)
- Where can I get dbhub?
- The source code and installation instructions are on GitHub: https://github.com/bytebase/dbhub
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
AI-powered database client and MCP server for desktop and web, supporting Postgres, MySQL, MariaDB, SQL Server, ClickHouse and SQLite.
A free, local-first, AI-assisted database client and SQL workspace supporting 40+ databases across desktop, web, Docker and CLI.
Open-source embedding database for AI apps, storing documents and vectors to power semantic, hybrid and full-text search.
TypeScript framework for building AI agents with memory, tools, MCP, RAG, voice and workflows, plus the VoltOps console for observability.
Python framework for building autonomous AI agents that research, plan, code and run tasks, with memory, RAG and 100+ LLM providers.