================== /// MCP /// /// DBH /// ================== [server:online] [protocol:ready]
dbhub
by bytebase
Universal database gateway implementing the Model Context Protocol (MCP) server interface. Lets MCP-compatible clients (Cursor, Claude, etc.) explore and query MySQL, PostgreSQL, MariaDB, SQL Server and SQLite databases.
1.0k
98
Open Source01
execute_sql
Execute one or more SQL statements (separated by semicolons) against the connected database
02
generate_sql
Generate SQL statements from a natural-language prompt
03
explain_db
Explain or describe database elements such as schemas, tables, columns, indexes or procedures
Installation
1. Prerequisites:
• Node.js ≥ 18 and npm ≥ 9 installed.
• A running instance of at least one supported database (MySQL, PostgreSQL, SQL Server or MariaDB) that the server can reach.
2. Clone the repository:
git clone https://github.com/bytebase/dbhub.git
cd dbhub
3. Install dependencies:
npm install # or: pnpm i / yarn install
4. Build the TypeScript sources:
npm run build
5. Configure the server (examples use environment variables):
# Common
MCP_PORT=3000 # Port the MCP server will listen on
MCP_LOG_LEVEL=info # debug|info|warn|error
# MySQL example
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=myuser
MYSQL_PASSWORD=mypassword
MYSQL_DATABASE=mydb
# PostgreSQL example
PG_URI=postgresql://user:pass@localhost:5432/dbname
# SQL Server example
MSSQL_URI=mssql://user:pass@localhost:1433/dbname
# MariaDB example
MARIADB_URI=mariadb://user:pass@localhost:3306/dbname
(Add only the variables for the engines you need.)
6. Start the MCP server:
npm run start # starts the compiled JS in dist/
# or for development hot-reload:
npm run dev # ts-node + nodemon
7. Verify:
Visit http://localhost:3000/health (or the port you set) to make sure the server responds with status OK.
Documentation
License: MIT License
Updated 7/30/2025