@functional-systems/lambdadb-mcp 0.1.1-dev.6 → 0.1.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## [0.1.1] - 2026-09-29
6
+
7
+ - Pin the LambdaDB TypeScript SDK to 0.6.0, including all 16 text analyzers.
8
+ - Add keyword facets, query omission for match-all, and facet-only `size: 0` to
9
+ `lambdadb_query_collection`. Preserve omitted/null bucket sizes and facet results,
10
+ including automatic document downloads; retain existing search options and refs.
11
+ - Expose facet limits and the `size: 0` condition in MCP JSON Schema and validate
12
+ them through tool calls, SDK HTTP contracts, installed-package tests, and the
13
+ opt-in live suite. Read-only defaults and explicit write opt-in are unchanged.
14
+ - Facets require a supporting server and newly built keyword indexes. Existing
15
+ Collections are not migrated, and existing MCP installations require an update
16
+ to a separately published MCP version containing this change.
17
+
5
18
  ## [0.1.0] - 2026-09-20
6
19
 
7
20
  - Package `@functional-systems/lambdadb-mcp` and the `lambdadb-mcp` executable for npm/npx distribution under Apache-2.0.
package/README.md CHANGED
@@ -14,11 +14,17 @@ MCP server for LambdaDB using the official TypeScript MCP SDK and the official L
14
14
  Package: `@functional-systems/lambdadb-mcp`. Executable: `lambdadb-mcp`.
15
15
  Requires Node.js >=22.14.0; CI tests the minimum and current Node 22/24 LTS.
16
16
 
17
- The stable package is available on npm. As verified on 2026-09-20 (KST),
18
- `latest` resolves to `0.1.0` and `dev` to `0.1.0-dev.5`. Use an exact version for
17
+ The stable package is available on npm. As verified on 2026-09-29 (KST),
18
+ `latest` resolves to `0.1.0` and `dev` to `0.1.1-dev.7`. Use an exact version for
19
19
  reproducibility or the default stable channel for initial setup. See
20
20
  [release status and policy](RELEASING.md).
21
21
 
22
+ This source targets MCP **0.1.1**, with SDK 0.6.0, keyword facets, match-all queries,
23
+ and 16 text analyzers. Check [GitHub Releases](https://github.com/lambdadb/lambdadb-mcp/releases)
24
+ and npm for publication status; source version metadata alone is not evidence of publication.
25
+ Existing installations need an MCP version containing these changes; upgrading
26
+ the SDK separately does not update them.
27
+
22
28
  ```sh
23
29
  npx --yes @functional-systems/lambdadb-mcp
24
30
  # Pin the first stable release:
@@ -95,10 +101,11 @@ Optional write tools:
95
101
 
96
102
  ## API contract and tool inputs
97
103
 
98
- The LambdaDB SDK is pinned to `@functional-systems/lambdadb@0.5.1`.
99
- The tool contract was checked against LambdaDB develop
100
- [`d1a76659884a9ed09283a0b2e2989897dc799247`](https://github.com/lambdadb/lambdadb/commit/d1a76659884a9ed09283a0b2e2989897dc799247).
101
- This source revision does not establish which API revision is deployed.
104
+ The LambdaDB SDK is pinned to `@functional-systems/lambdadb@0.6.0`, checked against
105
+ the published package and [v0.6.0 release](https://github.com/lambdadb/lambdadb-typescript-client/releases/tag/v0.6.0)
106
+ at [`491d01e`](https://github.com/lambdadb/lambdadb-typescript-client/commit/491d01e0eb54bd135823fab79cbe32396ec03691).
107
+ This dependency update applies to builds containing this change. Publishing the SDK
108
+ alone does not update previously published or installed MCP packages.
102
109
 
103
110
  - Collection creation requires a nonempty `indexConfigs` and accepts `description`,
104
111
  metadata `tags`, `partitionConfig`, and `snapshotRetentionInDays` (1–31).
@@ -106,6 +113,12 @@ This source revision does not establish which API revision is deployed.
106
113
  - Query, Fetch, and List accept `ref: { kind: "branch" | "tag" | "alias", name: "..." }`.
107
114
  Omitting `ref` reads from `main`. `consistentRead: true` is supported only by
108
115
  Query/Fetch with an omitted ref or a direct Branch ref. List has no `consistentRead`.
116
+ - Query may omit `query` for match-all and accepts `facets` for keyword bucket counts
117
+ across all matches. Document `size` is 1–100, or 0 when at least one facet is supplied.
118
+ Up to five facet fields (including dotted paths) are allowed. Each field's options
119
+ accept only `size`: an integer from 1–100, omitted, or `null`. Omitted/null bucket
120
+ size uses the server default of 10; MCP forwards it unchanged. Empty `facets: {}`
121
+ is accepted except with `size: 0`. Facet results survive inline and `docsUrl` responses.
109
122
  - List also accepts `filter`, `fields`, `includeVectors`, and `partitionFilter`.
110
123
  The SDK selects the extended POST endpoint when needed and preserves pagination tokens.
111
124
  - Upsert/Delete accept an optional `branch`; omitting it writes to `main`.
@@ -122,6 +135,67 @@ Query/Fetch/List download top-level document arrays and retain legacy `{ "docs":
122
135
  support without sending the project API key to the download URL. No additional SDK
123
136
  patch is needed for this issue.
124
137
 
138
+ ### Query examples
139
+
140
+ Arguments for `lambdadb_query_collection`, returning only facets across all documents:
141
+
142
+ ```json
143
+ {
144
+ "collectionName": "products",
145
+ "size": 0,
146
+ "facets": { "category": {}, "metadata.brand": { "size": null } }
147
+ }
148
+ ```
149
+
150
+ Return matching documents and facets together:
151
+
152
+ ```json
153
+ {
154
+ "collectionName": "products",
155
+ "query": { "queryString": { "query": "title:coffee" } },
156
+ "size": 10,
157
+ "facets": { "category": { "size": 5 } },
158
+ "fields": { "include": ["id", "title", "category"] }
159
+ }
160
+ ```
161
+
162
+ For match-all documents without facets, use `{ "collectionName": "products", "size": 10 }`.
163
+ MCP returns JSON in its text content, with `docs`, `total`, `took`, and (when returned
164
+ by the service) `facets`, for example `"facets": { "category": { "buckets": [
165
+ { "value": "drinks", "count": 42 } ] } }`. Bucket counts cover all matching
166
+ documents, independently of document `size`; duplicate keyword array values count
167
+ once per document. `total` counts returned documents (0 for facet-only requests),
168
+ not all matching documents. Counts use JavaScript Number and may lose integer precision
169
+ above `Number.MAX_SAFE_INTEGER`.
170
+
171
+ Facets require a supporting server deployment and newly built keyword indexes.
172
+ This MCP update does not migrate existing Collections or indexes. Partial updates,
173
+ segment merging, and old Tags do not upgrade old indexes. If migration is needed,
174
+ plan and authorize reinsertion into a new Collection separately.
175
+
176
+ ### Text analyzers in collection creation
177
+
178
+ With write tools explicitly enabled, `lambdadb_create_collection` accepts:
179
+
180
+ ```json
181
+ {
182
+ "collectionName": "products",
183
+ "indexConfigs": {
184
+ "title": { "type": "text", "analyzers": ["english", "chinese", "french"] },
185
+ "category": { "type": "keyword" },
186
+ "metadata": { "type": "object", "objectIndexConfigs": { "brand": { "type": "keyword" } } }
187
+ }
188
+ }
189
+ ```
190
+
191
+ Supported lowercase names: `standard`, `english`, `korean`, `japanese`, `chinese`,
192
+ `cjk`, `arabic`, `french`, `german`, `hindi`, `indonesian`, `italian`, `portuguese`,
193
+ `russian`, `spanish`, `turkish`. Omitting `analyzers` uses the server default
194
+ `["standard"]`; an empty list is passed through and does not select that default.
195
+ Analyzers run independently without automatic language detection. Lists are sent
196
+ unchanged; avoid duplicate names, which the server rejects. Index configuration
197
+ validation remains in the SDK. Write tools remain disabled by default.
198
+
125
199
  ## Tests
126
200
 
127
201
  ```bash
@@ -134,7 +208,10 @@ npm run test:package
134
208
  client to this server and exercise the installed SDK against a local HTTP fixture.
135
209
  They cover read-only defaults, write opt-in, List/Get response validation, creation
136
210
  HTTP 201, ref/branch forwarding, invalid combinations, pagination, and `docsUrl`
137
- arrays/errors and local environment-file loading. They do not require credentials
211
+ arrays/errors and local environment-file loading. Facet tests validate the published
212
+ MCP JSON Schema and actual tool-to-SDK HTTP path, including match-all, facet-only,
213
+ document+facet, omitted/null/default bucket options, boundaries, invalid requests,
214
+ and all 16 analyzers. They do not require credentials
138
215
  or create remote collections. `test:package` additionally installs the actual
139
216
  tarball in a clean consumer directory and repeats the tool contracts over real
140
217
  stdio, checking version identity, config errors, stdout and process termination.
@@ -152,7 +229,10 @@ LAMBDADB_RUN_LIVE_TESTS=1 LAMBDADB_LIVE_CONFIRM_PROJECT=YOUR_DEV_PROJECT npm run
152
229
 
153
230
  The live test creates one uniquely named temporary collection, checks real HTTP
154
231
  201/202 responses, metadata, pagination, filters, sorting, and Branch/Tag/Alias
155
- reads. It writes two 3 MiB documents to force actual `docsUrl` array downloads
232
+ reads. It also checks all 16 analyzers in collection metadata, match-all, facet-only
233
+ and document+facet results, default/null bucket size, keyword arrays, dotted paths,
234
+ and facet preservation across refs and `docsUrl` downloads. The designated server
235
+ must support these features. It writes two 3 MiB documents to force actual `docsUrl` array downloads
156
236
  through the MCP tools and checks full payload integrity and download credential
157
237
  isolation. It allows up to five minutes for committed visibility, deletes its
158
238
  temporary collection in cleanup, and verifies that the collection is absent.
package/RELEASING.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Releasing LambdaDB MCP
2
2
 
3
+ ## Prepared stable candidate: 0.1.1 (2026-09-29 KST)
4
+
5
+ The `release/0.1.1` branch promotes reviewed develop commit
6
+ `d1a041ed8497eb8113b616faf87b2702fb5b80c5` with matching package/lock versions and
7
+ a dated changelog. SDK 0.6.0 adds keyword facets, match-all and facet-only queries,
8
+ and all 16 text analyzers. Read-only defaults and explicit write opt-in remain.
9
+ See `docs/validation/2026-09-29-0.1.1.md` in the reviewed release source for the
10
+ candidate validation record.
11
+
12
+ Review the release PR into **main using a merge commit** to preserve ancestry.
13
+ Preparation does not publish 0.1.1. After the main candidate is verified and
14
+ publication is authorized, tag that main commit `v0.1.1` and publish a non-prerelease
15
+ GitHub Release. The existing workflow validates, packs, tests, and publishes its
16
+ exact tarball to npm `latest` with OIDC. Verify version, gitHead, integrity,
17
+ provenance, and installed behavior before announcing availability.
18
+
19
+ After publication, synchronize main back into develop through a PR with the next
20
+ base `0.1.2-dev.1`. Do not merge stable version metadata directly into develop.
21
+ Facets need a supporting server and newly built keyword indexes; this release
22
+ does not migrate existing Collections or indexes.
23
+
3
24
  ## Status and policy
4
25
 
5
26
  As verified on **2026-09-20 (KST)**:
@@ -2,6 +2,13 @@ import { z } from "zod";
2
2
  import { createLambdaDBClient } from "../lambdadb/client.js";
3
3
  import { formatLambdaDBError } from "../lambdadb/errors.js";
4
4
  import { fieldsSchema, jsonResult, nameSchema, partitionFilterSchema, readOptions, readRefSchema } from "./shared.js";
5
+ const facetsSchema = z.record(z.string(), z.strictObject({
6
+ size: z.number().int().min(1).max(100).nullable().optional()
7
+ .describe("Maximum buckets; omitted or null uses the server default of 10.")
8
+ })).refine((facets) => Object.keys(facets).length <= 5, "At most five facet fields may be requested.")
9
+ // Zod refinements are not represented in JSON Schema without explicit metadata.
10
+ .meta({ maxProperties: 5 })
11
+ .describe("Keyword field names (including dotted paths) mapped to bucket options. Requires newly built keyword indexes on a supporting server.");
5
12
  export function registerReadTools(server, config) {
6
13
  server.registerTool("lambdadb_list_collections", {
7
14
  title: "List Collections",
@@ -46,15 +53,17 @@ export function registerReadTools(server, config) {
46
53
  });
47
54
  server.registerTool("lambdadb_query_collection", {
48
55
  title: "Query Collection",
49
- description: "Run a search query against a collection and return the matching documents.",
56
+ description: "Search documents and optionally return keyword facet counts across all matches. Omit query for match-all; size: 0 requires at least one facet and returns only facets. Facets require a supporting server and newly built keyword indexes.",
50
57
  annotations: {
51
58
  readOnlyHint: true,
52
59
  openWorldHint: false
53
60
  },
54
61
  inputSchema: z.strictObject({
55
62
  collectionName: nameSchema,
56
- size: z.number().int().min(1).max(100).optional(),
57
- query: z.record(z.string(), z.any()),
63
+ size: z.number().int().min(0).max(100).optional()
64
+ .describe("Documents to return (1–100), or 0 with nonempty facets."),
65
+ query: z.record(z.string(), z.any()).optional().describe("Omit for match-all."),
66
+ facets: facetsSchema.optional(),
58
67
  ref: readRefSchema.optional(),
59
68
  consistentRead: z.boolean().optional().describe("true requires a direct branch ref or omitted ref (main)."),
60
69
  includeVectors: z.boolean().optional(),
@@ -62,12 +71,23 @@ export function registerReadTools(server, config) {
62
71
  sort: z.array(z.record(z.string(), z.string().regex(/^([aA][sS][cC]|[dD][eE][sS][cC])$/))).optional(),
63
72
  fields: fieldsSchema.optional(),
64
73
  partitionFilter: partitionFilterSchema.optional()
74
+ }).superRefine((input, context) => {
75
+ if (input.size === 0 && Object.keys(input.facets ?? {}).length === 0) {
76
+ context.addIssue({ code: "custom", path: ["facets"], message: "size: 0 requires at least one facet." });
77
+ }
78
+ }).meta({
79
+ // Keep the cross-field rule visible to MCP clients as well as tools/call.
80
+ allOf: [{
81
+ if: { properties: { size: { const: 0 } }, required: ["size"] },
82
+ then: { required: ["facets"], properties: { facets: { minProperties: 1 } } }
83
+ }]
65
84
  })
66
- }, async ({ collectionName, size, query, ref, consistentRead, includeVectors, sort, fields, partitionFilter }) => {
85
+ }, async ({ collectionName, size, query, facets, ref, consistentRead, includeVectors, sort, fields, partitionFilter }) => {
67
86
  try {
68
87
  const client = createLambdaDBClient(config);
69
88
  const input = {
70
89
  query,
90
+ facets,
71
91
  size,
72
92
  ...readOptions(ref, consistentRead),
73
93
  includeVectors,
@@ -5,7 +5,7 @@ import { jsonResult, nameSchema, partitionFilterSchema } from "./shared.js";
5
5
  export function registerWriteTools(server, config) {
6
6
  server.registerTool("lambdadb_create_collection", {
7
7
  title: "Create Collection",
8
- description: "Create a new collection in the configured project.",
8
+ description: "Create a new collection in the configured project. Text index analyzers: standard, english, korean, japanese, chinese, cjk, arabic, french, german, hindi, indonesian, italian, portuguese, russian, spanish, turkish. Keyword indexes built on a supporting server support facets.",
9
9
  annotations: {
10
10
  openWorldHint: false
11
11
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functional-systems/lambdadb-mcp",
3
- "version": "0.1.1-dev.6",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "description": "MCP server for LambdaDB data plane",
6
6
  "type": "module",
@@ -22,7 +22,7 @@
22
22
  "test:package": "node scripts/test-package.mjs"
23
23
  },
24
24
  "dependencies": {
25
- "@functional-systems/lambdadb": "0.5.1",
25
+ "@functional-systems/lambdadb": "0.6.0",
26
26
  "@modelcontextprotocol/sdk": "1.29.0",
27
27
  "zod": "^4.1.12"
28
28
  },
@@ -60,5 +60,5 @@
60
60
  "access": "public",
61
61
  "registry": "https://registry.npmjs.org"
62
62
  },
63
- "gitHead": "fc5765bec9dd84f239840eab734531a945d8a70c"
63
+ "gitHead": "40a8afc25bb93fb14d03d23e3ab38aa1924cf060"
64
64
  }