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.
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
connectionIdto each tool call. A single selected source may be inferred. Queries are never broadcast or merged across sources. - Schema-first workflow:
mysql_tablesexposes 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_ddlis separate frommysql_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.
更多「知识与研究」插件
weknora
作者 tencent
开源的 LLM 知识库平台:把原始文档转化为可检索的 RAG 知识库、自主推理智能体和自动维护的 Wiki 系统,支持多租户部署。
honcho
作者 plastic-labs
用于构建有状态 AI 智能体的记忆库,支持跨会话连续学习与上下文工程。
webnovel-writer
作者 lingfengqaq
基于 Claude Code 的长篇网文辅助创作系统,解决 AI 写作中的「遗忘」和「幻觉」问题,支持 200 万字量级 连载创作。
reme
作者 agentscope-ai
ReMe:面向 AI Agent 的记忆管理套件——帮 Agent「记住我、优化我」,支持 RAG 与长期记忆。
