SmartDB_MCP
by wenb1n-dev·★ 79·综合分 43
通用数据库MCP服务器,支持多种数据库连接,具有OAuth2认证、健康检查、SQL优化和索引健康检测功能。
概述
SmartDB是一个全面的MCP服务器,提供跨多个主要数据库系统的通用数据库连接,包括MySQL、PostgreSQL、SQL Server、MariaDB、DM8和Oracle。与其他数据库工具不同的是,它集成了高级功能,如OAuth 2.0认证、全面的健康检查、SQL优化建议和索引健康监控。该服务器支持多种连接模式,包括stdio、sse和streamableHttp,使其适用于不同的集成场景。工具集包括SQL执行、数据库健康分析、表结构探索、索引管理、SQL生成和优化功能。
试试问 AI
装完之后,这里有 6 个你可以让 AI 做的事:
什么时候选它
当您需要统一接口连接多个数据库系统,并具有SQL优化和健康监控等高级功能时,选择SmartDB,特别是在只读访问场景中。
什么时候不要选它
如果您需要频繁的写入权限或管理功能,不要选择SmartDB,因为它主要专注于只读和读写场景,管理功能有限。
此 server 暴露的工具
从 README 抽取出 8 个工具execute_sqlExecute SQL commands (SELECT, SHOW, DESCRIBE, EXPLAIN, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE)
get_db_healthAnalyze database health status and provide diagnostic reports
get_table_descSearch for table structures in the database
get_table_indexSearch for table indexes in the database
get_table_nameQuery all table names in the database or search by name/description
get_db_versionQuery database version information
sql_creatorGenerate SQL queries based on different database types
sql_optimizeOptimize SQL performance with expert suggestions
可对比工具
安装
安装
pip安装
pip install SmartDB-MCP
smartdb --envfile=/path/to/.env --oauth=trueDocker安装
docker-compose up -d本地开发
uv sync
uv run -m core.server --mode stdioClaude Desktop配置
添加到claude_desktop_config.json中:
{
"mcpServers": {
"smartdb": {
"name": "smartdb",
"type": "stdio",
"command": "uv",
"args": [
"--directory",
"/path/to/SmartDB/",
"run",
"-m",
"core.server",
"--mode",
"stdio"
],
"env": {
"DATABASE_CONFIG_FILE": "/path/to/database_config.json"
}
}
}
}FAQ
- SmartDB支持哪些数据库?
- SmartDB支持MySQL、PostgreSQL、SQL Server、MariaDB、DM8和Oracle数据库。
- SmartDB是否支持OAuth认证?
- 是的,SmartDB支持OAuth 2.0认证,用于安全的数据库访问,特别是在使用streamableHttp模式时。
- 支持哪些不同的连接模式?
- SmartDB支持三种连接模式:stdio、sse(服务器发送事件)和streamableHttp,可灵活地与不同客户端集成。
SmartDB_MCP 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。