MCP 数据库工具 (MCP Database Utilities)

MCP 数据库工具 (MCP Database Utilities)

A secure bridge enabling AI systems safe, read-only access to multiple databases via unified configuration.

85
Stars
9
Forks
85
Watchers
8
Issues
MCP Database Utilities provides a secure, standardized service for AI systems to access and analyze databases like SQLite, MySQL, and PostgreSQL using a unified YAML-based configuration. It enforces strict read-only operations, local processing, and credential protection to ensure data privacy and integrity. The tool is suitable for entities focused on data privacy and minimizes risks by isolating database connections and masking sensitive data. Designed for easy integration, it supports multiple installation options and advanced capabilities such as schema analysis and table browsing.

Key Features

Strict read-only database operations
Support for SQLite, MySQL, and PostgreSQL
Unified configuration using a single YAML file
Isolated, on-demand database connections
Automatic connection timeout
Credential protection and minimal data exposure
Sensitive data masking
Local processing to ensure privacy
Table browsing and schema analysis
Advanced query execution with security measures

Use Cases

Enabling AI applications to safely query business databases
Providing secure data analytics capabilities without exposing raw data
Facilitating AI-driven customer insights from production databases
Protecting sensitive organizational data during AI model training
Supporting startups and enterprises in deploying AI with strong data privacy requirements
Automating report generation by AI using structured database access
Integrating AI with multiple databases through a single interface
Securing AI-assisted data exploration for compliance-heavy industries
Allowing analysts to leverage AI for schema and data discovery with controls
Preventing unauthorized data modification while enabling advanced AI analytics

README

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 文件。

Star History

Star History Chart

Repository Owner

Repository Details

Language Python
Default Branch main
Size 991 KB
Contributors 3
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
98.71%
Shell
1.22%
Dockerfile
0.07%

Tags

Topics

database modelcontextprotocol mysql postgres sqlite

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Signoz MCP Server

    Signoz MCP Server

    Connect SigNoz observability data to AI assistants via the Model Context Protocol.

    Signoz MCP Server acts as a bridge between SigNoz observability platforms and AI assistants by implementing the Model Context Protocol (MCP). It exposes a suite of tools for querying dashboard information, fetching panel and metrics data, executing custom queries, and retrieving traces or logs from SigNoz. The tool supports integration with popular AI assistants, flexible deployment options (Docker, local virtual environments), and secure configuration via environment variables or YAML files. The server is designed to enable standardized programmatic context retrieval for enhancing AI/LLM workflows.

    • 11
    • MCP
    • DrDroidLab/signoz-mcp-server
  • AIM Guard MCP

    AIM Guard MCP

    AI-powered security and safety server for Model Context Protocol environments.

    AIM Guard MCP is a server implementing the Model Context Protocol (MCP), providing AI-powered security analysis and safety instruction tools tailored for AI agents. It offers features such as contextual security instructions, harmful content detection, API key scanning, and prompt injection detection, all designed to guard and protect interactions with various MCPs and external services. Built for fast integration, it connects with the AIM Intelligence API and is compatible with any MCP-compliant AI assistant.

    • 13
    • MCP
    • AIM-Intelligence/AIM-MCP
  • QuantConnect MCP Server

    QuantConnect MCP Server

    Official bridge for secure AI access to QuantConnect's algorithmic trading cloud platform

    QuantConnect MCP Server enables artificial intelligence systems such as Claude and OpenAI to interface with QuantConnect's cloud platform through an official, secure, and dockerized implementation of the Model Context Protocol (MCP). It facilitates automated project management, strategy writing, backtesting, and live deployment by exposing a comprehensive suite of API tools for users with valid access credentials. As the maintained official version, it ensures security, easy deployment, and cross-platform compatibility for advanced algorithmic trading automation.

    • 50
    • MCP
    • QuantConnect/mcp-server
  • MXCP

    MXCP

    Enterprise-Grade Model Context Protocol Framework for AI Applications

    MXCP is an enterprise-ready framework that implements the Model Context Protocol (MCP) for building secure, production-grade AI application servers. It introduces a structured methodology focused on data modeling, robust service design, policy enforcement, and comprehensive testing, integrated with strong security and audit capabilities. The framework enables rapid development and deployment of AI tools, supporting both SQL and Python environments, with built-in telemetry and drift detection for reliability and compliance.

    • 49
    • MCP
    • raw-labs/mxcp
  • Bear MCP Server

    Bear MCP Server

    Read-only Model Context Protocol server for Bear note integration

    Bear MCP Server provides a Model Context Protocol (MCP) interface to access notes and tags stored in the Bear note-taking app. It enables AI assistants, including Claude, to securely interact with Bear notes through read-only operations, connecting directly to the Bear SQLite database without the risk of modifying user data. The server exposes tools for searching, opening, and listing notes and tags, ensuring all access is non-destructive.

    • 14
    • MCP
    • bart6114/my-bear-mcp-server
  • Thales CipherTrust Data Security Platform CAKM MCP Server

    Thales CipherTrust Data Security Platform CAKM MCP Server

    MCP server for unified database TDE/Encryption management via CipherTrust.

    Thales CipherTrust Data Security Platform CAKM MCP Server implements the Model Context Protocol (MCP) for managing database encryption (TDE/EKM) with CipherTrust Application Key Management. It supports both Oracle and SQL Server, providing tools for resource-based management, comprehensive auditing, and key lifecycle operations. The server enables integration with CipherTrust Manager, automates key rotation, and offers advanced detection of TDE configurations.

    • 2
    • MCP
    • sanyambassi/thales-cdsp-cakm-mcp-server
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results