dsh-database: Role-Based Read-Only Database Queries in DSH

Preface

In DeepSeek Harness (DSH), common approaches to enabling Agents to answer business data questions include manually writing MCPs, stuffing connection strings into environment variables, or letting models concatenate SQL directly. This leads to scattered connections, difficulty in consolidating permissions, and structural exploration that often dumps entire database metadata into the context at once. The community plugin dsh-database (maintained by blkpne) takes a different path: it centralizes connection management in the Web interface. After authorization is granted per connection, the Agent first discovers table or collection structures and then executes read-only queries. The following sections introduce its positioning, capabilities, and getting started steps.

What is this

dsh-database is a “Networking Tool” class plugin for DSH: it manages database connections via a Web interface and exposes MCP tools for each connection, allowing Agents to explore structures and execute read-only queries within authorized scopes. It supports MySQL, MariaDB, PostgreSQL, SQL Server, Oracle, and MongoDB.

The project is hosted on GitHub: blkpne/dsh-database, with a directory page available at SkillHub. The current npm package version is 0.1.1, released under the MIT license. The plugin is designed with read-only data access as its boundary: it does not provide writing, result export, SQL history replay, or SSH tunneling; database accounts should also be configured as read-only.

Core Features

According to the official README, the plugin primarily offers the following capabilities:

  1. Connection Management: Fill in connection info, test authentication, and manage multiple database types within the same interface; credentials are saved by DSH, and TLS certificate verification is enabled by default for new connections.
  2. On-demand Structure Discovery: Search for tables, views, and collections, and view fields, constraints, and indexes without pre-loading the entire library definition.
  3. Controlled Agent Access: Agent access is disabled by default for connections; you can scope it to specific sessions, open only structure discovery, and set usage quotas.
  4. Observable Invocation: View diagnostics, duration, error stages, and cancellation status; invocation logs do not store SQL, parameters, or business rows.

Query results enter the Agent context; for the scope of data processing on the host session and model side, please refer to the Usage Guide in the repository.

Installation and Activation

The plugin runs with the DSH process. Before installation, please review the source code and license yourself, and confirm whether the current environment permissions are suitable for mounting production or test database connections.

Environment Requirements

  • Node.js: >=22.19.0 (see engines in package.json)
  • DSH: >=0.2.0-rc.2
  • For detailed compatibility, see docs/compatibility.md in the repository.

If DSH is not installed, you can install it globally first:

npm install --global @deepseek-ai/dsh@latest

For Windows PowerShell, use npm.cmd and dsh.cmd.

Installing the Plugin

If DSH is already installed, run the following command in the terminal to install the plugin to the web Profile. Please stop any running instances of this Profile before installing or updating:

dsh plugin --profile web add dsh-database@latest --ignore-scripts

This command downloads the pre-built plugin from npm; no need to clone the repository or build locally. Use the same command to update the plugin, then restart the Web service. If the installation prompts that pnpm is not found, run npm install --global pnpm@latest first and then retry.

Starting Web

dsh --profile web --host 127.0.0.1 --port 3080 --no-open

If the web Profile does not exist, DSH will initialize it. Open the login link printed in the terminal output; “Database” should appear in the sidebar. If it is your first time using DSH, follow the host prompts to complete model configuration.

Typical Usage: First Query

Following the steps above, you can complete the first connection and authorization according to the README:

  1. Open “Database”, create a connection, and fill in the accessible database address, database name, and a read-only account.
  2. Click “Test Current Configuration”, and save upon success. For private CA configurations, see TLS Connections in the usage guide.
  3. In “Authorization Rules”, select the access scope and save, then enable “Agent Access”.
  4. Ask questions in an authorized session, for example:

Using the “Business Analytics DB”, list the tables I can access. First look at the relevant fields, then count the number of orders, and explain which table was used.

Successful testing only indicates that the current configuration is connectable; it does not automatically save or enable Agent access. Query data and analysis conclusions are viewed within the Agent conversation; “Invocation Records” are used to check status, duration, and errors.

The official also provides a reproducible scenario: E-commerce Business Review—for example, when analyzing why order growth is rising while net revenue growth is slowing, the Agent can first use the plugin to understand the order and refund tables, aggregate by month and channel on the database side, and then combine with host files and execution tools to generate charts and suggestions. Synthetic data and operation steps are available at docs/examples/ecommerce/README.md.

Use Cases and Precautions

Who it is for: Teams or individuals who need to uniformly manage multiple relational databases and MongoDB within DSH Web, and want Agents to perform read-only database exploration and querying under clear authorization and quotas.

Boundaries and Operations:

Symptom Check First
No “Database” in sidebar Whether installed to the active Web Profile, whether restarted, whether DSH version matches
TLS or certificate errors Whether hostname matches certificate, whether host trusts the issuing CA
Agent cannot see tools Access switch, saved authorization scope, current session; structure-only discovery mode does not provide query tools
Query rejected, incomplete results Whether query is read-only, whether quota or result limit is reached

For tool parameters, return formats, and limits, see docs/reference.md. For updates, deactivation, or uninstallation, see the maintenance chapter in the usage guide.

The DSH ecosystem emphasizes “Everything is a Plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek / High-Flyer. Before choosing third-party plugins, please assess the risks of connection credentials and query results entering the model context in accordance with your organization’s security policies.

Conclusion

dsh-database consolidates multi-database connections, structure discovery, and read-only queries into DSH Web with per-connection authorization. It is suitable for scenarios where you drive data analysis via natural language in the Harness but require controllable permissions and observable invocations. To learn more, please visit the Directory Page and the GitHub Repository.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye