返回目录

dsh-mysql

精选清单收录维护状态: 活跃

1321928757/dsh-mysql

MySQL 连接器插件:设置中配置连接、会话内切换,并为每个智能体预设暴露 mysql_query/mysql_tables/mysql_execute 工具

前往 GitHub
$ dsh plugin add dsh-mysql

安装

dsh 没有统一的安装命令——把该插件 README 中的配置行加入你的 profile/patch 配置,然后重启即可。

了解安装方式

8

星标

5

Fork

JavaScript

语言

MIT

许可证

2026-08-18

创建于

2026-10-25

最近推送

README

dsh-mysql

MySQL connections and guarded database tools for DeepSeek Harness
Configure connections once, choose one or more per conversation, and let your agent route each call to a selected data source.

GitHub release GitHub stars MIT license DSH plugin

English | 中文

dsh-mysql is a profile bundle for DeepSeek Harness (DSH). It adds a settings page for multiple MySQL connections, a per-session connection picker beside the composer, and four guarded tools that every agent preset can use. No preset edits are required.

Data boundary: connection settings and passwords stay in your local DSH storage. Database schema and query results are sent to the LLM provider as ordinary tool output when the agent uses a database tool.

At a glance

Surface What it provides
Settings → MySQL 数据库 Add, edit, delete, and test connections. Configure host, port, user, password, default database, table scope, row-write permission, and independent schema-change permission.
Composer database button Select or deselect one or more data sources for the current session. Each click takes effect immediately; the composer pill shows the single name or a compact selected count.
Agent tools + runtime context mysql_tables, mysql_query, mysql_execute, and mysql_ddl, plus a per-turn context snapshot listing this session's selected sources and capabilities.

Features

  • Multiple connections: keep separate development, staging, or production data sources in one DSH installation.
  • Per-session multi-selection: each conversation independently selects zero, one, or multiple sources. Select/deselect takes effect immediately; clearing the last selection leaves the session without database access until a source is selected again. A session with multiple configured sources starts empty; a sole configured source is auto-selected on first initialization. Selection is runtime-only and is not restored after a DSH restart.
  • One target per tool call: when multiple sources are selected, the agent passes one selected connectionId to each tool call. A single selected source may be inferred. Queries are never broadcast or merged across sources.
  • Schema-first workflow: mysql_tables exposes readable columns, types, nullability, keys, and comments before a query is written.
  • Read-only by default: row-write access and schema-change access are independent per-connection settings, both disabled by default and each requiring its own risk acknowledgement.
  • Scoped schema changes: mysql_ddl is separate from mysql_execute; changed/deleted targets are checked against the table allowlist, and explicit database qualifiers must match the connection's default database. Account/privilege and database-level statements remain refused.
  • Local-first configuration: the browser receives a safe connection view with hasPassword, never the stored password.
  • No preset changes: the tools are registered globally by the profile bundle and are available under every agent preset.

Agent tools

Tool Accepted input and behavior
mysql_tables Lists columns from one selected database through information_schema. Pass connectionId when multiple sources are selected; it may be omitted when exactly one is selected. Optional table filtering is case-insensitive. Results respect that source's table allowlist.
mysql_query Executes one read-only SELECT, SHOW, DESCRIBE/DESC, or EXPLAIN statement against one selected source. Pass connectionId when multiple sources are selected; it may be omitted for a single selection. Optional ? parameters are supported. It rejects multi-statement SQL, applies the target source's table-scope check, and returns up to 2,000 serialized rows with a truncated flag.
mysql_execute Executes one INSERT, UPDATE, or DELETE statement against one selected source. Pass connectionId when multiple sources are selected; it may be omitted for a single selection. Requires that target's allowWrite: true; DDL, transaction-control statements, multi-statement SQL, and other statement types are rejected.
mysql_ddl Executes one CREATE/ALTER/DROP/RENAME/TRUNCATE statement on tables, views, or indexes in one selected source. Pass connectionId when multiple sources are selected; it may be omitted for a single selection. It requires that target's independent allowDdl: true setting; changed/deleted targets obey its allowlist and all explicit database qualifiers must match its default database. Account/privilege statements and database-level DDL are always rejected.

Schema changes require a separate opt-in and risk acknowledgement. Once enabled, you can ask the agent to create a table, for example:

Inspect the current schema with mysql_tables, then create `agent_notes` in this connection's default database with an auto-increment id, title, and created_at timestamp. Show the CREATE TABLE SQL and execute it with mysql_ddl. Do not modify other tables.

If the connection has a non-empty table allowlist, add the new table to that list before asking the agent to read or write it with the existing tools.

在 GitHub 阅读完整 README →

DSH Plugins 是独立的 DeepSeek Harness 插件目录,与 DeepSeek 官方无关,也不代表官方背书。第三方插件未经安全审计,安装前请审查源码。

每周获取最新的 DeepSeek Harness 插件,绝不滥发。