Introduction

In DSH, when letting agents operate MySQL, common problems include scattered connection configurations, different sessions accidentally selecting the wrong database, and unclear boundaries for tool permissions. dsh-mysql puts MySQL connection configuration, session selection, and the database tool in the same Web profile plugin: first maintain connections on the settings page, then select connections based on the session, and finally let the Agent use controlled tools to query tables or execute queries.

What is it

dsh-mysql is a plugin for DeepSeek Harness (DSH), with the repository name 1321928757/dsh-mysql, licensed under the MIT license.

It provides three things for DSH’s Web profile:

  • A settings page for multiple sets of MySQL connections;
  • A database selector next to the input box for selecting by session;
  • The mysql_tables, mysql_query, and mysql_execute tools available as presets for all Agents.

The plugin does not require modifying Agent presets. The tools are globally registered by the profile bundle and are available to all Agent presets after registration.

Core Features

Connection Management

The plugin provides a settings page to manage multiple sets of MySQL connections. Actions that can be performed include adding, editing, deleting, and testing connections.

Each connection can be configured with:

  • host
  • port
  • user
  • password
  • default database
  • table scope
  • write permission

The connection form currently does not expose SSL/TLS, Unix socket/named-pipe, or charset options.

Session Selection

A database selector is provided next to the input box. The connection selected for the current session is displayed near the input box and can be changed at any time.

Switching connections within a session does not implicitly change the connection selection for another session.

Controlled Database Tools

The plugin provides three tools to all Agent presets:

mysql_tables

Used to discover tables in the default database. The plugin discovers tables within DATABASE(). If schema discovery is desired, default database must be configured for that connection. Connections without a configured default database may return an empty table list.

mysql_query

Used to execute queries and return results. Results return a maximum of 2,000 rows and include a truncated flag.

Optimization hints involving MAX_EXECUTION_TIME target MySQL 5.7.8+ and other versions that support this hint; MariaDB may handle this hint differently.

mysql_execute

Used to execute write operations and requires allowWrite: true to be enabled in the connection configuration.

mysql_execute rejects DDL, transaction control statements, multi-statement SQL, and other statement types that are not allowed.

Default Read-Only and Local Configuration

The plugin is read-only by default. Write permissions are explicitly configured per connection and are disabled by default.

The configuration uses a local-first approach: browsers receive a secure view of the connection containing hasPassword, but not the stored password. Connection settings and passwords are retained in local DSH storage.

Data boundaries need attention: when an Agent uses database tools, the database schema and query results are sent to the LLM provider as standard tool outputs.

Installation and Usage

Before use, the following must be met:

  • DSH with Web profile installed;
  • Node.js 20 or higher.

Install v0.1.10 from GitHub:

dsh plugin --profile web add github:1321928757/dsh-mysql#v0.1.10

After installation, restart dsh web.

You can use the following command to confirm whether the bundle appears in the web profile configuration:

dsh --profile web --dump-config | findstr dsh-mysql

If no longer needed, it can be removed:

dsh plugin --profile web remove dsh-mysql

Typical Usage

Below is an introduction to a common read-only query workflow.

  1. Open Settings → MySQL Database, add a connection, and test the connection.

Connection information must include at least host, port, user, password, and default database. If you only want to allow the Agent to read a specific range, you can configure table scope. Do not enable write permissions by default.

  1. Go back to the session page, click the database button next to the input box, and select the connection to be used for the current session.

  2. Let the Agent inspect the schema first, then execute the query. You can describe it like this:

Use mysql_tables to inspect the available schema first, then use mysql_query to answer my question. Do not modify data.

After the steps above, the Agent will work on the connection selected for the current session. By default, it can only read and cannot write.

Applicable Scenarios and Notes

Suitable for scenarios in DSH Web where MySQL is integrated, database selection is desired per session, and Agents are expected to use controlled tools to handle table structures and query results.

Before use, confirm the following points:

  • The plugin runs with the current dsh process permissions; check the source code and license before installing.
  • The license is MIT.
  • Connection passwords are retained in local DSH storage, but when an Agent uses a tool, the schema and query results are sent to the LLM provider as tool outputs.
  • mysql_execute is only available when allowWrite: true is set, and it rejects DDL, transaction control statements, multi-statement SQL, and other statement types that are not allowed.
  • mysql_query returns a maximum of 2,000 rows and includes a truncated flag.
  • The connection form does not expose SSL/TLS, Unix socket/named-pipe, or charset options.
  • MAX_EXECUTION_TIME optimization hints target MySQL 5.7.8+ and other versions that support this hint; MariaDB may handle it differently.

Links

  • Directory page: Search for dsh-mysql entry in the DSH plugins directory; the specific URL depends on the current directory search result.
  • GitHub: https://github.com/1321928757/dsh-mysql