About DBUtils
DBUtils is an MCP server published by donghao1393 in the Data category: 安全只读的 MCP 数据库工具,SQL 优先,NoSQL 按需纳入 | Secure read-only MCP database utilities for AI agents — SQL first, NoSQL where it makes sense. Conduid read 14 tools from its source: dbutils-analyze-query, dbutils-describe-table, dbutils-execute-write, dbutils-explain-query, dbutils-get-audit-logs, dbutils-get-ddl and 8 more. No package is published for it, so it installs from a source checkout.
The repository has 89 stars and 13 forks, is licensed MIT, and its last commit was on 14 Nov 2026. The latest release is v1.0.4 (12 May 2025): Bug Fixes 修改文档中的Docker安装说明,添加获取项目代码步骤 (#111) (e56805f), closes #110 #110 #110 #110 #110 #110 #110 #110. It follows v1.0.3 (5 May 2025), and the 5 most recent releases go back to v1.0.0 (4 May 2025). It passes 4 of the 6 static checks Conduid ran on the repository; it does not pass Dependencies pinned and Scoped permissions. Its topics include data, database, sqlite, postgres and mysql.
Install
git clone https://github.com/donghao1393/mcp-dbutilsTools (14)
dbutils-analyze-queryAnalyzes the performance characteristics of a SQL query, providing execution plan, actual execution time, and optimization suggestions. The tool executes the query (SELECT statements only) and measures performance, then provides specific optimization recommendations based on the results, such as adding indexes, restructuring join conditions, or adjusting query structure. Use this tool when you need to improve query performance, understand performance bottlenecks, or learn query optimization techniques.| Parameter | Type | Description |
|---|---|---|
| connection * | string | Database connection name |
| sql * | string | SQL query to analyze |
dbutils-describe-tableProvides detailed information about a table's structure, including column names, data types, nullability, default values, and comments. Results are formatted as an easy-to-read hierarchy that clearly displays all column attributes. Use this tool when you need to understand table structure in depth, analyze data models, or prepare queries. Supports all major database types with consistent output format.| Parameter | Type | Description |
|---|---|---|
| connection * | string | Database connection name |
| table * | string | Table name to describe |
dbutils-execute-writeCAUTION: This tool executes data modification operations (INSERT, UPDATE, DELETE) on the specified database. It requires explicit configuration and confirmation. Only available for connections with 'writable: true' in configuration. All operations are logged for audit purposes.| Parameter | Type | Description |
|---|---|---|
| confirmation * | string | Type 'CONFIRM_WRITE' to confirm you understand the risks |
| connection * | string | Database connection name |
| sql * | string | SQL statement (INSERT, UPDATE, DELETE) |
dbutils-explain-queryProvides the execution plan for a SQL query, showing how the database engine will process the query. Returns detailed execution plan including access methods, join types, sort operations, and estimated costs. Also provides actual execution statistics where available. Use this tool when you need to optimize query performance, understand complex query behavior, or diagnose slow queries. Note that execution plan format varies by database type.| Parameter | Type | Description |
|---|---|---|
| connection * | string | Database connection name |
| sql * | string | SQL query to explain |
dbutils-get-audit-logsRetrieves audit logs for database write operations. Shows who performed what operations, when, and with what results. Useful for security monitoring, compliance, and troubleshooting.| Parameter | Type | Description |
|---|---|---|
| connection | string | Filter logs by connection name |
| limit | integer | Maximum number of logs to return |
| operation_type | string | Filter logs by operation type (INSERT, UPDATE, DELETE) |
| status | string | Filter logs by operation status (SUCCESS, FAILED) |
| table | string | Filter logs by table name |
dbutils-get-ddlRetrieves the complete DDL (Data Definition Language) statement for creating the specified table. Returns the original CREATE TABLE statement including all column definitions, constraints, indexes, and table options. This tool is valuable when you need to understand the complete table structure, replicate table structure, or perform database migrations. Note that DDL statement format varies by database type.| Parameter | Type | Description |
|---|---|---|
| connection * | string | Database connection name |
| table * | string | Table name to get DDL for |
dbutils-get-performanceRetrieves performance metrics for the database connection, including query count, average execution time, memory usage, and error statistics. These metrics reflect the resource usage of the current session and help monitor and optimize database operations. Use this tool when you need to evaluate query efficiency, identify performance bottlenecks, or monitor resource usage.| Parameter | Type | Description |
|---|---|---|
| connection * | string | Database connection name |
dbutils-get-statsRetrieves statistical information about the table, including estimated row count, average row length, data size, index size, and column information. These statistics are valuable for understanding table size, growth trends, and storage characteristics. Use this tool when you need to perform capacity planning, performance optimization, or database maintenance. Note that the precision and availability of statistics may vary by database type.| Parameter | Type | Description |
|---|---|---|
| connection * | string | Database connection name |
| table * | string | Table name to get statistics for |
dbutils-list-connectionsLists all available database connections defined in the configuration with detailed information including database type, host, port, and database name, while hiding sensitive information like passwords. The optional check_status parameter allows verifying if each connection is available, though this may increase response time. Use this tool when you need to understand available database resources or diagnose connection issues.| Parameter | Type | Description |
|---|---|---|
| check_status | boolean | Whether to check connection status (may be slow with many connections) |
dbutils-list-constraintsLists all constraints on the table, including primary keys, foreign keys, unique constraints, and check constraints. Results are grouped by constraint type, clearly showing constraint names and involved columns. For foreign key constraints, referenced tables and columns are also displayed. Use this tool when you need to understand data integrity rules, table relationships, or data validation logic.| Parameter | Type | Description |
|---|---|---|
| connection * | string | Database connection name |
| table * | string | Table name to list constraints for |
dbutils-list-indexesLists all indexes on the specified table, including index names, types (unique/non-unique), index methods (e.g., B-tree), and included columns. Results are grouped by index name, clearly showing the structure of multi-column indexes. Use this tool when you need to optimize query performance, understand table access patterns, or diagnose performance issues.| Parameter | Type | Description |
|---|---|---|
| connection * | string | Database connection name |
| table * | string | Table name to list indexes for |
dbutils-list-tablesLists all tables in the specified database connection. Results include table names, URIs, and available table descriptions. Results are grouped by database type and clearly labeled for easy identification. Use this tool when you need to understand database structure or locate specific tables. Only works within the allowed connection scope.| Parameter | Type | Description |
|---|---|---|
| connection * | string | Database connection name |
dbutils-run-queryExecutes read-only SQL queries on the specified database connection. For security, only SELECT statements are supported. Returns structured results with column names and data rows. Supports complex queries including JOINs, GROUP BY, ORDER BY, and aggregate functions. Use this tool when you need to analyze data, validate hypotheses, or extract specific information. Query execution is protected by resource limits and timeouts to prevent system resource overuse.| Parameter | Type | Description |
|---|---|---|
| connection * | string | Database connection name |
| sql * | string | SQL query (SELECT only) |
query执行只读SQL查询| Parameter | Type | Description |
|---|---|---|
| connection | string | 数据库连接名称(可选) |
| sql * | string | SQL查询语句(仅支持SELECT) |
Security checks
Static checks derived from the repository 10 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 272 words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- !Dependencies pinnedNo lockfile anywhere in the repository. Installs can pull different code over time.
- ✓No dynamic code executionScanned 18 source files and found no eval, dynamic Function or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdiosrc/mcp_dbutils/base.py:10
- Starts other programs
- No calls that start other programs
- Outbound network calls
- No outbound network calls
- Writes or deletes files
- 1 callsrc/mcp_dbutils/audit.py:61
- Lockfile
- None in the repository
Pattern matches on the source text of 18 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 272 words, fetched a month ago. The original in the repository is authoritative.
Read full README