{"id":26362291,"url":"https://github.com/bytebase/dbhub","last_synced_at":"2026-08-27T15:08:00.960Z","repository":{"id":281521195,"uuid":"945530209","full_name":"bytebase/dbhub","owner":"bytebase","description":"Token conscious database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.","archived":false,"fork":false,"pushed_at":"2026-08-21T05:20:06.000Z","size":3644,"stargazers_count":3388,"open_issues_count":1,"forks_count":290,"subscribers_count":19,"default_branch":"main","last_synced_at":"2026-08-22T03:29:53.907Z","etag":null,"topics":["agents","ai","anthropic","claude","claude-ai","codex","cursor","database","dify","llm","mariadb","mcp","mcp-server","mssql","mysql","postgres","postgresql","sql","sqlite","sqlserver"],"latest_commit_sha":null,"homepage":"https://dbhub.ai","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bytebase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-09T16:36:38.000Z","updated_at":"2026-08-21T14:55:25.000Z","dependencies_parsed_at":"2025-12-03T23:00:37.845Z","dependency_job_id":null,"html_url":"https://github.com/bytebase/dbhub","commit_stats":null,"previous_names":["bytebase/dbx","bytebase/dbhub"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bytebase/dbhub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fdbhub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fdbhub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fdbhub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fdbhub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bytebase","download_url":"https://codeload.github.com/bytebase/dbhub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bytebase%2Fdbhub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36943328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-22T15:14:58.755Z","status":"online","status_checked_at":"2026-08-27T02:00:07.166Z","response_time":96,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","ai","anthropic","claude","claude-ai","codex","cursor","database","dify","llm","mariadb","mcp","mcp-server","mssql","mysql","postgres","postgresql","sql","sqlite","sqlserver"],"created_at":"2025-03-16T18:01:32.316Z","updated_at":"2026-08-27T15:08:00.955Z","avatar_url":"https://github.com/bytebase.png","language":"TypeScript","funding_links":[],"categories":["Databases","Database \u0026 Messaging MCP Servers","\u003cimg src=\"./assets/satellite.svg\" width=\"16\" height=\"16\" style=\"vertical-align: middle;\"\u003e Satellites","Community Servers","TypeScript","📚 Projects (1974 total)","📦 Other","Legend","Tools","APIs and HTTP Requests","sqlserver","Agent Integration \u0026 Deployment Tools","MCP Servers","🗄️ Databases","MCP Ecosystem","Contributing","⚙️ Engineering / Dev","Table of Contents","🗂️ Extensions by Category","Other","MCP Servers \u0026 Protocol","Database (11 servers)","Server Implementations","🤖 AI, ML \u0026 Deep Learning","Servers"],"sub_categories":["Multi-Database Tools","MCP Servers","🗄️ \u003ca name=\"databases\"\u003e\u003c/a\u003eDatabases","Model Context Protocol","How to Submit","MCP Server Framework","Databases","Servers","🗄️ Databases","Database \u0026 ORM","General Utility MCPs","Business and Productivity","Data \u0026 Databases"],"readme":"\u003e [!NOTE]  \n\u003e Brought to you by [Bytebase](https://www.bytebase.com/), open-source database governance platform.\n\n\u003cp align=\"center\"\u003e\n \u003ca href=\"https://www.star-history.com/bytebase/dbhub\"\u003e\n  \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/badge?repo=bytebase/dbhub\u0026type=trending\u0026theme=dark\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/badge?repo=bytebase/dbhub\u0026type=trending\" /\u003e\n   \u003cimg alt=\"GitHub Trending Repository of the Day\" src=\"https://api.star-history.com/badge?repo=bytebase/dbhub\u0026type=trending\" /\u003e\n  \u003c/picture\u003e\n \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://dbhub.ai/\" target=\"_blank\"\u003e\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/bytebase/dbhub/main/docs/images/logo/full-dark.svg\" width=\"75%\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/bytebase/dbhub/main/docs/images/logo/full-light.svg\" width=\"75%\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/bytebase/dbhub/main/docs/images/logo/full-light.svg\" width=\"75%\" alt=\"DBHub Logo\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n```bash\n            +------------------+    +--------------+    +------------------+\n            |                  |    |              |    |                  |\n            |                  |    |              |    |                  |\n            |  Claude Desktop  +---\u003e+              +---\u003e+    PostgreSQL    |\n            |                  |    |              |    |                  |\n            |  Claude Code     +---\u003e+              +---\u003e+    SQL Server    |\n            |                  |    |              |    |                  |\n            |  Cursor          +---\u003e+    DBHub     +---\u003e+    SQLite        |\n            |                  |    |              |    |                  |\n            |  VS Code         +---\u003e+              +---\u003e+    MySQL         |\n            |                  |    |              |    |                  |\n            |  Copilot CLI     +---\u003e+              +---\u003e+    MariaDB       |\n            |                  |    |              |    |                  |\n            |                  |    |              |    |                  |\n            +------------------+    +--------------+    +------------------+\n                 MCP Clients           MCP Server             Databases\n```\n\nDBHub is a minimal MCP server: token-efficient, zero-dependency, and just two tools by default with opt-in extras. This lightweight gateway allows MCP-compatible clients to connect to and explore different databases:\n\n- **Minimal**: Zero dependency, token efficient with a minimal set of MCP tools to maximize context window\n- **Multi-Database**: PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite through a single interface\n- **Multi-Connection**: Connect to multiple databases simultaneously with TOML configuration\n- **Guardrails**: Read-only mode, row limiting, and query timeout to prevent runaway operations\n- **Secure Access**: SSH tunneling and SSL/TLS encryption\n\n\u003e DBHub is the official example in the [Claude Code docs](https://code.claude.com/docs/en/mcp#example-query-your-postgresql-database) for connecting to PostgreSQL via MCP.\n\n## Token Efficiency\n\nDBHub loads just 2 tools by default at **1.4k tokens** — 13-14x fewer than alternatives — keeping the context window open for your actual work.\n\n| MCP Server | Default Config | Default Tools |\n|------------|---------------|--------------|\n| **DBHub** | **1.4k** | 2 (`execute_sql`, `search_objects`) |\n| MCP Toolbox | 19.0k | 28 |\n| Supabase MCP | 19.3k | all |\n\n## Use Cases\n\n- **Local Development**: Schema exploration, query validation, and data debugging with Claude Code, VS Code, Cursor, etc.\n- **Non-Technical Access**: Expose curated, read-only views to non-technical staff via Claude Desktop, VS Code, Cursor, etc.\n- **Multi-Database Consolidation**: Replace separate MCP servers for each database with a single DBHub process\n- **Production Troubleshooting**: Read-only diagnostics with guardrails against runaway queries\n\n## Supported Databases\n\nPostgreSQL, MySQL, SQL Server, MariaDB, and SQLite.\n\n## MCP Tools\n\nDBHub implements MCP tools for database operations:\n\n- **[execute_sql](https://dbhub.ai/tools/execute-sql)**: Execute SQL queries with transaction support and safety controls\n- **[search_objects](https://dbhub.ai/tools/search-objects)**: Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure\n- **[explain_sql](https://dbhub.ai/tools/explain-sql)** (opt-in): Show a query's execution plan without running it\n- **[health_check](https://dbhub.ai/tools/health-check)** (opt-in): Report connection pool state and buffer cache hit ratio\n- **[Custom Tools](https://dbhub.ai/tools/custom-tools)**: Define reusable, parameterized SQL operations in your `dbhub.toml` configuration file\n\n## Workbench\n\nDBHub includes a [built-in web interface](https://dbhub.ai/workbench/overview) for interacting with your database tools. It provides a visual way to execute queries, run custom tools, and view request traces without requiring an MCP client.\n\n![workbench](https://raw.githubusercontent.com/bytebase/dbhub/main/docs/images/workbench/workbench.webp)\n\n## Installation\n\n```bash\nnpx @bytebase/dbhub@latest --transport http --port 8080 --dsn \"postgres://user:password@localhost:5432/dbname?sslmode=disable\"\n```\n\nAlso available as:\n\n- [Docker image](https://dbhub.ai/installation#docker)\n- [MCP Bundle](https://dbhub.ai/mcpb) (one-click install, read-only)\n- [Claude Code plugin](https://dbhub.ai/claude-code-plugin)\n\nSee the [Installation Guide](https://dbhub.ai/installation) for all options, [Command-Line Options](https://dbhub.ai/config/command-line) for parameters, and [Multi-Database Configuration](https://dbhub.ai/config/toml) for connecting several databases at once.\n\n## Development\n\nRequires Node.js \u003e= 22.5.0 (DBHub uses the built-in `node:sqlite` module).\n\n```bash\n# Install dependencies\npnpm install\n\n# Run in development mode\npnpm dev\n\n# Build and run for production\npnpm build \u0026\u0026 pnpm start --transport stdio --dsn \"postgres://user:password@localhost:5432/dbname\"\n```\n\nSee [Testing](.claude/skills/testing/SKILL.md) and [Debug](https://dbhub.ai/config/debug).\n\n## Contributors\n\n\u003ca href=\"https://github.com/bytebase/dbhub/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=bytebase/dbhub\" /\u003e\n\u003c/a\u003e\n\n## Star History\n\n\u003ca href=\"https://www.star-history.com/?repos=bytebase%2Fdbhub\u0026type=date\u0026legend=top-left\"\u003e\n \u003cpicture\u003e\n   \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/chart?repos=bytebase/dbhub\u0026type=date\u0026theme=dark\u0026legend=top-left\" /\u003e\n   \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/chart?repos=bytebase/dbhub\u0026type=date\u0026legend=top-left\" /\u003e\n   \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/chart?repos=bytebase/dbhub\u0026type=date\u0026legend=top-left\" /\u003e\n \u003c/picture\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebase%2Fdbhub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbytebase%2Fdbhub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbytebase%2Fdbhub/lists"}