feat(mcp): make dbx_execute_query row limit configurable

This commit is contained in:
Abeautifulsnow authored and GitHub committed 2026-09-19 00:20:33 +08:00
1 parent 9d29f53e37
commit 5278594ed2
7 files changed
+222 -26

No files matched your search

+5 -1
View File
@@ -101,7 +101,7 @@ DBX MCP 当前提供以下工具(具体可用工具取决于构建功能及权
| `dbx_list_routines` | 列出 Schema 中的存储过程和函数,支持可选的 `routine_type` 过滤(PROCEDURE 或 FUNCTION) |
| `dbx_get_routine_source` | 按名称返回存储过程或函数的源码,重载场景可用可选的 `signature` 区分 |
| `dbx_get_schema_context` | 返回适合 AI 使用的紧凑 Schema 上下文 |
| `dbx_execute_query` | 执行 SQL 或支持的 MongoDB shell 命令,最多返回 100 行 |
| `dbx_execute_query` | 执行 SQL 或支持的 MongoDB shell 命令,默认返回 100 行,可用 `max_rows` 参数提高到最多 1000 行 |
| `dbx_execute_batch` | 一次执行包含多条语句的 SQL 脚本,按语句返回结果(多语句脚本搭配 `use_transaction` 时返回单个合并结果) |
| `dbx_open_session` | 为 SQL 连接打开固定后端连接的有状态查询会话 |
| `dbx_close_session` | 关闭会话并释放固定连接资源 |
@@ -111,6 +111,10 @@ DBX MCP 当前提供以下工具(具体可用工具取决于构建功能及权
| `dbx_open_table` | 在运行中的 DBX 桌面端打开表 |
| `dbx_execute_and_show` | 执行查询并在 DBX 中展示结果 |
`dbx_execute_query` 返回行数:
- `max_rows`:取值 1–1000,默认 100。越界值会被夹取到范围内,而不是报错。仅对 SQL 连接生效——MongoDB shell 命令始终最多返回 100 行,路由到批量执行器的多语句脚本每条语句最多返回 100 行。
启用连接作用域后,修改连接和桌面 UI 工具会被隐藏。
## 读取 Kafka 消息
+5 -1
View File
@@ -101,7 +101,7 @@ DBX MCP provides the following tools (availability depends on build features and
| `dbx_list_routines` | List stored procedures and functions in a schema, with an optional `routine_type` filter (PROCEDURE or FUNCTION) |
| `dbx_get_routine_source` | Return the source of a stored procedure or function by name, with an optional `signature` for overloaded names |
| `dbx_get_schema_context` | Return compact schema context for an AI model |
| `dbx_execute_query` | Execute SQL or a supported MongoDB shell command, returning at most 100 rows |
| `dbx_execute_query` | Execute SQL or a supported MongoDB shell command, returning 100 rows by default (up to 1000 with the `max_rows` parameter) |
| `dbx_execute_batch` | Execute a SQL script containing multiple statements in one call, returning a result per statement (or a single merged result with `use_transaction` on a multi-statement script) |
| `dbx_open_session` | Open a stateful SQL query session pinned to one backend connection |
| `dbx_close_session` | Close a session and release its pinned connection resources |
@@ -111,6 +111,10 @@ DBX MCP provides the following tools (availability depends on build features and
| `dbx_open_table` | Open a table in the running DBX desktop app |
| `dbx_execute_and_show` | Execute a query and display the result in DBX |
`dbx_execute_query` row controls:
- `max_rows`: 1–1000, defaults to 100. Out-of-range values are clamped, not rejected. It applies to SQL connections only — MongoDB shell commands always return at most 100 rows, and multi-statement scripts routed to the batch executor return at most 100 rows per statement.
Connection-scoped sessions hide connection-mutating and desktop UI tools.
## Read Kafka Messages