Configuration Priority
DBHub resolves configuration in this order (highest to lowest priority):- Command-line arguments (highest priority)
- TOML config file (
--configor./dbhub.toml) - Environment variables
.envfiles (.env.localin development,.envin production)
Command-line arguments override all other configuration sources, making them ideal for testing or temporary changes.
Database Connection
DSN Connection String
The--dsn flag accepts a full database connection string:
Database connection string in URL format. Supports all database types.Format:
protocol://[user[:password]@]host[:port]/database[?options]DSN Examples by Database Type
Demo Mode
Launch DBHub with an in-memory SQLite database pre-populated with sample employee data. Perfect for testing and exploration.
- Creates an in-memory SQLite database
- Pre-loads sample employee data (employees, departments, salaries)
- Requires no additional configuration
- Data is lost when the server stops
Transport Configuration
Transport Mode
MCP server transport protocol.Options:
stdio- Standard input/output (for Claude Desktop, Claude Code, Cursor)http- HTTP transport with JSON responses (for network clients)
stdio mode: Direct communication via standard input/output. Use with Claude Desktop, Claude Code, and Cursor.http mode: RESTful API at
http://localhost:8080/mcp. Includes the workbench UI for testing tools.HTTP Server Port
HTTP server port number. Only applicable when using
--transport=http.- MCP endpoint:
http://localhost:{port}/mcp - Workbench UI:
http://localhost:{port}/ - API endpoints:
http://localhost:{port}/api/*
SSH Tunnel Options
Connect to databases through SSH bastion hosts:SSH server hostname or IP address. Can be an alias from
~/.ssh/config.SSH server port number.
SSH username for authentication.
SSH password authentication. Use either this or
--ssh-key.Path to SSH private key file. Use either this or
--ssh-password.Supports ~/ expansion (e.g., ~/.ssh/id_ed25519).Passphrase for encrypted SSH private key.
Comma-separated list of jump hosts for multi-hop SSH connections.Format:
[user@]host[:port],[user@]host[:port],...Seconds between SSH keepalive packets. Set to 0 to disable.
Maximum number of missed keepalive responses before disconnecting.
SSH Tunnel Examples
Advanced Options
Custom Config File
Path to TOML configuration file. If not specified, DBHub looks for
./dbhub.toml in the current directory.Source ID (Single Database Only)
Custom identifier for the database source. Only applicable when using
--dsn (not with TOML config).Affects tool naming: execute_sql_{id}, search_objects_{id}Deprecated Options
The following flags have been removed and will cause an error if used:SSL/TLS Options
SSL mode is specified in the DSN query string:sslmode=disable- No SSL encryptionsslmode=require- SSL encryption without certificate verification
SSL options are only applicable to network databases (PostgreSQL, MySQL, MariaDB, SQL Server). SQLite does not support SSL.
Complete Example
Combining multiple options:- Connects to PostgreSQL with SSL required
- Routes through SSH bastion with key authentication
- Sends keepalive packets every 60 seconds
- Serves HTTP transport on port 8080
- Names tools
execute_sql_prodandsearch_objects_prod
Next Steps
Environment Variables
Configure via .env files for persistent settings
TOML Configuration
Set up multiple databases with advanced options