# SmartDB_MCP — Universal Database MCP Gateway > Universal database MCP gateway (MySQL/Postgres/Oracle/SQL Server) with role-based SQL permissions + health checks; verified 79★, pushed 2025-09-14. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use ```bash pip install SmartDB-MCP # Example start (README): smartdb --envfile=./.env --oauth=true # Or Docker quick start: docker-compose up -d ``` ## Intro Universal database MCP gateway (MySQL/Postgres/Oracle/SQL Server) with role-based SQL permissions + health checks; verified 79★, pushed 2025-09-14. **Best for:** Teams who want a single MCP gateway for multiple databases with explicit role permissions (readonly/writer/admin) **Works with:** Multiple DBs (README list includes MySQL/PostgreSQL/Oracle/SQL Server) and MCP clients (stdio/sse/streamableHTTP) **Setup time:** 20-40 minutes ### Key facts (verified) - GitHub: 79 stars · 18 forks · pushed 2025-09-14. - License: MIT · owner avatar + repo URL verified via GitHub API. - README-backed entrypoint: `pip install SmartDB-MCP`. ## Main - Start with a readonly role: README’s permission examples list SELECT/SHOW/DESCRIBE/EXPLAIN as the safe baseline for agent DB access. - Promote to writer/admin only for scoped tasks: keep agent workflows narrow and require human approval for schema changes. - Use it as a gateway, not a superuser: store DB creds in an envfile and mount config as read-only where possible. - Pair it with query review: use EXPLAIN + index/health tools (as listed in README tool list) before running heavy statements. ### Source-backed notes - README lists supported databases and includes a tool list (execute_sql, health checks, schema/index tools, SQL optimize, etc.). - README shows pip install: `pip install SmartDB-MCP` and a start command example using `smartdb --envfile=... --oauth=true`. - README shows role permission control examples for readonly/writer/admin SQL command sets. ### FAQ - **Can I force read-only access?**: Yes — README includes a readonly permission set limited to SELECT/SHOW/DESCRIBE/EXPLAIN. - **Which transport modes are supported?**: README mentions stdio, sse, and streamableHTTP modes. - **How do I deploy quickly?**: README provides docker-compose steps (up/ps/logs) and a manual docker build/run example. ## Source & Thanks > Source: https://github.com/wenb1n-dev/smartdb_mcp > License: MIT > GitHub stars: 79 · forks: 18 --- ## Quick Use ```bash pip install SmartDB-MCP # Example start (README): smartdb --envfile=./.env --oauth=true # Or Docker quick start: docker-compose up -d ``` ## Intro SmartDB_MCP 是通用数据库 MCP 网关(MySQL/PostgreSQL/Oracle/SQL Server 等),支持角色权限控制、健康检查与 SQL 辅助工具;已验证 79★,更新于 2025-09-14。 **Best for:** 需要用一个 MCP 网关统一接入多种数据库,并用角色权限明确约束 SQL 能力的团队 **Works with:** 多种数据库(README 列出 MySQL/PostgreSQL/Oracle/SQL Server 等)与 MCP 客户端(stdio/sse/streamableHTTP) **Setup time:** 20-40 minutes ### Key facts (verified) - GitHub:79 stars · 18 forks;最近更新 2025-09-14。 - 许可证:MIT;作者头像与仓库链接均已通过 GitHub API 复核。 - README 中可对照的入口命令:`pip install SmartDB-MCP`。 ## Main - 默认只读最安全:README 的权限示例把 SELECT/SHOW/DESCRIBE/EXPLAIN 作为 readonly 基线,适合作为 agent 的默认 DB 权限。 - writer/admin 必须收敛范围:仅在明确需求时提升权限,并对 schema 类变更增加人工审批。 - 把它当网关而不是超管:凭据放 envfile;配置尽量只读挂载,避免被 agent 或第三方篡改。 - 配合查询 review:在执行重查询前先用 EXPLAIN,并结合 README 工具列表中的健康/索引能力做检查。 ### Source-backed notes - README 列出支持的数据库,并给出工具列表(execute_sql、健康检查、表结构/索引、SQL 优化等)。 - README 给出 pip 安装 `pip install SmartDB-MCP`,以及启动示例 `smartdb --envfile=... --oauth=true`。 - README 提供 readonly/writer/admin 的 SQL 权限集合示例。 ### FAQ - **能强制只读吗?**:可以;README 给出 readonly 权限集合,仅包含 SELECT/SHOW/DESCRIBE/EXPLAIN。 - **支持哪些传输模式?**:README 提到 stdio、sse、streamableHTTP。 - **怎么最快部署?**:README 提供 docker-compose 的 Quick Start(up/ps/logs),也有手动构建镜像示例。 ## Source & Thanks > Source: https://github.com/wenb1n-dev/smartdb_mcp > License: MIT > GitHub stars: 79 · forks: 18 --- Source: https://tokrepo.com/en/workflows/smartdb-mcp-universal-database-mcp-gateway Author: MCP Hub