mcp-dbutils 0.16.1__tar.gz → 0.18.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/.gitignore +1 -1
  2. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/CHANGELOG.md +14 -0
  3. mcp_dbutils-0.18.0/PKG-INFO +138 -0
  4. mcp_dbutils-0.18.0/README.md +113 -0
  5. mcp_dbutils-0.18.0/README_EN.md +118 -0
  6. mcp_dbutils-0.18.0/docs/document-consistency-check.md +87 -0
  7. mcp_dbutils-0.18.0/docs/document-version-history.md +69 -0
  8. mcp_dbutils-0.18.0/docs/en/configuration.md +356 -0
  9. mcp_dbutils-0.18.0/docs/en/examples/advanced-llm-interactions.md +462 -0
  10. mcp_dbutils-0.18.0/docs/en/examples/mysql-examples.md +495 -0
  11. mcp_dbutils-0.18.0/docs/en/examples/postgresql-examples.md +353 -0
  12. mcp_dbutils-0.18.0/docs/en/examples/sqlite-examples.md +148 -0
  13. mcp_dbutils-0.18.0/docs/en/installation-platform-specific.md +281 -0
  14. mcp_dbutils-0.18.0/docs/en/installation.md +341 -0
  15. mcp_dbutils-0.18.0/docs/en/technical/architecture.md +163 -0
  16. mcp_dbutils-0.18.0/docs/en/technical/development.md +190 -0
  17. mcp_dbutils-0.18.0/docs/en/technical/security.md +169 -0
  18. mcp_dbutils-0.18.0/docs/en/technical/sonarcloud-integration.md +108 -0
  19. mcp_dbutils-0.18.0/docs/en/technical/testing.md +129 -0
  20. mcp_dbutils-0.18.0/docs/en/usage.md +225 -0
  21. mcp_dbutils-0.18.0/docs/zh/configuration.md +356 -0
  22. mcp_dbutils-0.18.0/docs/zh/examples/advanced-llm-interactions.md +462 -0
  23. mcp_dbutils-0.18.0/docs/zh/examples/mysql-examples.md +495 -0
  24. mcp_dbutils-0.18.0/docs/zh/examples/postgresql-examples.md +353 -0
  25. mcp_dbutils-0.18.0/docs/zh/examples/sqlite-examples.md +148 -0
  26. mcp_dbutils-0.18.0/docs/zh/installation-platform-specific.md +281 -0
  27. mcp_dbutils-0.18.0/docs/zh/installation.md +341 -0
  28. mcp_dbutils-0.18.0/docs/zh/technical/architecture.md +163 -0
  29. mcp_dbutils-0.18.0/docs/zh/technical/development.md +190 -0
  30. mcp_dbutils-0.18.0/docs/zh/technical/security.md +169 -0
  31. mcp_dbutils-0.18.0/docs/zh/technical/sonarcloud-integration.md +108 -0
  32. mcp_dbutils-0.18.0/docs/zh/technical/testing.md +129 -0
  33. mcp_dbutils-0.18.0/docs/zh/usage.md +225 -0
  34. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/pyproject.toml +1 -1
  35. mcp_dbutils-0.18.0/scripts/run_sonar_analysis.sh +134 -0
  36. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/base.py +364 -178
  37. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/mysql/handler.py +102 -35
  38. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/postgres/handler.py +50 -30
  39. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/sqlite/handler.py +124 -67
  40. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/fixtures.py +21 -18
  41. mcp_dbutils-0.18.0/tests/integration/test_list_connections.py +149 -0
  42. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_mysql.py +4 -3
  43. mcp_dbutils-0.18.0/tests/integration/test_mysql_handler_extended.py +232 -0
  44. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_sqlite.py +4 -3
  45. mcp_dbutils-0.18.0/tests/integration/test_sqlite_handler_extended.py +175 -0
  46. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/unit/test_base.py +109 -101
  47. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/unit/test_base_server.py +185 -180
  48. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/unit/test_mysql_handler.py +54 -69
  49. mcp_dbutils-0.16.1/PKG-INFO +0 -572
  50. mcp_dbutils-0.16.1/README.md +0 -547
  51. mcp_dbutils-0.16.1/README_CN.md +0 -525
  52. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/.coveragerc +0 -0
  53. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/.github/workflows/code-style.yml +0 -0
  54. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/.github/workflows/quality-assurance.yml +0 -0
  55. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/.github/workflows/release.yml +0 -0
  56. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/.pre-commit-config.yaml +0 -0
  57. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/.releaserc.json +0 -0
  58. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/Dockerfile +0 -0
  59. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/LICENSE +0 -0
  60. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/config.yaml.example +0 -0
  61. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/scripts/fix_imports.sh +0 -0
  62. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/scripts/fix_remaining_issues.sh +0 -0
  63. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/scripts/sonar-ai-fix.fish +0 -0
  64. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/smithery.yaml +0 -0
  65. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/sonar-project.properties +0 -0
  66. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/__init__.py +0 -0
  67. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/config.py +0 -0
  68. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/log.py +0 -0
  69. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/mysql/__init__.py +0 -0
  70. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/mysql/config.py +0 -0
  71. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/mysql/server.py +0 -0
  72. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/postgres/__init__.py +0 -0
  73. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/postgres/config.py +0 -0
  74. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/postgres/server.py +0 -0
  75. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/sqlite/__init__.py +0 -0
  76. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/sqlite/config.py +0 -0
  77. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/sqlite/server.py +0 -0
  78. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/src/mcp_dbutils/stats.py +0 -0
  79. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/conftest.py +0 -0
  80. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/__init__.py +0 -0
  81. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/conftest.py +0 -0
  82. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_logging.py +0 -0
  83. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_monitoring.py +0 -0
  84. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_monitoring_enhanced.py +0 -0
  85. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_mysql_config.py +0 -0
  86. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_mysql_config_helpers.py +0 -0
  87. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_postgres.py +0 -0
  88. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_postgres_config.py +0 -0
  89. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_prompts.py +0 -0
  90. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_sqlite_config.py +0 -0
  91. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_tools.py +0 -0
  92. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/integration/test_tools_advanced.py +0 -0
  93. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/unit/test_base_handlers.py +0 -0
  94. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/unit/test_base_helpers.py +0 -0
  95. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/unit/test_log.py +0 -0
  96. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/unit/test_mysql_server.py +0 -0
  97. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/unit/test_postgres_server.py +0 -0
  98. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/unit/test_sqlite_server.py +0 -0
  99. {mcp_dbutils-0.16.1 → mcp_dbutils-0.18.0}/tests/unit/test_stats.py +0 -0
@@ -1,5 +1,5 @@
1
1
  # Python
2
- docs/
2
+ docs/local/
3
3
  __pycache__/
4
4
  *.py[cod]
5
5
  *$py.class
@@ -1,3 +1,17 @@
1
+ # [0.18.0](https://github.com/donghao1393/mcp-dbutils/compare/v0.17.0...v0.18.0) (2025-04-25)
2
+
3
+
4
+ ### Features
5
+
6
+ * add dbutils-list-connections tool ([#68](https://github.com/donghao1393/mcp-dbutils/issues/68)) ([44ce9ac](https://github.com/donghao1393/mcp-dbutils/commit/44ce9ac9a63fcd43a0c817ee72b508380f36ba8d))
7
+
8
+ # [0.17.0](https://github.com/donghao1393/mcp-dbutils/compare/v0.16.1...v0.17.0) (2025-03-16)
9
+
10
+
11
+ ### Features
12
+
13
+ * 添加本地SonarQube分析脚本 ([65326a3](https://github.com/donghao1393/mcp-dbutils/commit/65326a3aa3a61db353fd3c399a3c808e9a07e332))
14
+
1
15
  ## [0.16.1](https://github.com/donghao1393/mcp-dbutils/compare/v0.16.0...v0.16.1) (2025-03-15)
2
16
 
3
17
 
@@ -0,0 +1,138 @@
1
+ Metadata-Version: 2.4
2
+ Name: mcp-dbutils
3
+ Version: 0.18.0
4
+ Summary: MCP Database Utilities Service
5
+ Author: Dong Hao
6
+ License-Expression: MIT
7
+ License-File: LICENSE
8
+ Requires-Python: >=3.10
9
+ Requires-Dist: mcp>=1.2.1
10
+ Requires-Dist: mysql-connector-python>=8.2.0
11
+ Requires-Dist: psycopg2-binary>=2.9.10
12
+ Requires-Dist: python-dotenv>=1.0.1
13
+ Requires-Dist: pyyaml>=6.0.2
14
+ Provides-Extra: test
15
+ Requires-Dist: aiosqlite>=0.19.0; extra == 'test'
16
+ Requires-Dist: docker>=7.0.0; extra == 'test'
17
+ Requires-Dist: pre-commit>=3.6.0; extra == 'test'
18
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'test'
19
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'test'
20
+ Requires-Dist: pytest-docker>=2.0.0; extra == 'test'
21
+ Requires-Dist: pytest>=7.0.0; extra == 'test'
22
+ Requires-Dist: ruff>=0.3.0; extra == 'test'
23
+ Requires-Dist: testcontainers>=3.7.0; extra == 'test'
24
+ Description-Content-Type: text/markdown
25
+
26
+ # MCP 数据库工具
27
+
28
+ <!-- 项目状态徽章 -->
29
+ [![构建状态](https://img.shields.io/github/workflow/status/donghao1393/mcp-dbutils/Quality%20Assurance?label=tests)](https://github.com/donghao1393/mcp-dbutils/actions)
30
+ [![覆盖率](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/donghao1393/bdd0a63ec2a816539ff8c136ceb41e48/raw/coverage.json)](https://github.com/donghao1393/mcp-dbutils/actions)
31
+ [![质量门禁状态](https://sonarcloud.io/api/project_badges/measure?project=donghao1393_mcp-dbutils&metric=alert_status)](https://sonarcloud.io/dashboard?id=donghao1393_mcp-dbutils)
32
+
33
+ <!-- 版本和安装徽章 -->
34
+ [![PyPI 版本](https://img.shields.io/pypi/v/mcp-dbutils)](https://pypi.org/project/mcp-dbutils/)
35
+ [![PyPI 下载量](https://img.shields.io/pypi/dm/mcp-dbutils)](https://pypi.org/project/mcp-dbutils/)
36
+ [![Smithery](https://smithery.ai/badge/@donghao1393/mcp-dbutils)](https://smithery.ai/server/@donghao1393/mcp-dbutils)
37
+
38
+ <!-- 技术规格徽章 -->
39
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-blue)](https://www.python.org/)
40
+ [![许可证](https://img.shields.io/github/license/donghao1393/mcp-dbutils)](LICENSE)
41
+ [![GitHub 星标](https://img.shields.io/github/stars/donghao1393/mcp-dbutils?style=social)](https://github.com/donghao1393/mcp-dbutils/stargazers)
42
+
43
+ [English](README_EN.md) | [文档导航](#文档导航)
44
+
45
+ ![Image](https://github.com/user-attachments/assets/26c4f1a1-7b19-4bdd-b9fd-34ad198b0ce3)
46
+
47
+ ## 简介
48
+
49
+ MCP Database Utilities 是一个多功能的 MCP 服务,它使您的 AI 能够通过统一的连接配置安全地访问各种类型的数据库(SQLite、MySQL、PostgreSQL 等)进行数据分析。
50
+
51
+ 您可以将其视为 AI 系统和数据库之间的安全桥梁,允许 AI 在不直接访问数据库或冒数据修改风险的情况下读取和分析您的数据。
52
+
53
+ ### 核心特性
54
+
55
+ - **安全优先**:严格只读操作,无直接数据库访问,隔离连接,按需连接,自动超时
56
+ - **隐私保障**:本地处理,最小数据暴露,凭证保护,敏感数据屏蔽
57
+ - **多数据库支持**:使用相同的接口连接 SQLite、MySQL、PostgreSQL
58
+ - **简单配置**:所有数据库连接使用单个 YAML 文件
59
+ - **高级功能**:表格浏览、架构分析和查询执行
60
+
61
+ > 🔒 **安全说明**:MCP 数据库工具采用安全优先的架构设计,非常适合注重数据保护的企业、初创公司和个人用户。详细了解我们的[安全架构](docs/zh/technical/security.md)。
62
+
63
+ ## 快速入门
64
+
65
+ 我们提供了多种安装方式,包括 uvx、Docker 和 Smithery。详细的安装和配置步骤请参阅[安装指南](docs/zh/installation.md)。
66
+
67
+ ### 基本步骤
68
+
69
+ 1. **安装**:选择适合您的安装方式([详细说明](docs/zh/installation.md))
70
+ 2. **配置**:创建包含数据库连接信息的 YAML 文件([配置指南](docs/zh/configuration.md))
71
+ 3. **连接**:将配置添加到您的 AI 客户端
72
+ 4. **使用**:开始与您的数据库交互([使用指南](docs/zh/usage.md))
73
+
74
+ ### 示例交互
75
+
76
+ **您**:"能否列出我的数据库中的所有表?"
77
+
78
+ **AI**:"以下是您的数据库中的表:
79
+ - customers(客户)
80
+ - products(产品)
81
+ - orders(订单)
82
+ - inventory(库存)"
83
+
84
+ **您**:"customers 表的结构是什么样的?"
85
+
86
+ **AI**:"customers 表有以下结构:
87
+ - id(整数,主键)
88
+ - name(文本)
89
+ - email(文本)
90
+ - registration_date(日期)"
91
+
92
+ ## 文档导航
93
+
94
+ ### 入门指南
95
+ - [安装指南](docs/zh/installation.md) - 详细的安装步骤和配置说明
96
+ - [平台特定安装指南](docs/zh/installation-platform-specific.md) - 针对不同操作系统的安装说明
97
+ - [配置指南](docs/zh/configuration.md) - 数据库连接配置示例和最佳实践
98
+ - [使用指南](docs/zh/usage.md) - 基本操作流程和常见使用场景
99
+
100
+ ### 技术文档
101
+ - [架构设计](docs/zh/technical/architecture.md) - 系统架构和组件说明
102
+ - [安全架构](docs/zh/technical/security.md) - 安全特性和保护机制
103
+ - [开发指南](docs/zh/technical/development.md) - 代码质量和开发流程
104
+ - [测试指南](docs/zh/technical/testing.md) - 测试框架和最佳实践
105
+ - [SonarCloud 集成](docs/zh/technical/sonarcloud-integration.md) - SonarCloud 与 AI 集成指南
106
+
107
+ ### 示例文档
108
+ - [SQLite 示例](docs/zh/examples/sqlite-examples.md) - SQLite 数据库操作示例
109
+ - [PostgreSQL 示例](docs/zh/examples/postgresql-examples.md) - PostgreSQL 数据库操作示例
110
+ - [MySQL 示例](docs/zh/examples/mysql-examples.md) - MySQL 数据库操作示例
111
+ - [高级 LLM 交互示例](docs/zh/examples/advanced-llm-interactions.md) - 与各类 LLM 的高级交互示例
112
+
113
+ ### 支持与反馈
114
+ - [GitHub Issues](https://github.com/donghao1393/mcp-dbutils/issues) - 报告问题或请求功能
115
+ - [Smithery](https://smithery.ai/server/@donghao1393/mcp-dbutils) - 简化安装和更新
116
+
117
+ ## 可用工具
118
+
119
+ MCP 数据库工具提供了多种工具,使 AI 能够与您的数据库交互:
120
+
121
+ - **dbutils-list-connections**:列出配置中的所有可用数据库连接
122
+ - **dbutils-list-tables**:列出数据库中的所有表
123
+ - **dbutils-run-query**:执行 SQL 查询(仅 SELECT)
124
+ - **dbutils-get-stats**:获取表统计信息
125
+ - **dbutils-list-constraints**:列出表约束
126
+ - **dbutils-explain-query**:获取查询执行计划
127
+ - **dbutils-get-performance**:获取数据库性能指标
128
+ - **dbutils-analyze-query**:分析查询以进行优化
129
+
130
+ 有关这些工具的详细说明和使用示例,请参阅[使用指南](docs/zh/usage.md)。
131
+
132
+ ## 星标历史
133
+
134
+ [![星标历史图表](https://starchart.cc/donghao1393/mcp-dbutils.svg?variant=adaptive)](https://starchart.cc/donghao1393/mcp-dbutils)
135
+
136
+ ## 许可证
137
+
138
+ 本项目采用 MIT 许可证 - 有关详细信息,请参阅 [LICENSE](LICENSE) 文件。
@@ -0,0 +1,113 @@
1
+ # MCP 数据库工具
2
+
3
+ <!-- 项目状态徽章 -->
4
+ [![构建状态](https://img.shields.io/github/workflow/status/donghao1393/mcp-dbutils/Quality%20Assurance?label=tests)](https://github.com/donghao1393/mcp-dbutils/actions)
5
+ [![覆盖率](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/donghao1393/bdd0a63ec2a816539ff8c136ceb41e48/raw/coverage.json)](https://github.com/donghao1393/mcp-dbutils/actions)
6
+ [![质量门禁状态](https://sonarcloud.io/api/project_badges/measure?project=donghao1393_mcp-dbutils&metric=alert_status)](https://sonarcloud.io/dashboard?id=donghao1393_mcp-dbutils)
7
+
8
+ <!-- 版本和安装徽章 -->
9
+ [![PyPI 版本](https://img.shields.io/pypi/v/mcp-dbutils)](https://pypi.org/project/mcp-dbutils/)
10
+ [![PyPI 下载量](https://img.shields.io/pypi/dm/mcp-dbutils)](https://pypi.org/project/mcp-dbutils/)
11
+ [![Smithery](https://smithery.ai/badge/@donghao1393/mcp-dbutils)](https://smithery.ai/server/@donghao1393/mcp-dbutils)
12
+
13
+ <!-- 技术规格徽章 -->
14
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-blue)](https://www.python.org/)
15
+ [![许可证](https://img.shields.io/github/license/donghao1393/mcp-dbutils)](LICENSE)
16
+ [![GitHub 星标](https://img.shields.io/github/stars/donghao1393/mcp-dbutils?style=social)](https://github.com/donghao1393/mcp-dbutils/stargazers)
17
+
18
+ [English](README_EN.md) | [文档导航](#文档导航)
19
+
20
+ ![Image](https://github.com/user-attachments/assets/26c4f1a1-7b19-4bdd-b9fd-34ad198b0ce3)
21
+
22
+ ## 简介
23
+
24
+ MCP Database Utilities 是一个多功能的 MCP 服务,它使您的 AI 能够通过统一的连接配置安全地访问各种类型的数据库(SQLite、MySQL、PostgreSQL 等)进行数据分析。
25
+
26
+ 您可以将其视为 AI 系统和数据库之间的安全桥梁,允许 AI 在不直接访问数据库或冒数据修改风险的情况下读取和分析您的数据。
27
+
28
+ ### 核心特性
29
+
30
+ - **安全优先**:严格只读操作,无直接数据库访问,隔离连接,按需连接,自动超时
31
+ - **隐私保障**:本地处理,最小数据暴露,凭证保护,敏感数据屏蔽
32
+ - **多数据库支持**:使用相同的接口连接 SQLite、MySQL、PostgreSQL
33
+ - **简单配置**:所有数据库连接使用单个 YAML 文件
34
+ - **高级功能**:表格浏览、架构分析和查询执行
35
+
36
+ > 🔒 **安全说明**:MCP 数据库工具采用安全优先的架构设计,非常适合注重数据保护的企业、初创公司和个人用户。详细了解我们的[安全架构](docs/zh/technical/security.md)。
37
+
38
+ ## 快速入门
39
+
40
+ 我们提供了多种安装方式,包括 uvx、Docker 和 Smithery。详细的安装和配置步骤请参阅[安装指南](docs/zh/installation.md)。
41
+
42
+ ### 基本步骤
43
+
44
+ 1. **安装**:选择适合您的安装方式([详细说明](docs/zh/installation.md))
45
+ 2. **配置**:创建包含数据库连接信息的 YAML 文件([配置指南](docs/zh/configuration.md))
46
+ 3. **连接**:将配置添加到您的 AI 客户端
47
+ 4. **使用**:开始与您的数据库交互([使用指南](docs/zh/usage.md))
48
+
49
+ ### 示例交互
50
+
51
+ **您**:"能否列出我的数据库中的所有表?"
52
+
53
+ **AI**:"以下是您的数据库中的表:
54
+ - customers(客户)
55
+ - products(产品)
56
+ - orders(订单)
57
+ - inventory(库存)"
58
+
59
+ **您**:"customers 表的结构是什么样的?"
60
+
61
+ **AI**:"customers 表有以下结构:
62
+ - id(整数,主键)
63
+ - name(文本)
64
+ - email(文本)
65
+ - registration_date(日期)"
66
+
67
+ ## 文档导航
68
+
69
+ ### 入门指南
70
+ - [安装指南](docs/zh/installation.md) - 详细的安装步骤和配置说明
71
+ - [平台特定安装指南](docs/zh/installation-platform-specific.md) - 针对不同操作系统的安装说明
72
+ - [配置指南](docs/zh/configuration.md) - 数据库连接配置示例和最佳实践
73
+ - [使用指南](docs/zh/usage.md) - 基本操作流程和常见使用场景
74
+
75
+ ### 技术文档
76
+ - [架构设计](docs/zh/technical/architecture.md) - 系统架构和组件说明
77
+ - [安全架构](docs/zh/technical/security.md) - 安全特性和保护机制
78
+ - [开发指南](docs/zh/technical/development.md) - 代码质量和开发流程
79
+ - [测试指南](docs/zh/technical/testing.md) - 测试框架和最佳实践
80
+ - [SonarCloud 集成](docs/zh/technical/sonarcloud-integration.md) - SonarCloud 与 AI 集成指南
81
+
82
+ ### 示例文档
83
+ - [SQLite 示例](docs/zh/examples/sqlite-examples.md) - SQLite 数据库操作示例
84
+ - [PostgreSQL 示例](docs/zh/examples/postgresql-examples.md) - PostgreSQL 数据库操作示例
85
+ - [MySQL 示例](docs/zh/examples/mysql-examples.md) - MySQL 数据库操作示例
86
+ - [高级 LLM 交互示例](docs/zh/examples/advanced-llm-interactions.md) - 与各类 LLM 的高级交互示例
87
+
88
+ ### 支持与反馈
89
+ - [GitHub Issues](https://github.com/donghao1393/mcp-dbutils/issues) - 报告问题或请求功能
90
+ - [Smithery](https://smithery.ai/server/@donghao1393/mcp-dbutils) - 简化安装和更新
91
+
92
+ ## 可用工具
93
+
94
+ MCP 数据库工具提供了多种工具,使 AI 能够与您的数据库交互:
95
+
96
+ - **dbutils-list-connections**:列出配置中的所有可用数据库连接
97
+ - **dbutils-list-tables**:列出数据库中的所有表
98
+ - **dbutils-run-query**:执行 SQL 查询(仅 SELECT)
99
+ - **dbutils-get-stats**:获取表统计信息
100
+ - **dbutils-list-constraints**:列出表约束
101
+ - **dbutils-explain-query**:获取查询执行计划
102
+ - **dbutils-get-performance**:获取数据库性能指标
103
+ - **dbutils-analyze-query**:分析查询以进行优化
104
+
105
+ 有关这些工具的详细说明和使用示例,请参阅[使用指南](docs/zh/usage.md)。
106
+
107
+ ## 星标历史
108
+
109
+ [![星标历史图表](https://starchart.cc/donghao1393/mcp-dbutils.svg?variant=adaptive)](https://starchart.cc/donghao1393/mcp-dbutils)
110
+
111
+ ## 许可证
112
+
113
+ 本项目采用 MIT 许可证 - 有关详细信息,请参阅 [LICENSE](LICENSE) 文件。
@@ -0,0 +1,118 @@
1
+ # MCP Database Utilities
2
+
3
+ <!-- Project Status Badges -->
4
+ [![Build Status](https://img.shields.io/github/workflow/status/donghao1393/mcp-dbutils/Quality%20Assurance?label=tests)](https://github.com/donghao1393/mcp-dbutils/actions)
5
+ [![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/donghao1393/bdd0a63ec2a816539ff8c136ceb41e48/raw/coverage.json)](https://github.com/donghao1393/mcp-dbutils/actions)
6
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=donghao1393_mcp-dbutils&metric=alert_status)](https://sonarcloud.io/dashboard?id=donghao1393_mcp-dbutils)
7
+
8
+ <!-- Version and Installation Badges -->
9
+ [![PyPI version](https://img.shields.io/pypi/v/mcp-dbutils)](https://pypi.org/project/mcp-dbutils/)
10
+ [![PyPI downloads](https://img.shields.io/pypi/dm/mcp-dbutils)](https://pypi.org/project/mcp-dbutils/)
11
+ [![Smithery](https://smithery.ai/badge/@donghao1393/mcp-dbutils)](https://smithery.ai/server/@donghao1393/mcp-dbutils)
12
+
13
+ <!-- Technical Specification Badges -->
14
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-blue)](https://www.python.org/)
15
+ [![License](https://img.shields.io/github/license/donghao1393/mcp-dbutils)](LICENSE)
16
+ [![GitHub Stars](https://img.shields.io/github/stars/donghao1393/mcp-dbutils?style=social)](https://github.com/donghao1393/mcp-dbutils/stargazers)
17
+
18
+ [中文文档](README.md) | [Documentation](#documentation)
19
+
20
+ ## Introduction
21
+
22
+ MCP Database Utilities is an all-in-one MCP service that enables your AI to do data analysis by accessing versatile types of database (SQLite, MySQL, PostgreSQL, and more) within a unified connection configuration in a safe way.
23
+
24
+ Think of it as a secure bridge between AI systems and your databases, allowing AI to read and analyze your data without direct database access or risking data modifications.
25
+
26
+ ### Key Features
27
+
28
+ - **Security First**: Strictly read-only operations, no direct database access, isolated connections, on-demand connectivity, automatic timeouts
29
+ - **Privacy Safeguards**: Local processing, minimal data exposure, credential protection, sensitive data masking
30
+ - **Multiple Database Support**: Connect to SQLite, MySQL, PostgreSQL with the same interface
31
+ - **Simple Configuration**: Single YAML file for all your database connections
32
+ - **Advanced Capabilities**: Table exploration, schema analysis, and query execution
33
+
34
+ > 🔒 **Security Note**: MCP Database Utilities is built with a security-first architecture, making it ideal for businesses, startups, and individuals who value data protection. Learn more about our [security architecture](docs/en/technical/security.md).
35
+
36
+ ## Quick Start
37
+
38
+ We offer multiple installation methods, including uvx, Docker, and Smithery. For detailed installation and configuration steps, see the [Installation Guide](docs/en/installation.md).
39
+
40
+ ### Basic Steps
41
+
42
+ 1. **Install**: Choose your preferred installation method ([detailed instructions](docs/en/installation.md))
43
+ 2. **Configure**: Create a YAML file with your database connection information ([configuration guide](docs/en/configuration.md))
44
+ 3. **Connect**: Add the configuration to your AI client
45
+ 4. **Use**: Start interacting with your databases ([usage guide](docs/en/usage.md))
46
+
47
+ ## Example Interactions
48
+
49
+ **You**: "Can you list all the tables in my my-postgres database?"
50
+
51
+ **AI**: "I'll check that for you. Here are the tables in your my-postgres database:
52
+ - customers
53
+ - products
54
+ - orders
55
+ - inventory
56
+ - employees"
57
+
58
+ **You**: "What does the customers table look like?"
59
+
60
+ **AI**: "The customers table has the following structure:
61
+ - id (integer, primary key)
62
+ - name (text)
63
+ - email (text)
64
+ - registration_date (date)
65
+ - last_purchase (date)
66
+ - total_spent (numeric)"
67
+
68
+ **You**: "How many customers made purchases in the last month?"
69
+
70
+ **AI**: "Let me run a query to find out... According to the data, 128 customers made purchases in the last month. The total value of these purchases was $25,437.82."
71
+
72
+ ## Available Tools
73
+
74
+ MCP Database Utilities provides several tools that your AI can use:
75
+
76
+ - **dbutils-list-connections**: Lists all available database connections in your configuration
77
+ - **dbutils-list-tables**: Lists all tables in a database
78
+ - **dbutils-run-query**: Executes a SQL query (SELECT only)
79
+ - **dbutils-get-stats**: Gets statistics about a table
80
+ - **dbutils-list-constraints**: Lists table constraints
81
+ - **dbutils-explain-query**: Gets query execution plan
82
+ - **dbutils-get-performance**: Gets database performance metrics
83
+ - **dbutils-analyze-query**: Analyzes queries for optimization
84
+
85
+
86
+
87
+ ## Documentation
88
+
89
+ ### Getting Started
90
+ - [Installation Guide](docs/en/installation.md) - Detailed installation steps and configuration instructions
91
+ - [Platform-Specific Installation Guide](docs/en/installation-platform-specific.md) - Installation instructions for different operating systems
92
+ - [Configuration Guide](docs/en/configuration.md) - Database connection configuration examples and best practices
93
+ - [Usage Guide](docs/en/usage.md) - Basic workflow and common usage scenarios
94
+
95
+ ### Technical Documentation
96
+ - [Architecture Design](docs/en/technical/architecture.md) - System architecture and components
97
+ - [Security Architecture](docs/en/technical/security.md) - Security features and protection mechanisms
98
+ - [Development Guide](docs/en/technical/development.md) - Code quality and development workflow
99
+ - [Testing Guide](docs/en/technical/testing.md) - Testing framework and best practices
100
+ - [SonarCloud Integration](docs/en/technical/sonarcloud-integration.md) - SonarCloud and AI integration guide
101
+
102
+ ### Example Documentation
103
+ - [SQLite Examples](docs/en/examples/sqlite-examples.md) - SQLite database operation examples
104
+ - [PostgreSQL Examples](docs/en/examples/postgresql-examples.md) - PostgreSQL database operation examples
105
+ - [MySQL Examples](docs/en/examples/mysql-examples.md) - MySQL database operation examples
106
+ - [Advanced LLM Interactions](docs/en/examples/advanced-llm-interactions.md) - Advanced interaction examples with various LLMs
107
+
108
+ ### Support & Feedback
109
+ - [GitHub Issues](https://github.com/donghao1393/mcp-dbutils/issues) - Report issues or request features
110
+ - [Smithery](https://smithery.ai/server/@donghao1393/mcp-dbutils) - Simplified installation and updates
111
+
112
+ ## Star History
113
+
114
+ [![Star History Chart](https://starchart.cc/donghao1393/mcp-dbutils.svg?variant=adaptive)](https://starchart.cc/donghao1393/mcp-dbutils)
115
+
116
+ ## License
117
+
118
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,87 @@
1
+ # 文档一致性检查报告
2
+
3
+ 本报告记录了对 MCP 数据库工具文档的一致性检查结果,旨在确保所有文档符合统一的标准和风格。
4
+
5
+ ## 检查标准
6
+
7
+ 检查基于以下标准:
8
+
9
+ 1. **格式一致性**
10
+ - 标题层级使用(# 一级标题,## 二级标题,等)
11
+ - 代码块使用 ```语言 格式
12
+ - 列表格式统一(有序/无序)
13
+ - 表格格式统一
14
+
15
+ 2. **术语一致性**
16
+ - 产品名称:统一使用"MCP 数据库工具"或"MCP Database Utilities"
17
+ - 技术术语:确保相同概念使用相同术语
18
+
19
+ 3. **风格一致性**
20
+ - 语气:保持专业、清晰、简洁
21
+ - 表达方式:使用主动语态
22
+ - 示例风格:保持一致的示例格式
23
+
24
+ 4. **链接一致性**
25
+ - 确保所有内部链接有效
26
+ - 确保所有外部链接有效
27
+ - 链接文本描述性强
28
+
29
+ 5. **内容完整性**
30
+ - 中英文文档内容对应
31
+ - 文档覆盖所有必要信息
32
+
33
+ ## 检查结果
34
+
35
+ ### 中文文档
36
+
37
+ | 文档 | 格式一致性 | 术语一致性 | 风格一致性 | 链接一致性 | 内容完整性 | 需要改进的地方 |
38
+ |------|------------|------------|------------|------------|------------|----------------|
39
+ | docs/zh/configuration.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
40
+ | docs/zh/installation.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
41
+ | docs/zh/usage.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
42
+ | docs/zh/technical/architecture.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
43
+ | docs/zh/technical/security.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
44
+ | docs/zh/technical/development.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
45
+ | docs/zh/technical/testing.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
46
+ | docs/zh/technical/sonarcloud-integration.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
47
+ | docs/zh/examples/sqlite-examples.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
48
+ | docs/zh/examples/postgresql-examples.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
49
+ | docs/zh/examples/mysql-examples.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
50
+
51
+ ### 英文文档
52
+
53
+ | 文档 | 格式一致性 | 术语一致性 | 风格一致性 | 链接一致性 | 内容完整性 | 需要改进的地方 |
54
+ |------|------------|------------|------------|------------|------------|----------------|
55
+ | docs/en/configuration.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
56
+ | docs/en/installation.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
57
+ | docs/en/usage.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
58
+ | docs/en/technical/architecture.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
59
+ | docs/en/technical/security.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
60
+ | docs/en/technical/development.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
61
+ | docs/en/technical/testing.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
62
+ | docs/en/technical/sonarcloud-integration.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
63
+ | docs/en/examples/sqlite-examples.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
64
+ | docs/en/examples/postgresql-examples.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
65
+ | docs/en/examples/mysql-examples.md | ✅ | ✅ | ✅ | ✅ | ✅ | 无 |
66
+
67
+ ## 总体评估
68
+
69
+ 经过检查,我们的文档整体一致性良好。在最近的文档重组过程中,我们已经解决了大部分一致性问题,包括:
70
+
71
+ 1. 统一了文档结构,按照语言和文档类型进行分类
72
+ 2. 统一了文档格式,包括标题层级、代码块、列表和表格格式
73
+ 3. 统一了术语使用,确保相同概念使用相同术语
74
+ 4. 统一了文档风格,保持专业、清晰、简洁的语气
75
+ 5. 确保了所有链接的有效性
76
+ 6. 确保了中英文文档内容的对应性
77
+
78
+ ## 建议
79
+
80
+ 虽然当前文档已经具有良好的一致性,但我们仍可以考虑以下改进:
81
+
82
+ 1. **添加文档版本信息**:在每个文档顶部添加版本号和最后更新日期
83
+ 2. **添加视觉元素**:在适当的地方添加图表、流程图等视觉元素,提升文档可读性
84
+ 3. **添加平台特定指南**:为不同操作系统创建专门的安装和配置指南
85
+ 4. **丰富交互示例**:添加更多与各类 LLM 交互的示例,展示产品的潜力
86
+
87
+ 这些改进将在后续工作中逐步实施。
@@ -0,0 +1,69 @@
1
+ # 文档版本历史
2
+
3
+ 本文件记录了 MCP 数据库工具文档的版本历史和重要更新。
4
+
5
+ ## 版本命名规则
6
+
7
+ 文档版本使用以下格式:`vX.Y.Z`,其中:
8
+
9
+ - `X`:主版本号,表示重大结构或内容变更
10
+ - `Y`:次版本号,表示功能添加或重要内容更新
11
+ - `Z`:修订版本号,表示错误修复或小幅内容改进
12
+
13
+ ## 版本历史
14
+
15
+ ### v1.0.0 (2024-04-24)
16
+
17
+ **主要更新**:
18
+ - 完成文档重组,按照语言(中英文)和文档类型进行分类
19
+ - 创建了详细的 PostgreSQL 和 MySQL 示例文档
20
+ - 整合 STYLE_GUIDE.md 到开发指南中
21
+ - 将 technical-guide.md 的内容分解到各个技术文档中
22
+ - 处理 SonarCloud 集成文档,创建中英文版本
23
+ - 更新 README 中的文档链接
24
+
25
+ **新增文档**:
26
+ - docs/zh/examples/postgresql-examples.md
27
+ - docs/zh/examples/mysql-examples.md
28
+ - docs/en/examples/postgresql-examples.md
29
+ - docs/en/examples/mysql-examples.md
30
+ - docs/zh/technical/sonarcloud-integration.md
31
+ - docs/en/technical/sonarcloud-integration.md
32
+
33
+ **删除文档**:
34
+ - docs/STYLE_GUIDE.md
35
+ - docs/technical-guide.md
36
+ - docs/configuration-examples.md
37
+ - docs/sonarcloud-ai-integration.md
38
+
39
+ ### v1.1.0 (2024-04-25)
40
+
41
+ **主要更新**:
42
+ - 添加平台特定安装指南,针对不同操作系统提供详细安装说明
43
+ - 创建高级 LLM 交互示例文档,展示与各类 LLM 的交互潜力
44
+ - 进行文档一致性检查,确保所有文档符合统一标准
45
+ - 实施文档版本控制,添加版本信息和更新历史
46
+ - 更新 README 中的文档链接
47
+
48
+ **新增文档**:
49
+ - docs/zh/installation-platform-specific.md
50
+ - docs/en/installation-platform-specific.md
51
+ - docs/zh/examples/advanced-llm-interactions.md
52
+ - docs/en/examples/advanced-llm-interactions.md
53
+ - docs/document-consistency-check.md
54
+ - docs/document-version-history.md
55
+
56
+ ## 文档维护指南
57
+
58
+ ### 更新文档版本
59
+
60
+ 当对文档进行更新时,请遵循以下步骤:
61
+
62
+ 1. 确定更新的性质(主要结构变更、功能添加或错误修复)
63
+ 2. 根据更新性质,增加相应的版本号
64
+ 3. 在本文件中添加新版本的条目,记录主要更新内容和变更的文件
65
+ 4. 在更新的文档顶部更新版本号和最后更新日期
66
+
67
+ ### 文档版本与软件版本的关系
68
+
69
+ 文档版本与软件版本保持独立,但应在文档中明确说明其适用的软件版本范围。当软件发布新版本时,应相应地更新文档,并在版本历史中注明。