hyperdb-mcp 0.1.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 (2) hide show
  1. package/bin.js +81 -0
  2. package/package.json +38 -0
package/bin.js ADDED
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env node
2
+ // Copyright (c) 2026, Salesforce, Inc. All rights reserved.
3
+ // SPDX-License-Identifier: Apache-2.0 OR MIT
4
+
5
+ const { execFileSync } = require('child_process')
6
+ const { join, dirname } = require('path')
7
+ const { existsSync } = require('fs')
8
+
9
+ const { platform, arch } = process
10
+
11
+ function getPlatformPackage() {
12
+ switch (platform) {
13
+ case 'darwin':
14
+ return arch === 'arm64' ? 'hyperdb-mcp-darwin-arm64' : 'hyperdb-mcp-darwin-x64'
15
+ case 'linux':
16
+ return 'hyperdb-mcp-linux-x64-gnu'
17
+ case 'win32':
18
+ return 'hyperdb-mcp-win32-x64-msvc'
19
+ default:
20
+ return null
21
+ }
22
+ }
23
+
24
+ function getBinaryName() {
25
+ return platform === 'win32' ? 'hyperdb-mcp.exe' : 'hyperdb-mcp'
26
+ }
27
+
28
+ function getHyperdName() {
29
+ return platform === 'win32' ? 'hyperd.exe' : 'hyperd'
30
+ }
31
+
32
+ function findBinary() {
33
+ const pkg = getPlatformPackage()
34
+ if (!pkg) {
35
+ throw new Error(`Unsupported platform: ${platform}-${arch}`)
36
+ }
37
+
38
+ // Try resolving from the installed platform package
39
+ try {
40
+ const pkgDir = dirname(require.resolve(`${pkg}/package.json`))
41
+ const bin = join(pkgDir, getBinaryName())
42
+ if (existsSync(bin)) return { bin, dir: pkgDir }
43
+ } catch (_) {}
44
+
45
+ // Fallback: binary in platform subdirectory (local dev / assemble-npm.sh)
46
+ const platformDir = pkg.replace('hyperdb-mcp-', '')
47
+ const subdir = join(__dirname, platformDir)
48
+ const subdirBin = join(subdir, getBinaryName())
49
+ if (existsSync(subdirBin)) return { bin: subdirBin, dir: subdir }
50
+
51
+ // Fallback: binary in same directory
52
+ const localBin = join(__dirname, getBinaryName())
53
+ if (existsSync(localBin)) return { bin: localBin, dir: __dirname }
54
+
55
+ throw new Error(
56
+ `Could not find hyperdb-mcp binary for ${platform}-${arch}. ` +
57
+ `Expected platform package: ${pkg}`
58
+ )
59
+ }
60
+
61
+ const { bin, dir } = findBinary()
62
+
63
+ // Point hyperdb-mcp at the bundled hyperd if not already set
64
+ if (!process.env.HYPERD_PATH) {
65
+ const hyperd = join(dir, getHyperdName())
66
+ if (existsSync(hyperd)) {
67
+ process.env.HYPERD_PATH = hyperd
68
+ }
69
+ }
70
+
71
+ // Spawn the MCP server, inheriting stdio for MCP protocol communication
72
+ const result = require('child_process').spawnSync(bin, process.argv.slice(2), {
73
+ stdio: 'inherit',
74
+ env: process.env,
75
+ })
76
+
77
+ if (result.error) {
78
+ throw result.error
79
+ }
80
+
81
+ process.exit(result.status ?? 1)
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "hyperdb-mcp",
3
+ "version": "0.1.0",
4
+ "description": "HyperDB MCP server — instant SQL analytics for LLM workflows",
5
+ "bin": {
6
+ "hyperdb-mcp": "bin.js"
7
+ },
8
+ "optionalDependencies": {
9
+ "hyperdb-mcp-darwin-arm64": "0.1.0",
10
+ "hyperdb-mcp-darwin-x64": "0.1.0",
11
+ "hyperdb-mcp-linux-x64-gnu": "0.1.0",
12
+ "hyperdb-mcp-win32-x64-msvc": "0.1.0"
13
+ },
14
+ "files": [
15
+ "bin.js"
16
+ ],
17
+ "keywords": [
18
+ "hyper",
19
+ "database",
20
+ "mcp",
21
+ "sql",
22
+ "analytics",
23
+ "arrow"
24
+ ],
25
+ "homepage": "https://github.com/tableau/hyper-api-rust/tree/main/hyperdb-mcp",
26
+ "bugs": {
27
+ "url": "https://github.com/tableau/hyper-api-rust/issues"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/tableau/hyper-api-rust.git",
32
+ "directory": "hyperdb-mcp"
33
+ },
34
+ "license": "MIT OR Apache-2.0",
35
+ "engines": {
36
+ "node": ">= 18"
37
+ }
38
+ }