- Command-line arguments (highest priority)
- TOML configuration file (if
--configis provided or./dbhub.tomlexists) - Environment variables
.envfiles (.env.localin development,.envin production)
—transport
Transport protocol for MCP communication.Options:
stdio- For desktop tools (Claude Desktop, Claude Code, Cursor). Pure MCP-over-stdio with no HTTP server.http- For browser and network clients. Starts HTTP server with MCP endpoint, admin console, and API.
| Feature | stdio | http |
|---|---|---|
| MCP communication | stdin/stdout | HTTP POST /mcp |
| Admin console | ❌ | ✅ http://host:port/ |
| Health check | ❌ | ✅ /healthz |
| API | ❌ | ✅ /api/xxx |
| Multiple instances | ✅ No port conflicts | Requires different ports |
—port
HTTP server port. Only used when
--transport=http. Ignored for stdio transport.—dsn
Database connection string (Data Source Name). Format: DSN Query Parameters:
SSL/TLS Options:
database_type://username:password@host:port/database_name?options- PostgreSQL
- MySQL
- MariaDB
- SQL Server
- SQLite
| Parameter | Databases | Description | Example |
|---|---|---|---|
sslmode | PostgreSQL, MySQL, MariaDB, SQL Server | SSL mode: disable, require | ?sslmode=require |
instanceName | SQL Server | Named instance | ?instanceName=SQLEXPRESS |
authentication | SQL Server | Auth method: ntlm, azure-active-directory-access-token | ?authentication=ntlm |
domain | SQL Server | Windows domain (with authentication=ntlm) | ?domain=CORP |
| Database | sslmode=disable | sslmode=require | Default |
|---|---|---|---|
| PostgreSQL | ✅ | ✅ | Certificate verification |
| MySQL | ✅ | ✅ | Certificate verification |
| MariaDB | ✅ | ✅ | Certificate verification |
| SQL Server | ✅ | ✅ | Certificate verification |
| SQLite | ❌ | ❌ | N/A (file-based) |
sslmode=disable: All SSL/TLS encryption is turned off. Data is transmitted in plaintext.sslmode=require: Connection is encrypted, but the server’s certificate is not verified.
Recommended for databases with complex passwords containing special characters:
| Variable | Type | Description |
|---|---|---|
DB_TYPE | string | Database type: postgres, mysql, mariadb, sqlserver, sqlite |
DB_HOST | string | Database server hostname (not needed for SQLite) |
DB_PORT | number | Database server port. Default: PostgreSQL (5432), MySQL/MariaDB (3306), SQL Server (1433) |
DB_USER | string | Database username (not needed for SQLite) |
DB_PASSWORD | string | Database password (not needed for SQLite). Supports special characters without URL encoding. |
DB_NAME | string | Database name or SQLite file path |
—id
Instance identifier to suffix tool names. Useful when running multiple DBHub instances (e.g., in Cursor).Tools will be named Result:
execute_sql_{id} for each instance.execute_sql_prod and execute_sql_staging tools—demo
Run DBHub with a bundled SQLite sample “employee” database for testing.
—config
Path to TOML configuration file for managing multiple database connections and advanced configurations.Automatically loads See TOML Configuration for complete configuration reference including source options, tool options, SSH tunnels, and custom tools.
./dbhub.toml if it exists in the current directory.SSH Tunnel Options
SSH tunnel configuration for connecting to databases through bastion/jump hosts.| Option | Env | Type | Description |
|---|---|---|---|
--ssh-host | SSH_HOST | string | SSH server hostname or alias from ~/.ssh/config |
--ssh-port | SSH_PORT | number | SSH server port (default: 22) |
--ssh-user | SSH_USER | string | SSH username |
--ssh-password | SSH_PASSWORD | string | SSH password (for password auth) |
--ssh-key | SSH_KEY | string | Path to SSH private key file. Auto-detects ~/.ssh/id_rsa, ~/.ssh/id_ed25519, etc. if not specified |
--ssh-passphrase | SSH_PASSPHRASE | string | Passphrase for encrypted SSH key |
--ssh-proxy-jump | SSH_PROXY_JUMP | string | ProxyJump hosts for multi-hop SSH. Format: [user@]host[:port] (comma-separated for chains) |
- ProxyJump is automatically read from
~/.ssh/configwhen using SSH host aliases - ProxyCommand is not supported (requires shell execution). Use ProxyJump instead
- Path expansion for
~/is supported in file paths
Quick Reference
| CLI Option | Env | Type | Description |
|---|---|---|---|
--transport | TRANSPORT | string | Transport mode: stdio or http (default: stdio) |
--port | PORT | number | HTTP server port (http transport only, default: 8080) |
--demo | - | boolean | Use sample employee database |
--id | ID | string | Instance identifier for tool names |
--config | - | string | Path to TOML config file (default: ./dbhub.toml) |
--dsn | DSN | string | Database connection string (required unless using --demo or --config) |
| - | DB_TYPE | string | Database type |
| - | DB_HOST | string | Database hostname |
| - | DB_PORT | number | Database port (varies by type) |
| - | DB_USER | string | Database username |
| - | DB_PASSWORD | string | Database password |
| - | DB_NAME | string | Database name or SQLite file path |
--ssh-host | SSH_HOST | string | SSH server hostname |
--ssh-port | SSH_PORT | number | SSH server port (default: 22) |
--ssh-user | SSH_USER | string | SSH username |
--ssh-password | SSH_PASSWORD | string | SSH password |
--ssh-key | SSH_KEY | string | Path to SSH private key |
--ssh-passphrase | SSH_PASSPHRASE | string | SSH key passphrase |
--ssh-proxy-jump | SSH_PROXY_JUMP | string | ProxyJump hosts |