# DBHub — Universal Database MCP Server, Zero Dependencies > Token-efficient database MCP server supporting Postgres, MySQL, MariaDB, SQL Server, and SQLite. Just two MCP tools, zero dependencies, read-only safe. ## Install Merge the JSON below into your `.mcp.json`: ## Quick Use Run with npx (no install): ```bash npx @bytebase/dbhub --transport http --port 8080 --dsn "postgres://user:pass@host/db" ``` Or try the demo instantly: ```bash npx @bytebase/dbhub --transport http --port 8080 --demo ``` Add to your `.mcp.json`: ```json { "mcpServers": { "dbhub": { "command": "npx", "args": ["@bytebase/dbhub", "--transport", "stdio", "--dsn", "postgres://user:pass@host/db"] } } } ``` --- ## Intro DBHub is a zero-dependency, token-efficient database MCP server with 2,500+ GitHub stars. It supports PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite with just two MCP tools — keeping your context window clean. Built-in safety features include read-only mode, row limiting, and query timeout. Created by Bytebase, the team behind the popular database DevOps platform. Best for: developers who want AI agents to query and explore databases safely. Works with: Claude Code, Cursor, any MCP client. Setup time: under 1 minute. --- ## DBHub — AI Meets Your Database ### Supported Databases | Database | Status | |----------|--------| | PostgreSQL | ✅ | | MySQL | ✅ | | MariaDB | ✅ | | SQL Server | ✅ | | SQLite | ✅ | ### Why Only Two Tools? Most database MCP servers expose dozens of tools, consuming precious context window tokens. DBHub takes a minimalist approach with just two tools, maximizing the space available for your actual queries and results. ### Safety Features - **Read-only mode** — Prevent accidental writes - **Row limiting** — Cap result set sizes - **Query timeout** — Prevent runaway queries - **SSL/TLS** — Encrypted connections - **SSH tunneling** — Secure access to remote databases ### Installation Options ```bash # NPX (recommended) npx @bytebase/dbhub --transport http --port 8080 --dsn "postgres://..." # Docker docker run --rm --init --name dbhub \ --publish 8080:8080 bytebase/dbhub \ --transport http --port 8080 --dsn "postgres://..." # Multi-database via TOML config npx @bytebase/dbhub --transport http --port 8080 --config databases.toml ``` ### Multi-Database Config ```toml [[databases]] name = "production" dsn = "postgres://user:pass@prod-host/mydb" [[databases]] name = "analytics" dsn = "mysql://user:pass@analytics-host/warehouse" ``` ### FAQ **Q: What is DBHub?** A: DBHub is a zero-dependency database MCP server that connects AI agents to PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite using just two token-efficient MCP tools. **Q: Is DBHub free?** A: Yes, DBHub is free and open source under the MIT license. **Q: Is it safe to connect AI to my database?** A: DBHub includes read-only mode, row limits, and query timeouts to prevent accidental data modification or runaway queries. --- ## Source & Thanks > Created by [Bytebase](https://github.com/bytebase). Licensed under MIT. > > [dbhub](https://github.com/bytebase/dbhub) — ⭐ 2,500+ Thank you for making database access safe and efficient for AI agents. --- ## 快速使用 直接运行(无需安装): ```bash npx @bytebase/dbhub --transport http --port 8080 --dsn "postgres://user:pass@host/db" ``` 或体验演示: ```bash npx @bytebase/dbhub --transport http --port 8080 --demo ``` --- ## 简介 DBHub 是一个零依赖、Token 高效的数据库 MCP 服务器,拥有 2,500+ GitHub stars。支持 PostgreSQL、MySQL、MariaDB、SQL Server 和 SQLite,仅使用两个 MCP 工具——保持上下文窗口干净。内置安全特性包括只读模式、行数限制和查询超时。由 Bytebase 团队创建。 --- ## DBHub — AI 连接你的数据库 ### 支持的数据库 PostgreSQL、MySQL、MariaDB、SQL Server、SQLite 全部支持。 ### 安全特性 - **只读模式** — 防止意外写入 - **行数限制** — 限制结果集大小 - **查询超时** — 防止失控查询 --- ## 来源与感谢 > Created by [Bytebase](https://github.com/bytebase). Licensed under MIT. > > [dbhub](https://github.com/bytebase/dbhub) — ⭐ 2,500+ --- Source: https://tokrepo.com/en/workflows/943f4349-7127-400b-9cd3-bbb8f67982a3 Author: TokRepo精选