badger-db-mcp 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +120 -0
  3. package/package.json +93 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Bytebase
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ > [!NOTE]
2
+ > Brought to you by [Bytebase](https://www.bytebase.com/), open-source database DevSecOps platform.
3
+
4
+ <p align="center">
5
+ <a href="https://dbhub.ai/" target="_blank">
6
+ <picture>
7
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/bytebase/dbhub/main/docs/images/logo/full-dark.svg" width="75%">
8
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/bytebase/dbhub/main/docs/images/logo/full-light.svg" width="75%">
9
+ <img src="https://raw.githubusercontent.com/bytebase/dbhub/main/docs/images/logo/full-light.svg" width="75%" alt="DBHub Logo">
10
+ </picture>
11
+ </a>
12
+ </p>
13
+
14
+ ```bash
15
+ +------------------+ +--------------+ +------------------+
16
+ | | | | | |
17
+ | | | | | |
18
+ | Claude Desktop +--->+ +--->+ PostgreSQL |
19
+ | | | | | |
20
+ | Claude Code +--->+ +--->+ SQL Server |
21
+ | | | | | |
22
+ | Cursor +--->+ DBHub +--->+ SQLite |
23
+ | | | | | |
24
+ | VS Code +--->+ +--->+ MySQL |
25
+ | | | | | |
26
+ | Copilot CLI +--->+ +--->+ MariaDB |
27
+ | | | | | |
28
+ | | | | | |
29
+ +------------------+ +--------------+ +------------------+
30
+ MCP Clients MCP Server Databases
31
+ ```
32
+
33
+ DBHub is a zero-dependency, token efficient MCP server implementing the Model Context Protocol (MCP) server interface. This lightweight gateway allows MCP-compatible clients to connect to and explore different databases:
34
+
35
+ - **Local Development First**: Zero dependency, token efficient with just two MCP tools to maximize context window
36
+ - **Multi-Database**: PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite through a single interface
37
+ - **Multi-Connection**: Connect to multiple databases simultaneously with TOML configuration
38
+ - **Guardrails**: Read-only mode, row limiting, and query timeout to prevent runaway operations
39
+ - **Secure Access**: SSH tunneling and SSL/TLS encryption
40
+
41
+ ## Supported Databases
42
+
43
+ PostgreSQL, MySQL, SQL Server, MariaDB, and SQLite.
44
+
45
+ ## MCP Tools
46
+
47
+ DBHub implements MCP tools for database operations:
48
+
49
+ - **[execute_sql](https://dbhub.ai/tools/execute-sql)**: Execute SQL queries with transaction support and safety controls
50
+ - **[search_objects](https://dbhub.ai/tools/search-objects)**: Search and explore database schemas, tables, columns, indexes, and procedures with progressive disclosure
51
+ - **[Custom Tools](https://dbhub.ai/tools/custom-tools)**: Define reusable, parameterized SQL operations in your `dbhub.toml` configuration file
52
+
53
+ ## Workbench
54
+
55
+ DBHub 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.
56
+
57
+ ![workbench](https://raw.githubusercontent.com/bytebase/dbhub/main/docs/images/workbench/workbench.webp)
58
+
59
+ ## Installation
60
+
61
+ See the full [Installation Guide](https://dbhub.ai/installation) for detailed instructions.
62
+
63
+ ### Quick Start
64
+
65
+ **Docker:**
66
+
67
+ ```bash
68
+ docker run --rm --init \
69
+ --name dbhub \
70
+ --publish 8080:8080 \
71
+ bytebase/dbhub \
72
+ --transport http \
73
+ --port 8080 \
74
+ --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
75
+ ```
76
+
77
+ **NPM:**
78
+
79
+ ```bash
80
+ npx @bytebase/dbhub@latest --transport http --port 8080 --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"
81
+ ```
82
+
83
+ **Demo Mode:**
84
+
85
+ ```bash
86
+ npx @bytebase/dbhub@latest --transport http --port 8080 --demo
87
+ ```
88
+
89
+ See [Command-Line Options](https://dbhub.ai/config/command-line) for all available parameters.
90
+
91
+ ### Multi-Database Setup
92
+
93
+ Connect to multiple databases simultaneously using TOML configuration files. Perfect for managing production, staging, and development databases from a single DBHub instance.
94
+
95
+ See [Multi-Database Configuration](https://dbhub.ai/config/toml) for complete setup instructions.
96
+
97
+ ## Development
98
+
99
+ ```bash
100
+ # Install dependencies
101
+ pnpm install
102
+
103
+ # Run in development mode
104
+ pnpm dev
105
+
106
+ # Build and run for production
107
+ pnpm build && pnpm start --transport stdio --dsn "postgres://user:password@localhost:5432/dbname"
108
+ ```
109
+
110
+ See [Testing](.claude/skills/testing/SKILL.md) and [Debug](https://dbhub.ai/config/debug).
111
+
112
+ ## Contributors
113
+
114
+ <a href="https://github.com/bytebase/dbhub/graphs/contributors">
115
+ <img src="https://contrib.rocks/image?repo=bytebase/dbhub" />
116
+ </a>
117
+
118
+ ## Star History
119
+
120
+ ![Star History Chart](https://api.star-history.com/svg?repos=bytebase/dbhub&type=Date)
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "badger-db-mcp",
3
+ "version": "0.19.0",
4
+ "mcpName": "badger-db-mcp",
5
+ "description": "Badger DB MCP — minimal, token-efficient Database MCP Server for PostgreSQL, MySQL, SQL Server, SQLite, MariaDB",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/ajgreyling/badger-db-mcp.git"
9
+ },
10
+ "bugs": "https://github.com/ajgreyling/badger-db-mcp/issues",
11
+ "homepage": "https://github.com/ajgreyling/badger-db-mcp#readme",
12
+ "main": "dist/index.js",
13
+ "type": "module",
14
+ "bin": {
15
+ "badger-db-mcp": "dist/index.js"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "LICENSE",
20
+ "README.md"
21
+ ],
22
+ "engines": {
23
+ "node": ">=20"
24
+ },
25
+ "keywords": [],
26
+ "author": "",
27
+ "license": "MIT",
28
+ "dependencies": {
29
+ "@aws-sdk/rds-signer": "^3.1001.0",
30
+ "@azure/identity": "^4.8.0",
31
+ "@iarna/toml": "^2.2.5",
32
+ "@modelcontextprotocol/sdk": "^1.25.1",
33
+ "better-sqlite3": "^11.9.0",
34
+ "dotenv": "^16.4.7",
35
+ "express": "^4.18.2",
36
+ "mariadb": "^3.4.0",
37
+ "mssql": "^11.0.1",
38
+ "mysql2": "^3.13.0",
39
+ "pg": "^8.13.3",
40
+ "ssh-config": "^5.0.3",
41
+ "ssh2": "^1.16.0",
42
+ "zod": "^3.24.2"
43
+ },
44
+ "devDependencies": {
45
+ "@testcontainers/mariadb": "^11.0.3",
46
+ "@testcontainers/mssqlserver": "^11.0.3",
47
+ "@testcontainers/mysql": "^11.0.3",
48
+ "@testcontainers/postgresql": "^11.0.3",
49
+ "@types/better-sqlite3": "^7.6.12",
50
+ "@types/express": "^4.17.21",
51
+ "@types/mssql": "^9.1.7",
52
+ "@types/node": "^22.13.10",
53
+ "@types/pg": "^8.11.11",
54
+ "@types/ssh2": "^1.15.5",
55
+ "concurrently": "^9.2.1",
56
+ "cross-env": "^7.0.3",
57
+ "openapi-typescript": "^7.10.1",
58
+ "prettier": "^3.5.3",
59
+ "testcontainers": "^11.0.3",
60
+ "ts-node": "^10.9.2",
61
+ "tsup": "^8.4.0",
62
+ "tsx": "^4.19.3",
63
+ "typescript": "^5.8.2",
64
+ "vitest": "^4.0.6"
65
+ },
66
+ "compilerOptions": {
67
+ "target": "ES2020",
68
+ "module": "NodeNext",
69
+ "moduleResolution": "NodeNext",
70
+ "esModuleInterop": true,
71
+ "strict": true,
72
+ "outDir": "dist",
73
+ "rootDir": "src"
74
+ },
75
+ "include": [
76
+ "src/**/*"
77
+ ],
78
+ "scripts": {
79
+ "build": "pnpm run generate:api-types && tsup && cd frontend && pnpm run build",
80
+ "build:backend": "pnpm run generate:api-types && tsup",
81
+ "build:frontend": "cd frontend && pnpm run build",
82
+ "start": "node dist/index.js",
83
+ "dev": "concurrently --kill-others \"pnpm run dev:backend\" \"pnpm run dev:frontend\"",
84
+ "dev:backend": "NODE_ENV=development tsx src/index.ts --transport=http",
85
+ "dev:frontend": "cd frontend && pnpm run dev",
86
+ "crossdev": "cross-env NODE_ENV=development tsx src/index.ts",
87
+ "generate:api-types": "openapi-typescript src/api/openapi.yaml -o src/api/openapi.d.ts",
88
+ "test": "vitest run",
89
+ "test:unit": "vitest run --project unit",
90
+ "test:watch": "vitest",
91
+ "test:integration": "vitest run --project integration"
92
+ }
93
+ }