npm
# PostgreSQL example
npx @bytebase/dbhub \
--transport http \
--port 8080 \
--dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
Docker
Docker Run
Docker Compose
docker run --rm --init \
--name dbhub \
--publish 8080:8080 \
bytebase/dbhub \
--transport http \
--port 8080 \
--dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
When connecting to databases on your host machine from Docker, use host.docker.internal instead of localhost:--dsn "postgres://user:password@host.docker.internal:5432/dbname"
Verifying Installation
Test with Demo Mode
The demo mode includes a bundled SQLite sample “employee” database with tables for employees, departments, salaries, and more - perfect for testing!
# Start DBHub in demo mode
npx @bytebase/dbhub --transport http --port 8080 --demo
# In another terminal, test the MCP endpoint
curl http://localhost:8080/mcp
You should see a JSON response indicating the MCP server is running.
Test with Your Database
# Start DBHub with your database
npx @bytebase/dbhub \
--transport http \
--port 8080 \
--dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
# Test connection
curl http://localhost:8080/mcp