ClaudeCodeMod

All shelves / MCP servers

mcp-dbutils

donghao1393/mcp-dbutils · 90 stars · Python · MIT

MCP server 数读 是一件可以让你的大模型安全连接到数据库的MCP工具。| DButils is an all-in-one MCP service that enables your AI to do data analysis by harnessing versatile types of database (sqlite, mysql, postgres, and more) within a unified configuration of multiple connections in a secured way (like SSL and control

Install

The repo has no one-line install. Follow its README.

Open the repo

Files

README.md

MCP 数据库工具

构建状态 覆盖率 质量门禁状态

PyPI 版本 PyPI 下载量 Smithery

Python 许可证 GitHub 星标

English | Français | Español | العربية | Русский | 文档导航

Image

简介

MCP Database Utilities 是一个多功能的 MCP 服务,它使您的 AI 能够通过统一的连接配置安全地访问各种类型的数据库(SQLite、MySQL、PostgreSQL 等)进行数据分析。

您可以将其视为 AI 系统和数据库之间的安全桥梁,允许 AI 在不直接访问数据库或冒数据修改风险的情况下读取和分析您的数据。

核心特性

  • 安全优先:严格只读操作,无直接数据库访问,隔离连接,按需连接,自动超时
  • 隐私保障:本地处理,最小数据暴露,凭证保护,敏感数据屏蔽
  • 多数据库支持:使用相同的接口连接 SQLite、MySQL、PostgreSQL
  • 简单配置:所有数据库连接使用单个 YAML 文件
  • 高级功能:表格浏览、架构分析和查询执行

🔒 安全说明:MCP 数据库工具采用安全优先的架构设计,非常适合注重数据保护的企业、初创公司和个人用户。详细了解我们的安全架构。

快速入门

我们提供了多种安装方式,包括 uvx、Docker 和 Smithery。详细的安装和配置步骤请参阅安装指南。

基本步骤

  1. 安装:选择适合您的安装方式(详细说明)
  2. 配置:创建包含数据库连接信息的 YAML 文件(配置指南)
  3. 连接:将配置添加到您的 AI 客户端
  4. 使用:开始与您的数据库交互(使用指南)

示例交互

您:"能否列出我的数据库中的所有表?"

AI:"以下是您的数据库中的表:

  • customers(客户)
  • products(产品)
  • orders(订单)
  • inventory(库存)"

您:"customers 表的结构是什么样的?"

AI:"customers 表有以下结构:

  • id(整数,主键)
  • name(文本)
  • email(文本)
  • registration_date(日期)"

文档导航

入门指南

技术文档

示例文档

多语言文档

支持与反馈

可用工具

MCP 数据库工具提供了多种工具,使 AI 能够与您的数据库交互:

  • dbutils-list-connections:列出配置中的所有可用数据库连接,包括数据库类型、主机、端口和数据库名称等详细信息,同时隐藏密码等敏感信息。
  • dbutils-list-tables:列出指定数据库连接中的所有表,包括表名、URI和可用的表描述,按数据库类型分组以便于识别。
  • dbutils-run-query:执行只读SQL查询(仅SELECT),支持包括JOIN、GROUP BY和聚合函数在内的复杂查询,返回包含列名和数据行的结构化结果。
  • dbutils-describe-table:提供表结构的详细信息,包括列名、数据类型、是否可为空、默认值和注释,以易于阅读的格式呈现。
  • dbutils-get-ddl:获取创建指定表的完整DDL(数据定义语言)语句,包括所有列定义、约束和索引。
  • dbutils-list-indexes:列出指定表上的所有索引,包括索引名称、类型(唯一/非唯一)、索引方法和包含的列,按索引名称分组。
  • dbutils-get-stats:获取表的统计信息,包括估计行数、平均行长度、数据大小和索引大小。
  • dbutils-list-constraints:列出表上的所有约束,包括主键、外键、唯一约束和检查约束,对于外键约束还显示引用的表和列。
  • dbutils-explain-query:获取SQL查询的执行计划,显示数据库引擎将如何处理查询,包括访问方法、连接类型和估计成本。
  • dbutils-get-performance:获取数据库连接的性能指标,包括查询计数、平均执行时间、内存使用情况和错误统计。
  • dbutils-analyze-query:分析SQL查询的性能特性,提供执行计划、实际执行时间和具体的优化建议。

有关这些工具的详细说明和使用示例,请参阅使用指南。

星标历史

星标历史图表

许可证

本项目采用 MIT 许可证 - 有关详细信息,请参阅 LICENSE 文件。

Facts

Kind
MCP server
Repo
donghao1393/mcp-dbutils
Group
Uncategorized
Stars
90
License
MIT
Language
Python
Last push
2025-05-12
Forks
13
Topics
database, modelcontextprotocol, postgres, sqlite, mysql

More on this shelf

  1. 1REAio.github.morluto/reaReverse engineer anything from your terminal or agent with one CLI and MCP server.125.3k
  2. 2com.browser-use/browser-usecom.browser-use/browser-useControl a real Chrome browser to complete any task: fill forms, extract data, book flights.117.7k
  3. 3World Monitorapp.worldmonitor/mcpLive markets, conflicts, country risk, chokepoints, energy, and China decision signals. 93 tools.88.3k
  4. 4Scrapling MCP Serverd4vinci/scrapling🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scraplingdev86.9k
  5. 5Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
  6. 6Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k