Skip to main content
Glama
mr-mihu

dsh-dbhub-live

by mr-mihu

dsh-dbhub-live

Let DeepSeek Harness (DSH) operate databases directly and securely: persistent multi-source connections + per-workspace tools + ad-hoc dynamic connections.

License: MIT DSH DBHub

dsh-dbhub-live is a DSH plugin based on DBHub (a database MCP server) that lets models query databases directly: reuse persistent connections on configured workspaces, or temporarily connect to any database for one-off troubleshooting.

✨ Features

  • Persistent multi-source service — A single dbhub service in the background connects to multiple data sources simultaneously, reusing connections for faster queries.

  • Per-workspace toolsdbhub_execute_sql_<workspace> / dbhub_search_objects_<workspace>, tool names indicate the workspace, no confusion across workspaces, connections are clearly labeled (passwords masked).

  • Ad-hoc dynamic connectionsdbhub_query / dbhub_query_objects independently connect to any database each time, allowing parallel queries across different databases for cross-environment troubleshooting.

  • Out-of-the-box — Automatically installs dbhub on first use if not present, then keeps it updated automatically without manual intervention.

  • Multiple configuration methods — Explicit DSN / fill in fields / authorized scanning of project configuration files. Credentials are stored only in the local user directory, passwords are fully masked.

Related MCP server: mcp-ohmy-sql

Supported Data Sources

MySQL · PostgreSQL · MariaDB · SQLite · SQL Server

Requirements

  • DeepSeek Harness's dsh CLI (dsh web for GUI operation)

  • Node.js ≥ 18 (with npm) recommended on the local machine — dbhub will be installed automatically on first use

Installation

# 方式一:使用本机已安装的 dsh
dsh plugin --profile web add dsh-dbhub-live

# 方式二:通过 npx 调用 dsh(无需本机全局安装 dsh)
npx @deepseek-ai/dsh plugin --profile web add dsh-dbhub-live

Restart dsh web after installation for changes to take effect.

Quick Start

# 1) 为当前工作区配置数据库连接(三种方式任选其一)
dbhub_configure

# 2) 在已配置工作区的常驻连接上执行查询
dbhub_execute_sql_myapp  SELECT * FROM users LIMIT 10;

# 3) 临时连任意库做一次性排查
dbhub_query  dsn=mysql://root:pass@192.168.77.6:3306/tx_sd_jinengshu  sql="SHOW TABLES;"

Tools

Tool

Description

dbhub_configure(workspace?, dsn?)

Configure/persist a database connection for a workspace.

dbhub_execute_sql_<workspace>

Execute SQL on the persistent connection of the specified workspace.

dbhub_search_objects_<workspace>

Search database objects (tables/views/columns/indexes, etc.) in the specified workspace.

dbhub_query(dsn, sql)

Temporarily connect to any database and execute SQL (multiple statements separated by ;).

dbhub_query_objects(dsn, ...)

Temporarily connect to any database and search database objects.

Note: search_objects is only available for SQLite; for MySQL / PostgreSQL etc., use dbhub_query directly (e.g., SHOW TABLES).

Configuration Methods

  1. Explicit DSN — Provide a full connection string, e.g., mysql://user:pass@host:3306/db.

  2. Fill in fields — Fill in type / host / port / username / password / database name sequentially.

  3. Authorized scanning — After authorization, scan project configuration files (.env, application*.yml, docker-compose, jdbc.properties, etc.) and list candidates (passwords masked) for you to confirm.

If the workspace already has mise env or .env (DSN / DB_*), the plugin will auto-discover them without manual configuration.

🔄 dbhub Auto-Installation and Updates

  • Auto-install on first use: If dbhub is not present on the local machine, the plugin will install it automatically on the first query; it will then be available offline.

  • Auto-keep updated: Silently updates to the latest version in the background every 7 days; if it fails, the existing version is retained.

  • Does not touch your configuration: A dbhub installed manually via PATH / mise will not be modified by the plugin.

Environment Variable

Description

Default

DSH_DBHUB_PACKAGE

npm package name used for auto-installation

@bytebase/dbhub

DSH_DBHUB_UPDATE_DAYS

Auto-update interval in days; 0 disables

7

Data Location

All configurations and credentials are stored outside the module directory (unaffected by pnpm packaging). Delete this directory to completely clear everything:

~/.dsh/storages/dsh-dbhub-live/

Uninstallation

dsh plugin --profile web remove dsh-dbhub-live

Troubleshooting

Symptom

Action

First use reports "cannot get dbhub"

Ensure npm is available on the local machine and has internet access; offline, manually install dbhub and add it to PATH.

Tool shows "dbhub service unavailable"

Check dsh web logs; if the process exits abnormally, the plugin will automatically restart it on the next call.

Scanning finds no configuration files

By default, directories like node_modules / .git / target / dist are skipped. Use "Enter DSN" or "Fill in fields" instead.

Need a custom dbhub version

Delete ~/.dsh/storages/dsh-dbhub-live and set DSH_DBHUB_PACKAGE to specify the package/version.

Do not want automatic dbhub updates

Set the environment variable DSH_DBHUB_UPDATE_DAYS=0.

License

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP Database Server is a service that provides secure database access for AI assistants and LLM-based tools, supporting SQLite, PostgreSQL, MySQL and MariaDB, and featuring query verification, audit logs and security control functions.
    2
    Apache 2.0
  • -
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that bridges AI assistants with SQL databases, enabling natural language querying across multiple database types with built-in optimization and security.
    3
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A unified MCP server for querying and managing multiple database types (PostgreSQL, MySQL, SQL Server, etc.) via natural language through AI assistants.
    GPL 3.0