DeepSeek Harness (dsh) ecosystem supports plugin-based extensions. Local database administration (DBA) is a common requirement. The dsh-local-dba plugin provides a set of db_* tools that support query execution, schema inspection, backup/restore, and slow query analysis on MySQL / MariaDB and PostgreSQL.

The plugin is distributed as a Cordis plugin package and registers a set of model-facing tools. It has no build-tool dependency, is implemented in pure JavaScript (ESM), and is ready to use immediately after installation.

Core Features

  • 8 db_* tools: Cover querying, schema inspection, health checks, backup, restore, and slow query analysis.
  • UI configuration: The plugin includes a settings card, allowing connections to be added/removed and a default connection to be set in the Harness UI without editing files. Changes take effect immediately after saving.
  • Major databases: Supports MySQL / MariaDB and PostgreSQL.
  • Secure defaults: Write operations and backup/restore toggles are disabled by default. db_query is strictly restricted to read-only access.

Installation

Run the following commands in your local environment:

git clone https://github.com/kichare/dsh-local-dba.git
dsh plugin --profile web add ./dsh-local-dba

Typical Usage

You do not need to memorize tool names—describe the requirement in natural language:

  • Health check: Check the database’s health status and list databases and their sizes.
  • Schema: List all tables in a specified database and view the columns and index structure of a table.
  • Query: Display the latest data rows and aggregate order counts grouped by user.
  • Change (requires enabling write permission): Add a unique index and update order status.
  • Backup/Restore: Export a database to the backup directory and restore a database from a backup file.
  • Diagnosis: View the current list of slow queries.

Notes and Dependencies

  • Password management: It is recommended to configure passwords using the passwordEnv environment variable to avoid storing them in plaintext.
  • Permission control: Write operations (allowWrite) and backup/restore (allowBackupRestore) are disabled by default. After enabling allowWrite, the Agent can execute DDL/DML statements, and these operations are irreversible. After enabling allowBackupRestore, restore operations may overwrite objects with the same name and should be used with caution.
  • Read-only restriction: The db_query tool only accepts statements starting with SELECT / SHOW / DESCRIBE / EXPLAIN / WITH.
  • Environment dependencies:
    • Node.js 24 and pnpm are required.
    • The backup/restore functionality requires the native clients mysqldump / mysql and pg_dump / psql to be installed on the system.