# 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. --- ## Quick Use Run directly (no install): ```bash npx @bytebase/dbhub --transport http --port 8080 --dsn "postgres://user:pass@host/db" ``` Or try the demo: ```bash npx @bytebase/dbhub --transport http --port 8080 --demo ``` --- ## 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 using just two MCP tools — keeping your context window clean. Built-in safety includes read-only mode, row limits, and query timeouts. Created by the Bytebase team. --- ## DBHub — Connect AI to Your Database ### Supported Databases PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite — all fully supported. ### Safety Features - **Read-only mode** — prevents accidental writes - **Row limits** — caps result-set size - **Query timeouts** — prevents runaway queries --- ## Source & Thanks > Created by [Bytebase](https://github.com/bytebase). Licensed under MIT. > > [dbhub](https://github.com/bytebase/dbhub) — ⭐ 2,500+ --- Source: https://tokrepo.com/en/workflows/dbhub-universal-database-mcp-server-zero-dependencies-943f4349 Author: TokRepo精选