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 與長期記憶。
