hyperdb-mcp 1.0.0-rc.1 → 1.0.0-rc.3

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/README.md +46 -21
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,10 +1,17 @@
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. As of 1.0.0 the public API is stable and follows [semantic versioning](https://semver.org/), so breaking changes require a major release.
3
+ > **Note:** This crate is AI-assisted but human-directed — much of the code was written by
4
+ > AI coding assistants under close review, with the design and engineering trade-offs decided
5
+ > by an experienced developer. As of 1.0.0 the **MCP tool surface** — tool names, their
6
+ > parameters, and their behavior as reached over the MCP protocol — is stable and follows
7
+ > [semantic versioning](https://semver.org/), so breaking changes to it require a major
8
+ > release. The Rust library target is **not** a supported API surface: it exists only to
9
+ > support the `hyperdb-mcp` binary, its tests, and its examples, its modules are
10
+ > `#[doc(hidden)]`, and items within it may change in any release.
4
11
 
5
12
  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
13
 
7
- Built on the pure-Rust [`hyperdb-api`](../hyperdb-api/) crate for maximum performance: 22M+ rows/sec inserts, 18M+ rows/sec queries, constant memory for billion-row results.
14
+ 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
15
 
9
16
  ---
10
17
 
@@ -237,7 +244,14 @@ describe({ database: "persistent" })
237
244
  sample({ table: "customers", database: "persistent" })
238
245
  ```
239
246
 
240
- The `database` parameter is available on `query`, `execute`, `load_data`, `load_file`, `load_files`, `watch_directory`, `describe`, `sample`, `chart`, `export`, and `set_table_metadata`. The shorthand `persist: true` (sugar for `database: "persistent"`) is available on `load_data`, `load_file`, `load_files`, and `watch_directory`. Read tools generally accept a read-only user attachment; write tools require a writable one. The exception is the KV family: every `kv_*` call to a user attachment requires it to be writable because the backing table may need initialization.
247
+ The `database` parameter is available on `query`, `execute`, `load_data`,
248
+ `load_file`, `load_files`, `watch_directory`, `describe`, `sample`, `chart`,
249
+ `export`, and `set_table_metadata`. The shorthand `persist: true` (sugar for
250
+ `database: "persistent"`) is available on `load_data`, `load_file`,
251
+ `load_files`, and `watch_directory`. Read tools generally accept a read-only
252
+ user attachment; write tools require a writable one. The exception is the KV
253
+ family: every `kv_*` call to a user attachment requires it to be writable
254
+ because the backing table may need initialization.
241
255
 
242
256
  Every successful database-routed response includes the canonical
243
257
  `resolved_database`: `"local"`, `"persistent"`, or the lowercase attached
@@ -279,6 +293,15 @@ hyperdb-mcp daemon # Run as a daemon explicitly (rarely needed)
279
293
  `status` and `stop` locate the running daemon automatically (reading `daemon.json`, then scanning the port range), so they work even if the daemon scanned onto a non-default port. Pass `--port <PORT>` to target a specific port explicitly.
280
294
 
281
295
  State files live at `~/.hyperdb/` by default (override with `HYPERDB_STATE_DIR`).
296
+ They record the `hyperd` endpoint, so the daemon restricts them to your own
297
+ account: `0700` on the directories and `0600` on `daemon.json` on Unix, and on
298
+ Windows the ACL a `%USERPROFILE%` subdirectory inherits. If you override the
299
+ location, keep it somewhere that can carry those permissions — under your user
300
+ profile on Windows, and on a filesystem that supports Unix modes on Unix (a
301
+ network share or a FAT/exFAT volume takes its modes from mount options
302
+ instead). The daemon warns rather than refusing to start when it cannot tighten
303
+ the directory, but it will not publish `daemon.json` into a file it cannot keep
304
+ readable by you alone.
282
305
 
283
306
  For installation and configuration diagnostics that also work before MCP can start, use the native doctor command:
284
307
 
@@ -332,7 +355,7 @@ If hyperd repeatedly fails to start (3 attempts within 60 seconds — e.g., misc
332
355
 
333
356
  Ingest inline data and run a SQL query in a single call.
334
357
 
335
- ```
358
+ ```text
336
359
  query_data(data: '[{"region":"West","revenue":1200},...]', sql: 'SELECT region, SUM(revenue) FROM data GROUP BY region')
337
360
  ```
338
361
 
@@ -348,7 +371,7 @@ query_data(data: '[{"region":"West","revenue":1200},...]', sql: 'SELECT region,
348
371
 
349
372
  Ingest a file and run a SQL query in a single call. Streams from disk — handles files of any size.
350
373
 
351
- ```
374
+ ```text
352
375
  query_file(path: '/tmp/sales.parquet', sql: 'SELECT TOP 10 * FROM sales ORDER BY amount DESC')
353
376
  ```
354
377
 
@@ -365,7 +388,7 @@ query_file(path: '/tmp/sales.parquet', sql: 'SELECT TOP 10 * FROM sales ORDER BY
365
388
 
366
389
  Load inline data into a named local, persistent, or attached-database table.
367
390
 
368
- ```
391
+ ```text
369
392
  load_data(table: 'customers', data: '[{"id":1,"name":"Alice"},...]')
370
393
  ```
371
394
 
@@ -381,7 +404,7 @@ load_data(table: 'customers', data: '[{"id":1,"name":"Alice"},...]')
381
404
 
382
405
  Load a file into a named local, persistent, or attached-database table.
383
406
 
384
- ```
407
+ ```text
385
408
  load_file(table: 'orders', path: '/tmp/orders.csv')
386
409
  ```
387
410
 
@@ -404,7 +427,7 @@ local table. Pass the absolute path to the Iceberg table root (the
404
427
  directory containing `metadata/` and `data/`); hyperd's native Iceberg
405
428
  reader derives the schema and resolves the snapshot.
406
429
 
407
- ```
430
+ ```text
408
431
  load_iceberg(table: 'sales', path: '/lake/warehouse/db/sales')
409
432
  ```
410
433
 
@@ -423,7 +446,7 @@ Iceberg table metadata.
423
446
 
424
447
  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`.
425
448
 
426
- ```
449
+ ```text
427
450
  query(sql: 'SELECT c.name, SUM(o.amount) FROM orders o JOIN customers c ON o.customer_id = c.id GROUP BY c.name')
428
451
  ```
429
452
 
@@ -431,7 +454,7 @@ query(sql: 'SELECT c.name, SUM(o.amount) FROM orders o JOIN customers c ON o.cus
431
454
 
432
455
  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.
433
456
 
434
- ```
457
+ ```text
435
458
  // Single statement (auto-commit)
436
459
  execute(sql: ['CREATE TABLE archived_orders AS SELECT * FROM orders WHERE year < 2024'])
437
460
 
@@ -459,7 +482,7 @@ List all tables in the selected database with their schemas, column types, and r
459
482
 
460
483
  Return the schema, total row count, and first N rows of a table in a single call.
461
484
 
462
- ```
485
+ ```text
463
486
  sample(table: 'orders', n: 10)
464
487
  ```
465
488
 
@@ -483,7 +506,7 @@ Use it **before** `load_file` whenever you are unsure about types, or **after**
483
506
  reported `type` + `min` / `max` directly into a partial `schema` override on the
484
507
  subsequent `load_file` call.
485
508
 
486
- ```
509
+ ```text
487
510
  inspect_file(path: '/tmp/owid-population.csv')
488
511
  ```
489
512
 
@@ -531,7 +554,7 @@ only for the lifetime of the server process.
531
554
 
532
555
  #### `save_query`
533
556
 
534
- ```
557
+ ```text
535
558
  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')
536
559
  ```
537
560
 
@@ -547,7 +570,7 @@ first if you intend to overwrite. Non-read-only SQL is rejected with
547
570
 
548
571
  #### `delete_query`
549
572
 
550
- ```
573
+ ```text
551
574
  delete_query(name: 'top_5_customers')
552
575
  ```
553
576
 
@@ -584,7 +607,7 @@ Nine tools cover the surface:
584
607
  | `kv_pop` | Destructively read-and-remove the lowest-keyed entry (atomic) | `store`, `database`, `persist` |
585
608
  | `kv_clear` | Delete all keys in a store (returns count removed) | `store`, `database`, `persist` |
586
609
 
587
- ```
610
+ ```text
588
611
  kv_set(store: 'session', key: 'last_report', value: '{"rows": 4210}', database: 'persistent')
589
612
  kv_get(store: 'session', key: 'last_report')
590
613
  ```
@@ -607,7 +630,7 @@ Key properties:
607
630
 
608
631
  Write query results or a table to a file.
609
632
 
610
- ```
633
+ ```text
611
634
  export(table: 'orders', path: '~/Desktop/orders.parquet', format: 'parquet')
612
635
  export(sql: 'SELECT ...', path: '~/Desktop/analysis.hyper', format: 'hyper')
613
636
  ```
@@ -630,7 +653,7 @@ destination and materializes every user table from the selected source into it.
630
653
  Render a bounded quick diagnostic from a SQL query. This convenience tool is
631
654
  for inspecting or sharing one chart, not for dashboard/layout composition.
632
655
 
633
- ```
656
+ ```text
634
657
  chart(sql: 'SELECT product, SUM(revenue) as total FROM sales GROUP BY product', chart_type: 'bar', x: 'product', y: 'total', title: 'Revenue by Product')
635
658
  ```
636
659
 
@@ -684,7 +707,7 @@ bound, never zero.
684
707
 
685
708
  Monitor a directory for data files and auto-append them to a target table.
686
709
 
687
- ```
710
+ ```text
688
711
  watch_directory(path: '/tmp/inbox', table: 'events')
689
712
  unwatch_directory(path: '/tmp/inbox')
690
713
  ```
@@ -899,7 +922,7 @@ Hyper uses the Salesforce Data Cloud SQL dialect (PostgreSQL-compatible with ext
899
922
 
900
923
  Hyper does **not** support `ON CONFLICT` or `INSERT ... ON DUPLICATE KEY`. Use the `execute` tool's atomic batch shape instead:
901
924
 
902
- ```
925
+ ```text
903
926
  execute(sql: [
904
927
  "UPDATE settings SET value = 'dark' WHERE key = 'theme'",
905
928
  "INSERT INTO settings (key, value) SELECT 'theme', 'dark' \
@@ -927,7 +950,7 @@ Full reference: [Data Cloud SQL Reference](https://developer.salesforce.com/docs
927
950
 
928
951
  ## CLI Reference
929
952
 
930
- ```
953
+ ```text
931
954
  hyperdb-mcp [OPTIONS] [COMMAND]
932
955
 
933
956
  Commands:
@@ -963,7 +986,9 @@ Environment:
963
986
  HYPERD_PATH Hyperd executable or containing directory; when absent or
964
987
  non-UTF-8, walk upward for .hyperd/current/hyperd (no PATH lookup)
965
988
  HYPERDB_PERSISTENT_DB Override the default persistent-db path
966
- HYPERDB_STATE_DIR Override daemon state directory (default ~/.hyperdb/)
989
+ HYPERDB_STATE_DIR Override daemon state directory (default ~/.hyperdb/); keep it
990
+ under your user profile on Windows and on a filesystem with Unix
991
+ modes on Unix, or it cannot be restricted to your account
967
992
  HYPERDB_DAEMON_PORT Pin auto-spawn discovery to one health/lock candidate;
968
993
  foreground startup binds this configured/base port exactly
969
994
  HYPERDB_DAEMON_IDLE_TIMEOUT Opt into idle shutdown (seconds); default: stay resident
package/package.json CHANGED
@@ -29,10 +29,10 @@
29
29
  "engines": {
30
30
  "node": ">= 21"
31
31
  },
32
- "version": "1.0.0-rc.1",
32
+ "version": "1.0.0-rc.3",
33
33
  "optionalDependencies": {
34
- "hyperdb-mcp-darwin-arm64": "1.0.0-rc.1",
35
- "hyperdb-mcp-linux-x64-gnu": "1.0.0-rc.1",
36
- "hyperdb-mcp-win32-x64-msvc": "1.0.0-rc.1"
34
+ "hyperdb-mcp-darwin-arm64": "1.0.0-rc.3",
35
+ "hyperdb-mcp-linux-x64-gnu": "1.0.0-rc.3",
36
+ "hyperdb-mcp-win32-x64-msvc": "1.0.0-rc.3"
37
37
  }
38
38
  }