hyperdb-mcp 0.7.3 → 1.0.0-rc.2
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.
- package/README.md +39 -21
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# hyperdb-mcp
|
|
2
2
|
|
|
3
|
-
> **Note:** This crate is AI-assisted but human-directed — much of the code was written by AI coding assistants under close review, with the design and engineering trade-offs decided by an experienced developer.
|
|
3
|
+
> **Note:** This crate is AI-assisted but human-directed — much of the code was written by AI coding assistants under close review, with the design and engineering trade-offs decided by an experienced developer. As of 1.0.0 the public API is stable and follows [semantic versioning](https://semver.org/), so breaking changes require a major release.
|
|
4
4
|
|
|
5
5
|
An MCP (Model Context Protocol) server that turns the Hyper columnar database into an instant SQL analytics engine. Data flows in from other MCP plugins or files, lands in Hyper automatically, and becomes queryable with SQL — no setup, no schema files, no database management.
|
|
6
6
|
|
|
7
|
-
Built on the pure-Rust [`hyperdb-api`](../hyperdb-api/) crate for maximum performance
|
|
7
|
+
Built on the pure-Rust [`hyperdb-api`](../hyperdb-api/) crate for maximum performance. On a single connection that crate benchmarks at 68.9M rows/sec inserts with the async `AsyncArrowInserter`, 25.0M rows/sec with the sync `Inserter`, and 31.1M rows/sec full-scan queries, with constant memory for billion-row results — see [docs/BENCHMARK_GUIDE.md](../docs/BENCHMARK_GUIDE.md).
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -17,6 +17,7 @@ LLMs are powerful at reasoning but cannot natively crunch millions of rows. This
|
|
|
17
17
|
Unlike flat-text memory systems that store blobs and retrieve by similarity search, HyperDB gives LLMs **structured, queryable long-term memory**. The persistent database survives across sessions — anything the LLM stores there can be JOINed, filtered, aggregated, and reasoned over with full SQL in any future conversation.
|
|
18
18
|
|
|
19
19
|
This means an LLM can:
|
|
20
|
+
|
|
20
21
|
- **Accumulate knowledge over time** — store reference tables, project decisions, user preferences, learned facts
|
|
21
22
|
- **Cross-reference across sessions** — JOIN today's analysis against historical data from last week
|
|
22
23
|
- **Answer complex recall questions** — "Which projects had budget overruns in Q1?" is a SQL query, not a fuzzy text search
|
|
@@ -76,6 +77,7 @@ The npm package bundles both the `hyperdb-mcp` binary and the `hyperd` database
|
|
|
76
77
|
`nvm` (Node Version Manager) makes it easy to install and switch between Node.js versions.
|
|
77
78
|
|
|
78
79
|
**macOS / Linux** ([nvm-sh/nvm](https://github.com/nvm-sh/nvm)):
|
|
80
|
+
|
|
79
81
|
```bash
|
|
80
82
|
# install nvm if you don't have it
|
|
81
83
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
|
@@ -87,6 +89,7 @@ node --version # should report v22.x.x or newer
|
|
|
87
89
|
```
|
|
88
90
|
|
|
89
91
|
**Windows** ([coreybutler/nvm-windows](https://github.com/coreybutler/nvm-windows)): download the installer, then in a new shell:
|
|
92
|
+
|
|
90
93
|
```powershell
|
|
91
94
|
nvm install lts
|
|
92
95
|
nvm use lts
|
|
@@ -127,6 +130,7 @@ current directory for `.hyperd/current/hyperd`; it does not perform a general
|
|
|
127
130
|
### MCP Client Configuration
|
|
128
131
|
|
|
129
132
|
Each AI tool reads MCP server config from a different file but uses the same JSON shape. The base config block using npx (recommended):
|
|
133
|
+
|
|
130
134
|
```json
|
|
131
135
|
{
|
|
132
136
|
"mcpServers": {
|
|
@@ -140,6 +144,7 @@ Each AI tool reads MCP server config from a different file but uses the same JSO
|
|
|
140
144
|
```
|
|
141
145
|
|
|
142
146
|
Or if you built from source:
|
|
147
|
+
|
|
143
148
|
```json
|
|
144
149
|
{
|
|
145
150
|
"mcpServers": {
|
|
@@ -155,6 +160,7 @@ Or if you built from source:
|
|
|
155
160
|
```
|
|
156
161
|
|
|
157
162
|
By default, persistent storage lives at the platform data dir (`~/Library/Application Support/hyperdb/workspace.hyper` on macOS, `~/.local/share/hyperdb/workspace.hyper` on Linux, `%APPDATA%\hyperdb\workspace.hyper` on Windows). To use a custom path:
|
|
163
|
+
|
|
158
164
|
```json
|
|
159
165
|
"args": ["--persistent-db", "/path/to/my-project.hyper"]
|
|
160
166
|
```
|
|
@@ -171,6 +177,7 @@ process trying to attach the same file can instead receive contextual
|
|
|
171
177
|
Create or edit `~/.claude/.mcp.json` (global) or `.mcp.json` in the project root (project-scoped). Use the base config block above.
|
|
172
178
|
|
|
173
179
|
After adding the config:
|
|
180
|
+
|
|
174
181
|
1. Start a new Claude Code session. You'll be prompted to approve the server on first use.
|
|
175
182
|
2. **Auto-approve tools (optional):** Add `"mcp__HyperDB__*"` to the `permissions.allow` array in `~/.claude/settings.json`.
|
|
176
183
|
|
|
@@ -230,7 +237,14 @@ describe({ database: "persistent" })
|
|
|
230
237
|
sample({ table: "customers", database: "persistent" })
|
|
231
238
|
```
|
|
232
239
|
|
|
233
|
-
The `database` parameter is available on `query`, `execute`, `load_data`,
|
|
240
|
+
The `database` parameter is available on `query`, `execute`, `load_data`,
|
|
241
|
+
`load_file`, `load_files`, `watch_directory`, `describe`, `sample`, `chart`,
|
|
242
|
+
`export`, and `set_table_metadata`. The shorthand `persist: true` (sugar for
|
|
243
|
+
`database: "persistent"`) is available on `load_data`, `load_file`,
|
|
244
|
+
`load_files`, and `watch_directory`. Read tools generally accept a read-only
|
|
245
|
+
user attachment; write tools require a writable one. The exception is the KV
|
|
246
|
+
family: every `kv_*` call to a user attachment requires it to be writable
|
|
247
|
+
because the backing table may need initialization.
|
|
234
248
|
|
|
235
249
|
Every successful database-routed response includes the canonical
|
|
236
250
|
`resolved_database`: `"local"`, `"persistent"`, or the lowercase attached
|
|
@@ -325,7 +339,7 @@ If hyperd repeatedly fails to start (3 attempts within 60 seconds — e.g., misc
|
|
|
325
339
|
|
|
326
340
|
Ingest inline data and run a SQL query in a single call.
|
|
327
341
|
|
|
328
|
-
```
|
|
342
|
+
```text
|
|
329
343
|
query_data(data: '[{"region":"West","revenue":1200},...]', sql: 'SELECT region, SUM(revenue) FROM data GROUP BY region')
|
|
330
344
|
```
|
|
331
345
|
|
|
@@ -341,7 +355,7 @@ query_data(data: '[{"region":"West","revenue":1200},...]', sql: 'SELECT region,
|
|
|
341
355
|
|
|
342
356
|
Ingest a file and run a SQL query in a single call. Streams from disk — handles files of any size.
|
|
343
357
|
|
|
344
|
-
```
|
|
358
|
+
```text
|
|
345
359
|
query_file(path: '/tmp/sales.parquet', sql: 'SELECT TOP 10 * FROM sales ORDER BY amount DESC')
|
|
346
360
|
```
|
|
347
361
|
|
|
@@ -358,7 +372,7 @@ query_file(path: '/tmp/sales.parquet', sql: 'SELECT TOP 10 * FROM sales ORDER BY
|
|
|
358
372
|
|
|
359
373
|
Load inline data into a named local, persistent, or attached-database table.
|
|
360
374
|
|
|
361
|
-
```
|
|
375
|
+
```text
|
|
362
376
|
load_data(table: 'customers', data: '[{"id":1,"name":"Alice"},...]')
|
|
363
377
|
```
|
|
364
378
|
|
|
@@ -374,7 +388,7 @@ load_data(table: 'customers', data: '[{"id":1,"name":"Alice"},...]')
|
|
|
374
388
|
|
|
375
389
|
Load a file into a named local, persistent, or attached-database table.
|
|
376
390
|
|
|
377
|
-
```
|
|
391
|
+
```text
|
|
378
392
|
load_file(table: 'orders', path: '/tmp/orders.csv')
|
|
379
393
|
```
|
|
380
394
|
|
|
@@ -386,7 +400,7 @@ load_file(table: 'orders', path: '/tmp/orders.csv')
|
|
|
386
400
|
| `schema` | object | no | Partial column-name → type map (see [Schema Overrides](#schema-overrides)) |
|
|
387
401
|
|
|
388
402
|
When you're unsure of the right types — or recovering from a previous
|
|
389
|
-
`SCHEMA_MISMATCH` — call [`inspect_file`](#
|
|
403
|
+
`SCHEMA_MISMATCH` — call [`inspect_file`](#inspect_file) first. It reports the
|
|
390
404
|
exact schema `load_file` would use plus per-column `min` / `max` / `null_count`
|
|
391
405
|
so you can build a minimal, correct override in one shot.
|
|
392
406
|
|
|
@@ -397,7 +411,7 @@ local table. Pass the absolute path to the Iceberg table root (the
|
|
|
397
411
|
directory containing `metadata/` and `data/`); hyperd's native Iceberg
|
|
398
412
|
reader derives the schema and resolves the snapshot.
|
|
399
413
|
|
|
400
|
-
```
|
|
414
|
+
```text
|
|
401
415
|
load_iceberg(table: 'sales', path: '/lake/warehouse/db/sales')
|
|
402
416
|
```
|
|
403
417
|
|
|
@@ -416,7 +430,7 @@ Iceberg table metadata.
|
|
|
416
430
|
|
|
417
431
|
Run a **read-only** SQL query against local (default), persistent, or an attached database. Accepts `SELECT`, `WITH`, `EXPLAIN`, `SHOW`, `VALUES`. For DDL/DML use `execute`.
|
|
418
432
|
|
|
419
|
-
```
|
|
433
|
+
```text
|
|
420
434
|
query(sql: 'SELECT c.name, SUM(o.amount) FROM orders o JOIN customers c ON o.customer_id = c.id GROUP BY c.name')
|
|
421
435
|
```
|
|
422
436
|
|
|
@@ -424,7 +438,7 @@ query(sql: 'SELECT c.name, SUM(o.amount) FROM orders o JOIN customers c ON o.cus
|
|
|
424
438
|
|
|
425
439
|
Execute one or more **mutating** SQL statements as an atomic batch: `CREATE TABLE`, `INSERT`, `UPDATE`, `DELETE`, `DROP TABLE`, `ALTER`, `COPY`, etc. `sql` is an array of statements; multi-element batches run inside a transaction (all commit or all roll back). Single-element batches auto-commit, same as a one-off statement. Returns the per-statement affected row counts plus a total. Disabled in read-only mode.
|
|
426
440
|
|
|
427
|
-
```
|
|
441
|
+
```text
|
|
428
442
|
// Single statement (auto-commit)
|
|
429
443
|
execute(sql: ['CREATE TABLE archived_orders AS SELECT * FROM orders WHERE year < 2024'])
|
|
430
444
|
|
|
@@ -437,6 +451,7 @@ execute(sql: [
|
|
|
437
451
|
```
|
|
438
452
|
|
|
439
453
|
Validation rules enforced before any SQL hits the server:
|
|
454
|
+
|
|
440
455
|
- Array must be non-empty; no element may be empty / whitespace-only / comment-only.
|
|
441
456
|
- No element may be read-only — use `query` for SELECT/WITH/EXPLAIN.
|
|
442
457
|
- DDL and DML cannot be mixed in one batch (Hyper aborts mixed transactions with SQLSTATE 0A000).
|
|
@@ -451,7 +466,7 @@ List all tables in the selected database with their schemas, column types, and r
|
|
|
451
466
|
|
|
452
467
|
Return the schema, total row count, and first N rows of a table in a single call.
|
|
453
468
|
|
|
454
|
-
```
|
|
469
|
+
```text
|
|
455
470
|
sample(table: 'orders', n: 10)
|
|
456
471
|
```
|
|
457
472
|
|
|
@@ -475,7 +490,7 @@ Use it **before** `load_file` whenever you are unsure about types, or **after**
|
|
|
475
490
|
reported `type` + `min` / `max` directly into a partial `schema` override on the
|
|
476
491
|
subsequent `load_file` call.
|
|
477
492
|
|
|
478
|
-
```
|
|
493
|
+
```text
|
|
479
494
|
inspect_file(path: '/tmp/owid-population.csv')
|
|
480
495
|
```
|
|
481
496
|
|
|
@@ -523,7 +538,7 @@ only for the lifetime of the server process.
|
|
|
523
538
|
|
|
524
539
|
#### `save_query`
|
|
525
540
|
|
|
526
|
-
```
|
|
541
|
+
```text
|
|
527
542
|
save_query(name: 'top_5_customers', sql: 'SELECT customer, SUM(amount) AS total FROM orders GROUP BY customer ORDER BY total DESC LIMIT 5', description: 'Biggest spenders this year')
|
|
528
543
|
```
|
|
529
544
|
|
|
@@ -539,7 +554,7 @@ first if you intend to overwrite. Non-read-only SQL is rejected with
|
|
|
539
554
|
|
|
540
555
|
#### `delete_query`
|
|
541
556
|
|
|
542
|
-
```
|
|
557
|
+
```text
|
|
543
558
|
delete_query(name: 'top_5_customers')
|
|
544
559
|
```
|
|
545
560
|
|
|
@@ -576,12 +591,13 @@ Nine tools cover the surface:
|
|
|
576
591
|
| `kv_pop` | Destructively read-and-remove the lowest-keyed entry (atomic) | `store`, `database`, `persist` |
|
|
577
592
|
| `kv_clear` | Delete all keys in a store (returns count removed) | `store`, `database`, `persist` |
|
|
578
593
|
|
|
579
|
-
```
|
|
594
|
+
```text
|
|
580
595
|
kv_set(store: 'session', key: 'last_report', value: '{"rows": 4210}', database: 'persistent')
|
|
581
596
|
kv_get(store: 'session', key: 'last_report')
|
|
582
597
|
```
|
|
583
598
|
|
|
584
599
|
Key properties:
|
|
600
|
+
|
|
585
601
|
- **Read-only mode** — the five mutators (`kv_set`, `kv_set_many`, `kv_delete`, `kv_pop`, `kv_clear`) are disabled and return `READ_ONLY_VIOLATION`; the global guard leaves the four readers (`kv_get`, `kv_list`, `kv_size`, `kv_list_stores`) available.
|
|
586
602
|
- **Attached-database access** — every attached target must have been attached
|
|
587
603
|
with `writable=true`, even for readers, because a KV call may need to
|
|
@@ -598,7 +614,7 @@ Key properties:
|
|
|
598
614
|
|
|
599
615
|
Write query results or a table to a file.
|
|
600
616
|
|
|
601
|
-
```
|
|
617
|
+
```text
|
|
602
618
|
export(table: 'orders', path: '~/Desktop/orders.parquet', format: 'parquet')
|
|
603
619
|
export(sql: 'SELECT ...', path: '~/Desktop/analysis.hyper', format: 'hyper')
|
|
604
620
|
```
|
|
@@ -621,7 +637,7 @@ destination and materializes every user table from the selected source into it.
|
|
|
621
637
|
Render a bounded quick diagnostic from a SQL query. This convenience tool is
|
|
622
638
|
for inspecting or sharing one chart, not for dashboard/layout composition.
|
|
623
639
|
|
|
624
|
-
```
|
|
640
|
+
```text
|
|
625
641
|
chart(sql: 'SELECT product, SUM(revenue) as total FROM sales GROUP BY product', chart_type: 'bar', x: 'product', y: 'total', title: 'Revenue by Product')
|
|
626
642
|
```
|
|
627
643
|
|
|
@@ -675,7 +691,7 @@ bound, never zero.
|
|
|
675
691
|
|
|
676
692
|
Monitor a directory for data files and auto-append them to a target table.
|
|
677
693
|
|
|
678
|
-
```
|
|
694
|
+
```text
|
|
679
695
|
watch_directory(path: '/tmp/inbox', table: 'events')
|
|
680
696
|
unwatch_directory(path: '/tmp/inbox')
|
|
681
697
|
```
|
|
@@ -689,6 +705,7 @@ unwatch_directory(path: '/tmp/inbox')
|
|
|
689
705
|
On success, both files are deleted. On failure, both are moved to `failed/` with a `.error` JSON file.
|
|
690
706
|
|
|
691
707
|
Key properties:
|
|
708
|
+
|
|
692
709
|
- **One directory, one table, append mode** — files must match the target schema.
|
|
693
710
|
- **Initial sweep** — pre-existing `.ready` files are processed immediately.
|
|
694
711
|
- **Read-only mode** — `watch_directory` is blocked; `unwatch_directory` is always allowed.
|
|
@@ -889,7 +906,7 @@ Hyper uses the Salesforce Data Cloud SQL dialect (PostgreSQL-compatible with ext
|
|
|
889
906
|
|
|
890
907
|
Hyper does **not** support `ON CONFLICT` or `INSERT ... ON DUPLICATE KEY`. Use the `execute` tool's atomic batch shape instead:
|
|
891
908
|
|
|
892
|
-
```
|
|
909
|
+
```text
|
|
893
910
|
execute(sql: [
|
|
894
911
|
"UPDATE settings SET value = 'dark' WHERE key = 'theme'",
|
|
895
912
|
"INSERT INTO settings (key, value) SELECT 'theme', 'dark' \
|
|
@@ -906,6 +923,7 @@ Both statements run inside a single Hyper transaction — they commit together o
|
|
|
906
923
|
The Hyper Rust API supports `BEGIN` / `COMMIT` / `ROLLBACK` plus an RAII `Transaction` guard (see [`docs/TRANSACTIONS.md`](../docs/TRANSACTIONS.md)). The MCP `execute` tool surfaces this as the `sql` array shape: pass multiple statements and they run atomically.
|
|
907
924
|
|
|
908
925
|
Hyper-specific limits worth remembering when batching:
|
|
926
|
+
|
|
909
927
|
- **DDL after DML in the same transaction is rejected** with SQLSTATE 0A000. The `execute` tool catches this up front — mixing CREATE/DROP/ALTER with INSERT/UPDATE/DELETE in one batch is rejected with an actionable error.
|
|
910
928
|
- **DDL is auto-committed** even inside a transaction. `execute` rejects multi-element all-DDL batches because the "atomic" promise can't be honored — issue each DDL call as its own one-element array.
|
|
911
929
|
- **After any error inside a transaction**, the connection enters aborted state and only ROLLBACK is accepted next. The `execute` tool handles this for you — on any per-statement failure the wrapper issues ROLLBACK before surfacing the error.
|
|
@@ -916,7 +934,7 @@ Full reference: [Data Cloud SQL Reference](https://developer.salesforce.com/docs
|
|
|
916
934
|
|
|
917
935
|
## CLI Reference
|
|
918
936
|
|
|
919
|
-
```
|
|
937
|
+
```text
|
|
920
938
|
hyperdb-mcp [OPTIONS] [COMMAND]
|
|
921
939
|
|
|
922
940
|
Commands:
|
package/package.json
CHANGED
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"engines": {
|
|
30
30
|
"node": ">= 21"
|
|
31
31
|
},
|
|
32
|
-
"version": "0.
|
|
32
|
+
"version": "1.0.0-rc.2",
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"hyperdb-mcp-darwin-arm64": "0.
|
|
35
|
-
"hyperdb-mcp-linux-x64-gnu": "0.
|
|
36
|
-
"hyperdb-mcp-win32-x64-msvc": "0.
|
|
34
|
+
"hyperdb-mcp-darwin-arm64": "1.0.0-rc.2",
|
|
35
|
+
"hyperdb-mcp-linux-x64-gnu": "1.0.0-rc.2",
|
|
36
|
+
"hyperdb-mcp-win32-x64-msvc": "1.0.0-rc.2"
|
|
37
37
|
}
|
|
38
38
|
}
|