1. Conduid
  2. Data
  3. DBUtils
MCP server · Data

DBUtils

安全只读的 MCP 数据库工具,SQL 优先,NoSQL 按需纳入 | Secure read-only MCP database utilities for AI agents — SQL first, NoSQL where it makes sense.

59Fair

Scored just now · breakdown

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

From source
git clone https://github.com/donghao1393/mcp-dbutils

Tools (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.
ParameterTypeDescription
connection *stringDatabase connection name
sql *stringSQL 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.
ParameterTypeDescription
connection *stringDatabase connection name
table *stringTable 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.
ParameterTypeDescription
confirmation *stringType 'CONFIRM_WRITE' to confirm you understand the risks
connection *stringDatabase connection name
sql *stringSQL 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.
ParameterTypeDescription
connection *stringDatabase connection name
sql *stringSQL 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.
ParameterTypeDescription
connectionstringFilter logs by connection name
limitintegerMaximum number of logs to return
operation_typestringFilter logs by operation type (INSERT, UPDATE, DELETE)
statusstringFilter logs by operation status (SUCCESS, FAILED)
tablestringFilter 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.
ParameterTypeDescription
connection *stringDatabase connection name
table *stringTable 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.
ParameterTypeDescription
connection *stringDatabase 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.
ParameterTypeDescription
connection *stringDatabase connection name
table *stringTable 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.
ParameterTypeDescription
check_statusbooleanWhether 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.
ParameterTypeDescription
connection *stringDatabase connection name
table *stringTable 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.
ParameterTypeDescription
connection *stringDatabase connection name
table *stringTable 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.
ParameterTypeDescription
connection *stringDatabase 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.
ParameterTypeDescription
connection *stringDatabase connection name
sql *stringSQL query (SELECT only)
query执行只读SQL查询
ParameterTypeDescription
connectionstring数据库连接名称(可选)
sql *stringSQL查询语句(仅支持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

v1.0.4v1.0.4 · 12 May 20251.0.4 (2025-05-12) Bug Fixes 修改文档中的Docker安装说明,添加获取项目代码步骤 (#111) (e56805f), closes #110 #110 #110 #110 #110 #110 #110 #110
v1.0.3v1.0.3 · 5 May 20251.0.3 (2025-05-05) Bug Fixes 修复_extract_table_name方法处理多行SQL语句的问题 (#98) (69eb5e1), closes #97
v1.0.2v1.0.2 · 5 May 20251.0.2 (2025-05-05) Bug Fixes 修复表名大小写敏感性问题 (#95) (2986101), closes #92
v1.0.1v1.0.1 · 4 May 20251.0.1 (2025-05-04) Bug Fixes 提高代码覆盖率以解决SonarCloud检查失败问题 (#90) (adbc9f2)
v1.0.0v1.0.0 · 4 May 20251.0.0 (2025-05-04) Features 添加数据库写操作功能 (#88) (7703cdf) BREAKING CHANGES 这个功能将改变项目的核心安全模型,从只读到可配置读写, 需要主版本号升级(从1.x.x到2.0.0)。 feat: 添加数据库写操作配置支持 在配置系统中添加对数据库写操作的支持: 1. 在ConnectionConfig基类中添加writable和write_permissions属性 2.…

README

The repository's README runs to about 272 words, fetched a month ago. The original in the repository is authoritative.

Read full README
Questions

About DBUtils

How do I install DBUtils?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is DBUtils safe to use with an AI agent?

Its trust score is 59 out of 100 (fair). It passes 4 of the 6 static checks Conduid ran on the repository; it does not pass Dependencies pinned and Scoped permissions. Conduid's scan of 18 source files found that it serves MCP over stdio and writes or deletes files (1 call). It has no ConduID identity yet, so agent calls to it are not receipted.

Is DBUtils still maintained?

Yes — the last commit was 17 days ago. The repository has 89 stars and 13 forks and 14 open issues.

What tools does DBUtils provide?

Conduid read 14 tools from the source: dbutils-analyze-query, dbutils-describe-table, dbutils-execute-write, dbutils-explain-query, dbutils-get-audit-logs, dbutils-get-ddl, dbutils-get-performance, dbutils-get-stats and 6 more. 14 of them publish their parameters, listed under Tools above.

What license is DBUtils released under?

The repository declares the MIT license. That applies to the latest release, v1.0.4, as well.