@infino-ai/mcp-server 0.11.0 → 0.13.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.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  An [MCP](https://modelcontextprotocol.io) server for [Infino](https://github.com/infino-ai/infino) — it lets an AI agent run **keyword**, **semantic**, **hybrid**, and **SQL** retrieval over your data on object storage, from any MCP-compatible client (Claude Code, Claude Desktop, Cursor, VS Code, and others). Published on npm as [`@infino-ai/mcp-server`](https://www.npmjs.com/package/@infino-ai/mcp-server) and listed on the [official MCP Registry](https://registry.modelcontextprotocol.io) as `io.github.infino-ai/mcp-server` (which propagates to catalogs like Smithery, Glama, and PulseMCP).
8
8
 
9
9
  - **Local embeddings, no key.** Semantic search embeds queries with a local model — nothing leaves the machine for embedding.
10
- - **Read-only by default.** Writes and full SQL are opt-in behind a single environment flag.
10
+ - **The agent owns the data.** Every tool, writes included, is always available. On Infino Cloud the API key's capabilities decide what a connection may do; every tool carries MCP annotations so your client can ask before a destructive call.
11
11
  - **Local or hosted.** Point it at a local path, your own bucket (S3, Azure, or any S3-compatible store), or a hosted Infino Cloud endpoint with an API key.
12
12
 
13
13
  ---
@@ -59,8 +59,8 @@ The server is launched by your MCP client over stdio — you don't run it direct
59
59
  ```
60
60
 
61
61
  To serve a **hosted Infino Cloud** database instead, point `INFINO_MCP_URI` at
62
- the `https://<host>/<database>` endpoint and supply your API key — everything
63
- else (the tools, the read-only default) is identical:
62
+ the `https://<host>/<database>` endpoint and supply your API key. Everything
63
+ else is identical:
64
64
 
65
65
  ```jsonc
66
66
  {
@@ -86,7 +86,7 @@ For [Claude Code](https://claude.com/claude-code), this repo is also a plugin ma
86
86
  /plugin install infino@infino-ai
87
87
  ```
88
88
 
89
- On enable you'll be prompted for your **Infino data URI** (`INFINO_MCP_URI`) and whether to **enable writes**. That's it — the `infino_*` tools, the `using-infino` skill, and `/infino-search <query>` are then available. (Other clients: use the [Client setup](#client-setup) configs below.)
89
+ On enable you'll be prompted for your **Infino data URI** (`INFINO_MCP_URI`) and, for Infino Cloud, your **API key**. That's it: the `infino_*` tools, the `using-infino` skill, and `/infino-search <query>` are then available. (Other clients: use the [Client setup](#client-setup) configs below.)
90
90
 
91
91
  ---
92
92
 
@@ -103,7 +103,7 @@ claude mcp add infino \
103
103
  -- npx -y @infino-ai/mcp-server
104
104
  ```
105
105
 
106
- Add more knobs with repeated `-e` flags, e.g. `-e INFINO_MCP_ENABLE_WRITES=true`. Verify with:
106
+ Add more knobs with repeated `-e` flags, e.g. `-e INFINO_MCP_VALIDATE=true`. Verify with:
107
107
 
108
108
  ```sh
109
109
  claude mcp list
@@ -195,13 +195,11 @@ All configuration is via environment variables — there are no config files and
195
195
  | --- | --- | --- | --- |
196
196
  | `INFINO_MCP_URI` | No | `~/.infino/mcp` (persistent) | Data to serve: a local path (`/Users/me/.infino/memory`), a bucket URI (`s3://…`, `az://…`), or a hosted endpoint (`https://<host>/<database>`, Infino Cloud). If unset, a durable per-user directory (`~/.infino/mcp`) is used so data persists across restarts; it falls back to an ephemeral in-process catalog (`memory://`) only if that directory can't be created. |
197
197
  | `INFINO_API_KEY` | With a hosted URI | — | API key (`inf_…`) for a hosted `https://` endpoint. Required when `INFINO_MCP_URI` is an `https://` URI; ignored for local and object-storage connections. |
198
- | `INFINO_MCP_ENABLE_WRITES` | No | _off_ | When set (`1`/`true`/`yes`), exposes `infino_add_documents` **and** lets `infino_sql` run DDL/DML. Omit for a strictly read-only server. |
199
198
  | `INFINO_MCP_EMBED_PROVIDER` | No | `local` | Embedding provider: `local` (Hugging Face transformers.js, no key, nothing leaves the machine) or `openai` (any OpenAI-compatible `/embeddings` endpoint — OpenAI, Azure OpenAI's `/openai/v1` surface, or a compatible server). Inferred as `openai` when `INFINO_MCP_EMBED_BASE_URL` is set. |
200
199
  | `INFINO_MCP_EMBED_BASE_URL` | With `openai` | — | Base URL of the OpenAI-compatible embeddings API, e.g. `https://api.openai.com/v1` or `https://<resource>.openai.azure.com/openai/v1`. The server POSTs to `<base>/embeddings`. |
201
200
  | `INFINO_MCP_EMBED_API_KEY` | No | — | API key for the `openai` provider. Sent as both `Authorization: Bearer` and `api-key`, so one value works for OpenAI and Azure OpenAI. Omit to call an unauthenticated or ambient-identity endpoint. |
202
201
  | `INFINO_MCP_EMBED_MODEL` | No | `Xenova/all-MiniLM-L6-v2` (local) · `text-embedding-3-small` (openai) | The embedding model. For `local`, a Hugging Face feature-extraction model; for `openai`, the model/deployment name. **Must match the model that produced the table's stored vectors** — and therefore its vector-index dimension (e.g. `text-embedding-3-small` is 1536-dim; the default local model is 384-dim). |
203
202
  | `INFINO_MCP_VALIDATE` | No | _off_ | When set (`1`/`true`/`yes`), probes the object store at startup so bad credentials or an unreachable bucket fail then instead of on the first search. |
204
- | `INFINO_MCP_SNIPPET_CHARS` | No | _off_ (full text) | Deployment default for search snippets: cut the text column of every search hit to this many characters (then `…`). Set it when rows are whole documents rather than chunks, so an agent scanning many hits doesn't pull every document into its context. A per-call `snippetChars` overrides it; `0` means full text. Only the searched text column is cut. |
205
203
 
206
204
  Cloud credentials are read from the standard provider environment variables — the server maps them to the store's config and introduces no credential vars of its own. Omit them entirely to use ambient cloud identity (an IAM instance role or Azure managed identity).
207
205
 
@@ -261,7 +259,7 @@ The model must match what produced the stored vectors — a mismatch yields mean
261
259
  }
262
260
  ```
263
261
 
264
- On a hosted connection the search, SQL, and (when enabled) write tools all
262
+ On a hosted connection the search, SQL, and write tools all
265
263
  behave exactly as they do locally — the only difference is where the data
266
264
  lives. Compaction and garbage collection are handled server-side, so they are
267
265
  not exposed as client operations. Note that semantic and hybrid search still
@@ -276,22 +274,38 @@ the data.
276
274
 
277
275
  | Tool | Arguments | What it does |
278
276
  | --- | --- | --- |
279
- | `infino_semantic_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `snippetChars?`, `columns?`, `filter?` | Find passages by **meaning** — embeds the query with a local model (no key) and ranks by vector similarity. Handles paraphrase and synonyms. `score` is a **distance** (lower is closer). Optional `filter` (`{column, query, mode?}`) restricts the ranking to rows whose keyword column matches first (a pushdown pre-filter). Optional `columns` chooses which fields each hit returns (e.g. a path + line range to cite); defaults to the text column, with `_id` and `score` always included. |
280
- | `infino_keyword_search` | `table`, `query`, `k`, `column?`, `snippetChars?`, `columns?` | BM25 full-text search — for exact terms, identifiers, error codes, product names. `score` is a relevance (higher is better). |
281
- | `infino_hybrid_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `snippetChars?`, `columns?` | **Fused** keyword + semantic search in one ranking pass — BM25 over the text column combined with vector similarity, so rows matching the literal terms *and* the meaning rank highest. `score` is the fused rank (higher is better). |
277
+ | `infino_semantic_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `columns?`, `filter?` | Find passages by **meaning** — embeds the query with a local model (no key) and ranks by vector similarity. Handles paraphrase and synonyms. `score` is a **distance** (lower is closer). Optional `filter` (`{column, query, mode?}`) restricts the ranking to rows whose keyword column matches first (a pushdown pre-filter). Optional `columns` chooses which fields each hit returns (e.g. a path + line range to cite); defaults to the text column, with `_id` and `score` always included. |
278
+ | `infino_keyword_search` | `table`, `query`, `k`, `column?`, `mode?`, `stats?`, `columns?` | BM25 full-text search — for exact terms, identifiers, error codes, product names. `score` is a relevance (higher is better). `mode` is `or` (default) or `and`; `stats` is `per_superfile` (default) or `global` for one table-wide idf. |
279
+ | `infino_hybrid_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `mode?`, `columns?` | **Fused** keyword + semantic search in one ranking pass — BM25 over the text column combined with vector similarity, so rows matching the literal terms *and* the meaning rank highest. `score` is the fused rank (higher is better). |
282
280
  | `infino_token_match` | `table`, `query`, `column?`, `mode?`, `limit?` | Unranked keyword filter — the set of rows whose text column contains the token(s). Use when you need the matches, not a relevance order. |
283
281
  | `infino_exact_match` | `table`, `value`, `column?`, `limit?` | Unranked exact-equality filter over an indexed column (tag, status, id string). |
284
282
  | `infino_count` | `table`, `query`, `column?`, `mode?` | Count how many rows match a keyword query, without fetching them — a fast tally over the text column. For the matching rows use `infino_keyword_search` or `infino_token_match`. |
285
- | `infino_sql` | `query` | SQL for counts, filters, joins, aggregates. Read-only (single `SELECT`/`WITH`) by default; accepts any single statement when `INFINO_MCP_ENABLE_WRITES` is set. |
283
+ | `infino_sql` | `query`, `embed?` | SQL for counts, filters, joins, aggregates. The engine's search table functions are callable inside it; a `{{name}}` placeholder is filled with the vector of `embed[name]`. Any single statement, DDL/DML included. |
286
284
  | `infino_list_tables` | — | List the tables in the connected catalog. |
287
285
  | `infino_describe_table` | `table` | Column names and types for a table. |
288
- | `infino_add_documents` | `table`, `documents` | Append rows (one call = one commit); embeds the text column for vector tables. **Only when `INFINO_MCP_ENABLE_WRITES` is set.** |
289
- | `infino_update_documents` | `table`, `predicate`, `documents` | Replace the rows matching a SQL predicate with new documents, 1:1 (missing vectors are embedded). Durable storage only. **Only when `INFINO_MCP_ENABLE_WRITES` is set.** |
290
- | `infino_delete_documents` | `table`, `predicate` | Delete the rows matching a SQL predicate. Durable storage only. **Only when `INFINO_MCP_ENABLE_WRITES` is set.** |
286
+ | `infino_create_database` | — | Provision the database the connection names (Infino Cloud); a no-op success locally. Idempotent. |
287
+ | `infino_create_table` | `table`, `columns`, `fts?`, `vector?` | Create a table from a `{column: type}` descriptor. Full-text indexes on `fts` (default: every `large_utf8` column). `vector: true` adds an `embedding` column sized to the server's embedder, with a cosine index. |
288
+ | `infino_drop_table` | `table`, `purge?` | Drop a table and, by default, delete its storage objects; `purge: false` only unregisters the name. |
289
+ | `infino_add_documents` | `table`, `documents` | Append rows (one call = one commit). Rows without a vector are embedded from the text column, all in one batch; the result reports `appended` and `embedded`. A key that is not a column is an error. |
290
+ | `infino_update_documents` | `table`, `predicate`, `documents` | Replace the rows matching a SQL predicate with new documents, 1:1 (missing vectors are embedded). Durable storage only. |
291
+ | `infino_delete_documents` | `table`, `predicate` | Delete the rows matching a SQL predicate. Durable storage only. |
291
292
 
292
- Search hits carry the **full text column** by default, like other vector-store servers. When rows are whole documents rather than pre-chunked passages, set `INFINO_MCP_SNIPPET_CHARS` (for example `300`) so hits carry a snippet instead and an agent can scan many hits without pulling every document into its context; a per-call `snippetChars` overrides the deployment default, and `0` means full text. Only the searched text column is cut, never ids or other projected columns; read any single hit in full with `infino_sql`. Every search response also carries `score_kind`, stating whether its `score` is a distance (semantic: lower is closer) or a relevance (keyword and hybrid: higher is better).
293
+ Search hits return **full column values** — the `columns` argument is a projection passed straight to the engine (embedded or hosted), so any column in the table can come back with each hit: `["id"]` for compact hits at a large `k`, `["id", "text"]` for the full text alongside an id to cite, metadata columns for filtering. It defaults to the text column, with `_id` and `score` always included, and nothing is ever truncated; to keep results small, project fewer columns or ask for a smaller `k`. Every search response also carries `score_kind`, stating whether its `score` is a distance (semantic: lower is closer) or a relevance (keyword and hybrid: higher is better).
293
294
 
294
- The engine's search table functions (`bm25_search`, `vector_search`, `hybrid_search`, …) are not callable from `infino_sql` — retrieval goes through the dedicated search tools above, which embed and project for you. `infino_sql` is for filters, joins, and aggregates.
295
+ For plain retrieval prefer the dedicated search tools, which embed and project for you. `infino_sql` is for filters, joins, and aggregates, including over a search table function's results, so one query can rank and aggregate at once.
296
+
297
+ ### Writing data
298
+
299
+ The write path an agent follows, each step one tool call and one commit:
300
+
301
+ 1. `infino_create_database` if a hosted database answers 404.
302
+ 2. `infino_create_table` with a `utf8` key column, `large_utf8` text columns, and `vector: true` for semantic search. The server sizes the vector column to its embedder; the agent never types a dimension. Keep the result: its `indexes` field is the only record of which columns are indexed.
303
+ 3. `infino_add_documents`, tens of rows per call, always including the key. Missing vectors are embedded in one batch.
304
+ 4. To replace rows, `infino_delete_documents` by key predicate, then add again. To remove rows, check the predicate with `infino_count` first.
305
+
306
+ A tool call carries tens of documents. For a whole corpus, use the [`infino` CLI](https://github.com/infino-ai/infino-cli) (`infino ingest` takes Parquet or NDJSON against the same URI) or an SDK. The CLI is bring-your-own-vectors like the engine, so include the `embedding` column in the rows or load text and search by keyword.
307
+
308
+ There is no server-side write gate, and the retired `INFINO_MCP_ENABLE_WRITES` variable is ignored (the server says so on stderr if it is set). On Infino Cloud the API key's capabilities bound what the connection may do: a read-scoped key is refused every write, and the tool result says to mint one with write capability. Locally, point the server only at data the agent may change.
295
309
 
296
310
  ---
297
311
 
@@ -300,9 +314,9 @@ The engine's search table functions (`bm25_search`, `vector_search`, `hybrid_sea
300
314
  This server runs locally, beside the client, and keeps data and credentials on the user's machine.
301
315
 
302
316
  - **Local execution, no inbound listener.** It runs as a subprocess of your MCP client over stdio and opens no network listener. In the default local/bucket mode it contacts no remote service. When `INFINO_MCP_URI` is a hosted `https://` endpoint, it makes **outbound** TLS calls to that endpoint to serve searches, SQL, and (if enabled) writes — so the data in those requests reaches the hosted service you configured, and nothing else.
303
- - **No data sent for embedding.** Query and document embedding uses a local model — text is never sent to a third-party embedding API. There is no embedding API key to provision or leak. (This holds in both local and hosted mode: only the resulting query vector, not the raw text of the embed input, is sent to a hosted endpoint.)
317
+ - **No data sent for embedding, by default.** With the default provider, query and document embedding uses a local model, so text is never sent to a third-party embedding API and there is no embedding API key to provision or leak. In hosted mode only the resulting vector, not the text, reaches the Infino Cloud endpoint. If you configure the OpenAI-compatible provider, the text being embedded is sent to the endpoint you name.
304
318
  - **Credentials stay in the environment.** Storage credentials (`AWS_*`/`AZURE_*`) and the hosted API key (`INFINO_API_KEY`) are read from environment variables and used only to reach the store or endpoint you configured. They are never logged or returned in tool output.
305
- - **Read-only by default.** Without `INFINO_MCP_ENABLE_WRITES`, the write tool is not even advertised to the agent, and `infino_sql` rejects anything but a single `SELECT`/`WITH`. Enable writes deliberately, and prefer scoping the server to data the agent is allowed to modify.
319
+ - **Who can write is decided outside the server.** The full toolset, writes included, is always available to the agent. On Infino Cloud the API key's capabilities bound what the connection may do (a read-scoped key is refused every write). Locally, point the server only at data the agent may change. Every tool carries MCP annotations (`readOnlyHint`, `destructiveHint`) so your client can ask for confirmation on its own terms.
306
320
  - **Least privilege.** Point `INFINO_MCP_URI` at the narrowest dataset the task needs, and supply storage credentials scoped to that bucket/prefix.
307
321
 
308
322
  ---
@@ -321,11 +335,11 @@ If you change `INFINO_MCP_EMBED_MODEL`, the table's vector index must match the
321
335
  | --- | --- |
322
336
  | Client shows no Infino tools | Server didn't start — check the client's MCP logs (stderr). Confirm `npx` is on `PATH` and `INFINO_MCP_URI` is set. Fully restart the client after editing config. |
323
337
  | `INFINO_MCP_URI is required` | The env var isn't reaching the subprocess. In GUI clients, env must be inside the server's `env` block (the process won't inherit your shell). |
324
- | `add_documents` not available | `INFINO_MCP_ENABLE_WRITES` isn't set, or the client wasn't restarted after setting it. |
338
+ | A write says the key "was rejected or lacks write capability" | On Infino Cloud the API key is read-scoped (HTTP 403) or wrong. Mint a key with write capability and restart the server with it. |
339
+ | A write says "another writer won the commit race" | Two writers hit the same table at once and this call did not land. Reissue it. |
325
340
  | Slow first query | One-time embedding-model download (~90 MB). Subsequent runs use the cache. |
326
341
  | Auth error against a hosted `https://` URI | `INFINO_API_KEY` is missing, wrong, or lacks access to that database. Confirm the key (`inf_…`) and that the URI's last path segment is a database you can reach. |
327
342
  | Dimension / vector errors on semantic search | The table's vector index doesn't match the embedding model's dimension. Re-ingest, or set `INFINO_MCP_EMBED_MODEL` to the model the index was built with. |
328
- | `… in SQL isn't supported from the server yet` | You called a search table function inside `infino_sql`. Use `infino_semantic_search` / `infino_keyword_search` instead. |
329
343
 
330
344
  ---
331
345
 
package/dist/embedding.js CHANGED
@@ -34,8 +34,12 @@ const LOCAL_MODEL_DEFAULT = "Xenova/all-MiniLM-L6-v2";
34
34
  const REMOTE_MODEL_DEFAULT = "text-embedding-3-small";
35
35
  const MODEL = process.env.INFINO_MCP_EMBED_MODEL ??
36
36
  (USE_REMOTE ? REMOTE_MODEL_DEFAULT : LOCAL_MODEL_DEFAULT);
37
- // Lazily load the local pipeline once and reuse it; the first call downloads +
38
- // caches the model. Never imported when a remote provider is configured.
37
+ // Batch sizes. The local pipeline runs one forward pass per call, so a batch
38
+ // amortizes model overhead across texts without letting the ONNX arenas grow
39
+ // past what a handful of documents needs. The remote size stays well inside
40
+ // every OpenAI-compatible provider's per-request input limit.
41
+ const LOCAL_BATCH = 32;
42
+ const REMOTE_BATCH = 100;
39
43
  let pipe = null;
40
44
  function getPipe() {
41
45
  if (!pipe) {
@@ -46,8 +50,8 @@ function getPipe() {
46
50
  }
47
51
  return pipe;
48
52
  }
49
- /** Embed one text via an OpenAI-compatible /embeddings endpoint. */
50
- async function embedRemote(text) {
53
+ /** Embed up to REMOTE_BATCH texts in one OpenAI-compatible /embeddings call. */
54
+ async function embedRemoteBatch(texts) {
51
55
  if (!BASE_URL) {
52
56
  throw new Error("INFINO_MCP_EMBED_BASE_URL is required when INFINO_MCP_EMBED_PROVIDER is 'openai'.");
53
57
  }
@@ -62,27 +66,63 @@ async function embedRemote(text) {
62
66
  const res = await fetch(url, {
63
67
  method: "POST",
64
68
  headers,
65
- body: JSON.stringify({ model: MODEL, input: text }),
69
+ body: JSON.stringify({ model: MODEL, input: texts }),
66
70
  });
67
71
  if (!res.ok) {
68
72
  const detail = await res.text().catch(() => "");
69
73
  throw new Error(`embeddings request failed: HTTP ${res.status} ${detail.slice(0, 300)}`);
70
74
  }
71
75
  const body = (await res.json());
72
- const vector = body?.data?.[0]?.embedding;
73
- if (!Array.isArray(vector)) {
74
- throw new Error("embeddings response did not contain data[0].embedding");
76
+ const data = body?.data;
77
+ if (!Array.isArray(data) || data.length !== texts.length) {
78
+ throw new Error(`embeddings response carried ${Array.isArray(data) ? data.length : 0} vectors for ${texts.length} inputs`);
75
79
  }
76
- return Array.from(vector, Number);
80
+ // The spec orders `data` by `index`, but a provider may not; honor the
81
+ // index so vectors land on the text that produced them.
82
+ const out = new Array(texts.length);
83
+ data.forEach((item, position) => {
84
+ const at = typeof item.index === "number" ? item.index : position;
85
+ if (!Array.isArray(item.embedding) || at < 0 || at >= texts.length || out[at]) {
86
+ throw new Error("embeddings response did not contain one embedding per input");
87
+ }
88
+ out[at] = Array.from(item.embedding, Number);
89
+ });
90
+ return out;
91
+ }
92
+ /** Embed up to LOCAL_BATCH texts in one forward pass of the local model. */
93
+ async function embedLocalBatch(texts) {
94
+ const extractor = await getPipe();
95
+ // Mean-pool token vectors and L2-normalize → one sentence embedding per text,
96
+ // returned as an [n, dim] tensor.
97
+ const output = await extractor(texts, { pooling: "mean", normalize: true });
98
+ const dim = output.dims[output.dims.length - 1];
99
+ const flat = Array.from(output.data, Number);
100
+ return texts.map((_, i) => flat.slice(i * dim, (i + 1) * dim));
101
+ }
102
+ /** Embed many texts with the configured provider, in batches, preserving order. */
103
+ export async function embedMany(texts) {
104
+ if (texts.length === 0)
105
+ return [];
106
+ const size = USE_REMOTE ? REMOTE_BATCH : LOCAL_BATCH;
107
+ const run = USE_REMOTE ? embedRemoteBatch : embedLocalBatch;
108
+ const out = [];
109
+ for (let i = 0; i < texts.length; i += size) {
110
+ out.push(...(await run(texts.slice(i, i + size))));
111
+ }
112
+ return out;
77
113
  }
78
114
  /** Embed one text into a vector with the configured provider. */
79
115
  export async function embed(text) {
80
- if (USE_REMOTE)
81
- return embedRemote(text);
82
- const extractor = await getPipe();
83
- // Mean-pool token vectors and L2-normalize → one sentence embedding.
84
- const output = await extractor(text, { pooling: "mean", normalize: true });
85
- return Array.from(output.data, Number);
116
+ return (await embedMany([text]))[0];
117
+ }
118
+ // The embedder's output width, learned once by embedding a short constant
119
+ // string. Sizes the vector column of a table the server creates, and is
120
+ // compared against the vector column of any table it embeds into.
121
+ let dim = null;
122
+ export function embedderDim() {
123
+ if (!dim)
124
+ dim = embed("infino").then((v) => v.length);
125
+ return dim;
86
126
  }
87
127
  /** Human-readable description of the embedder, for the startup log. */
88
128
  export function embedderInfo() {
package/dist/guards.js ADDED
@@ -0,0 +1,64 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+ // SPDX-FileCopyrightText: Copyright The Infino Authors
3
+ //
4
+ // Pure helpers between the agent and the engine: the SQL guard, and the
5
+ // translation of raw engine / hosted-transport errors into messages that say
6
+ // what to do next. Kept free of server state so they can be unit-tested.
7
+ /**
8
+ * Translate a raw engine or hosted-transport error into an actionable
9
+ * message. Two sources of signal: the HTTP status a hosted connection attaches
10
+ * to thrown errors as `status`, and the engine's own error texts.
11
+ *
12
+ * The hosted transport folds 401 and 403 into one message with no status, so
13
+ * that text is matched directly. It also reports both a name collision and a
14
+ * lost commit race as 409, dropping the worker's `Retry-After` that tells them
15
+ * apart, so the 409 is read by which operation raised it: a create collided,
16
+ * a write lost the race and can be reissued.
17
+ */
18
+ export function errText(err, ctx = {}) {
19
+ const e = err;
20
+ const message = e?.message ?? String(err);
21
+ if (/KV metadata key "inf\.fts\./.test(message)) {
22
+ return ("this table has no full-text index, so keyword/BM25/hybrid search is " +
23
+ "unavailable on it; query it with infino_sql instead, or recreate the " +
24
+ "table with an FTS index on the text column");
25
+ }
26
+ if (/KV metadata key "inf\.vec\./.test(message)) {
27
+ return ("this table has no vector index, so semantic/hybrid search is " +
28
+ "unavailable on it; query it with infino_sql instead, or recreate the " +
29
+ "table with a vector index");
30
+ }
31
+ if (e?.status === 401 || e?.status === 403 || /unauthorized \(check the API key\)/.test(message)) {
32
+ return ("the API key was rejected or lacks write capability for this database; " +
33
+ "for writes, mint a key with write capability and restart the server with it");
34
+ }
35
+ if (e?.status === 413) {
36
+ return "the batch is over the hosted 128 MiB request-body cap; send fewer documents per call";
37
+ }
38
+ if (e?.status === 503) {
39
+ return "the database is starting up (transient 503); retry in a few seconds";
40
+ }
41
+ if (e?.status === 404) {
42
+ return ctx.hosted
43
+ ? `not found (404): ${message}. If the database itself is missing, call infino_create_database`
44
+ : `not found (404): ${message}`;
45
+ }
46
+ if (e?.status === 409) {
47
+ return ctx.op === "write"
48
+ ? "another writer won the commit race on this table; nothing was written, so reissue the call"
49
+ : `already exists (409): ${message}`;
50
+ }
51
+ return message;
52
+ }
53
+ /**
54
+ * Guard for infino_sql. The engine's search table functions compose with
55
+ * GROUP BY / joins / aggregates, which is the point of exposing SQL, and any
56
+ * statement is allowed, DDL/DML included. The one restriction is one
57
+ * statement per call, so a result always answers exactly one query.
58
+ */
59
+ export function guardSql(sql) {
60
+ const stripped = sql.trim().replace(/;\s*$/, "");
61
+ if (stripped.includes(";"))
62
+ throw new Error("only a single statement is allowed");
63
+ return stripped;
64
+ }
package/dist/index.js CHANGED
@@ -2,19 +2,32 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  // SPDX-FileCopyrightText: Copyright The Infino Authors
4
4
  //
5
- // MCP server for Infino — lets an agent run retrieval over data on object
6
- // storage from any MCP client. Exposes catalog discovery (list/describe),
7
- // keyword (BM25), semantic (local-embedding vector), and hybrid (fused)
8
- // search, unranked token/exact match, and read-only SQL; document writes
9
- // (add/update/delete) and full SQL are opt-in behind INFINO_MCP_ENABLE_WRITES.
5
+ // MCP server for Infino. Lets an agent run retrieval and writes over data on
6
+ // object storage from any MCP client. Exposes catalog discovery and management
7
+ // (list/describe/create/drop), keyword (BM25), semantic (local-embedding
8
+ // vector), and hybrid (fused) search, unranked token/exact match, SQL, and
9
+ // document writes (add/update/delete).
10
+ //
11
+ // Scope rule: one tool per operation the `@infino-ai/infino` binding exposes,
12
+ // plus the one piece of glue the engine's bring-your-own-vectors model forces
13
+ // on an agent: turning text into a vector (see embedding.ts). Nothing else is
14
+ // invented here; bulk ingestion, chunking, and upsert live in the CLI, the
15
+ // SDKs, or the engine.
16
+ //
17
+ // The full surface is always advertised. Who may write is decided by the
18
+ // hosted API key's capabilities (a read-scoped key gets 403 on writes) and by
19
+ // whoever configured the local path or bucket credentials; how much a client
20
+ // confirms before a destructive call is the client's decision, driven by the
21
+ // tool annotations below. There is no server-side write gate.
10
22
  import { mkdirSync } from "node:fs";
11
23
  import { homedir } from "node:os";
12
24
  import { join } from "node:path";
13
25
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
14
26
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
15
27
  import { z } from "zod";
16
- import { connect } from "@infino-ai/infino";
17
- import { embed, embedderInfo } from "./embedding.js";
28
+ import { connect, IndexSpec } from "@infino-ai/infino";
29
+ import { embed, embedMany, embedderDim, embedderInfo } from "./embedding.js";
30
+ import { errText as translate, guardSql } from "./guards.js";
18
31
  // --- connection (env-configured, opened once at startup) -------------------
19
32
  //
20
33
  // The agent never manages connections: the server is pointed at the data via
@@ -35,15 +48,14 @@ function defaultUri() {
35
48
  const dir = join(homedir(), ".infino", "mcp");
36
49
  try {
37
50
  mkdirSync(dir, { recursive: true });
38
- console.error(`INFINO_MCP_URI not set — using ${dir} (persistent; read-only until ` +
39
- "INFINO_MCP_ENABLE_WRITES is set). Set INFINO_MCP_URI to point at your " +
40
- "own path, an s3://|az:// bucket, or a hosted https://<host>/<database> " +
41
- "endpoint.");
51
+ console.error(`INFINO_MCP_URI not set; using ${dir} (persistent). Set INFINO_MCP_URI to ` +
52
+ "point at your own path, an s3://|az:// bucket, or a hosted " +
53
+ "https://<host>/<database> endpoint.");
42
54
  return dir;
43
55
  }
44
56
  catch (err) {
45
57
  console.error(`INFINO_MCP_URI not set and ${dir} is not writable ` +
46
- `(${errText(err)}) — serving an ephemeral in-process ` +
58
+ `(${translate(err)}); serving an ephemeral in-process ` +
47
59
  "catalog (memory://).");
48
60
  return "memory://";
49
61
  }
@@ -119,13 +131,42 @@ try {
119
131
  db = connect(uri, connectOptions);
120
132
  }
121
133
  catch (err) {
122
- console.error(`Failed to connect to ${uri}: ${errText(err)}`);
134
+ console.error(`Failed to connect to ${uri}: ${translate(err, { hosted: isHosted })}`);
123
135
  process.exit(1);
124
136
  }
125
- // Writes (infino_add_documents) are off unless explicitly enabled, so the
126
- // default install is read-only and the write tool isn't even advertised.
127
- const writesEnabled = ["1", "true", "yes"].includes((process.env.INFINO_MCP_ENABLE_WRITES ?? "").toLowerCase());
137
+ // Writes used to sit behind INFINO_MCP_ENABLE_WRITES. The variable is accepted
138
+ // and ignored so an existing config keeps booting; it is never honored, because
139
+ // honoring it would reintroduce the read-only mode this server no longer has.
140
+ if (process.env.INFINO_MCP_ENABLE_WRITES !== undefined) {
141
+ console.error("INFINO_MCP_ENABLE_WRITES is set but no longer read: writes are always on. " +
142
+ "Remove the variable; scope the API key instead to restrict a hosted connection.");
143
+ }
128
144
  // --- helpers ---------------------------------------------------------------
145
+ // Tool annotations, per the MCP spec: the client reads these to decide what to
146
+ // confirm with its user. With no server-side write gate they are the safety
147
+ // signal, so every tool carries one. `openWorldHint` says whether the call
148
+ // leaves the machine, which on a hosted connection every one of them does.
149
+ const READ_ONLY = {
150
+ readOnlyHint: true,
151
+ destructiveHint: false,
152
+ idempotentHint: true,
153
+ openWorldHint: isHosted,
154
+ };
155
+ // Adds data without replacing or removing any: a repeat is a duplicate, not a loss.
156
+ const ADDITIVE = {
157
+ readOnlyHint: false,
158
+ destructiveHint: false,
159
+ idempotentHint: false,
160
+ openWorldHint: isHosted,
161
+ };
162
+ const ADDITIVE_IDEMPOTENT = { ...ADDITIVE, idempotentHint: true };
163
+ // May replace or remove data.
164
+ const DESTRUCTIVE = {
165
+ readOnlyHint: false,
166
+ destructiveHint: true,
167
+ idempotentHint: false,
168
+ openWorldHint: isHosted,
169
+ };
129
170
  // `_id` comes back as a bigint, which JSON can't serialize — render it as a string.
130
171
  const toText = (value) => JSON.stringify(value, (_k, v) => (typeof v === "bigint" ? v.toString() : v), 2);
131
172
  const ok = (value) => ({ content: [{ type: "text", text: toText(value) }] });
@@ -168,35 +209,9 @@ const fail = (message) => ({
168
209
  content: [{ type: "text", text: message }],
169
210
  isError: true,
170
211
  });
171
- // Translate raw engine/transport errors into messages an agent (or human)
172
- // can act on. Two sources of signal: the HTTP status a hosted (Infino Cloud)
173
- // connection attaches to thrown errors, and the engine's index-metadata
174
- // errors, which surface when a search needs an index the table wasn't
175
- // created with.
176
- function errText(err) {
177
- const e = err;
178
- const message = e?.message ?? String(err);
179
- if (/KV metadata key "inf\.fts\./.test(message)) {
180
- return ("this table has no full-text index, so keyword/BM25/hybrid search is " +
181
- "unavailable on it — query it with infino_sql instead, or recreate the " +
182
- "table with an FTS index on the text column");
183
- }
184
- if (/KV metadata key "inf\.vec\./.test(message)) {
185
- return ("this table has no vector index, so semantic/hybrid search is " +
186
- "unavailable on it — query it with infino_sql instead, or recreate the " +
187
- "table with a vector index");
188
- }
189
- if (e?.status === 503) {
190
- return "the database is starting up (transient 503) — retry in a few seconds";
191
- }
192
- if (e?.status === 404) {
193
- return `not found (404): ${message}`;
194
- }
195
- if (e?.status === 409) {
196
- return `already exists (409): ${message}`;
197
- }
198
- return message;
199
- }
212
+ // Error translation lives in guards.ts; this binds the connection mode so call
213
+ // sites only say what kind of operation failed.
214
+ const errText = (err, op) => translate(err, { op, hosted: isHosted });
200
215
  // When the caller doesn't name a column, infer the searchable text column.
201
216
  // FTS indexes require LargeUtf8, so a LargeUtf8 column is almost certainly
202
217
  // the indexed one; plain Utf8 columns are typically ids and short labels.
@@ -215,33 +230,77 @@ function inferVectorColumn(table) {
215
230
  const field = table.schema().fields.find((f) => String(f.type).toLowerCase().includes("list"));
216
231
  return field?.name;
217
232
  }
218
- async function embedRows(handle, rows) {
233
+ async function prepareRows(handle, table, rows) {
234
+ const fields = handle.schema().fields;
235
+ const columns = fields.map((f) => f.name);
236
+ // A table created from a descriptor has no nullable columns, so a row that
237
+ // omits one fails inside Arrow with a message about nullability. Name the
238
+ // column instead. The vector column is exempt: embedRows fills it in.
239
+ const vecCol = inferVectorColumn(handle);
240
+ const required = fields.filter((f) => f.nullable === false && f.name !== vecCol).map((f) => f.name);
241
+ rows.forEach((doc, i) => {
242
+ for (const key of Object.keys(doc)) {
243
+ if (!columns.includes(key)) {
244
+ throw new Error(`document ${i}: '${key}' is not a column of this table (columns: ${columns.join(", ")})`);
245
+ }
246
+ }
247
+ const missing = required.filter((c) => doc[c] == null);
248
+ if (missing.length > 0) {
249
+ throw new Error(`document ${i}: missing ${missing.map((c) => `'${c}'`).join(", ")}; every column of this table is required in each row (columns: ${columns.join(", ")})`);
250
+ }
251
+ });
252
+ const int64 = fields.filter((f) => /int64/i.test(String(f.type))).map((f) => f.name);
253
+ const widened = int64.length === 0
254
+ ? rows
255
+ : rows.map((doc) => {
256
+ const out = { ...doc };
257
+ for (const col of int64) {
258
+ if (typeof out[col] === "number")
259
+ out[col] = BigInt(Math.trunc(out[col]));
260
+ }
261
+ return out;
262
+ });
263
+ return embedRows(handle, widened, table);
264
+ }
265
+ // The configured embedder must produce vectors as wide as the table's vector
266
+ // column, or every vector written or searched is meaningless (and the engine
267
+ // rejects the width). Checked once per table and column, before the first
268
+ // embedding into or against it, so a mismatch names both numbers up front
269
+ // instead of surfacing as an Arrow length error.
270
+ const widthChecked = new Set();
271
+ async function assertVectorWidth(handle, table, vecCol) {
272
+ const key = `${table}${vecCol}`;
273
+ if (widthChecked.has(key))
274
+ return;
275
+ const field = handle.schema().fields.find((f) => f.name === vecCol);
276
+ const width = field?.type?.listSize;
277
+ const dim = await embedderDim();
278
+ if (typeof width === "number" && width !== dim) {
279
+ throw new Error(`the embedder produces ${dim}-dimensional vectors but '${vecCol}' in '${table}' is ${width}-dimensional; ` +
280
+ "set INFINO_MCP_EMBED_MODEL (and provider) to the model that built this table, or recreate the table");
281
+ }
282
+ widthChecked.add(key);
283
+ }
284
+ // When a table has a vector index, fill in a missing vector for each row by
285
+ // embedding its text column, every missing vector in one batched call.
286
+ // Returns the rows and how many were embedded.
287
+ async function embedRows(handle, rows, table) {
219
288
  const vecCol = inferVectorColumn(handle);
220
289
  if (!vecCol)
221
- return rows;
290
+ return { rows, embedded: 0 };
222
291
  const textCol = inferTextColumn(handle);
223
- return Promise.all(rows.map(async (doc) => doc[vecCol] == null && textCol && typeof doc[textCol] === "string"
224
- ? { ...doc, [vecCol]: await embed(doc[textCol]) }
225
- : doc));
226
- }
227
- // Search table functions are routed to the dedicated search tools instead of
228
- // infino_sql. This is now a usability policy, not a technical limit: search
229
- // Guard for infino_sql. The engine's search TVFs (bm25_search / vector_search /
230
- // hybrid_search / token_match / exact_match) ARE allowed here — they compose
231
- // with GROUP BY / joins / aggregates, which is the point of exposing SQL. The
232
- // vector TVFs need a query vector, which applyEmbeds() supplies from {{name}}
233
- // placeholders. The one restriction is the read-only policy (single statement,
234
- // must start with SELECT/WITH), gated by the same INFINO_MCP_ENABLE_WRITES
235
- // switch as infino_add_documents: off → read-only, so the default install can't
236
- // write through SQL; on → any single statement (DDL/DML) is allowed.
237
- function guardSql(sql, allowWrites) {
238
- const stripped = sql.trim().replace(/;\s*$/, "");
239
- if (stripped.includes(";"))
240
- throw new Error("only a single statement is allowed");
241
- if (!allowWrites && !/^(select|with)\b/i.test(stripped)) {
242
- throw new Error("only read-only SELECT / WITH queries are allowed (set INFINO_MCP_ENABLE_WRITES to permit DDL/DML through SQL)");
243
- }
244
- return stripped;
292
+ const pending = [];
293
+ rows.forEach((doc, i) => {
294
+ if (doc[vecCol] == null && textCol && typeof doc[textCol] === "string")
295
+ pending.push(i);
296
+ });
297
+ if (pending.length === 0)
298
+ return { rows, embedded: 0 };
299
+ await assertVectorWidth(handle, table, vecCol);
300
+ const vectors = await embedMany(pending.map((i) => rows[i][textCol]));
301
+ const out = rows.slice();
302
+ pending.forEach((i, n) => (out[i] = { ...out[i], [vecCol]: vectors[n] }));
303
+ return { rows: out, embedded: pending.length };
245
304
  }
246
305
  // --- server ----------------------------------------------------------------
247
306
  // Server-level instructions are returned to the client on initialize and shown
@@ -259,11 +318,18 @@ const server = new McpServer({ name: "infino", version: "0.1.0" }, {
259
318
  "- infino_sql — counts, joins, aggregates, and filtering by exact column value (structural, not relevance).\n" +
260
319
  "- infino_token_match / infino_exact_match — unranked keyword / exact-equality filters.\n" +
261
320
  "- infino_list_tables / infino_describe_table — discover the tables and their columns before searching.\n\n" +
262
- "The server is read-only by default; document writes (add/update/delete) and DDL/DML SQL are available " +
263
- "only when the operator has enabled writes.",
321
+ "Writing data, in order: infino_create_database if a hosted database answers 404; infino_create_table " +
322
+ "with a utf8 key column, large_utf8 text columns, and vector: true for semantic search (the server sizes " +
323
+ "the vector column to its embedder); infino_add_documents with tens of rows per call, always including " +
324
+ "the key; rows without a vector are embedded from their text. To replace rows, infino_delete_documents " +
325
+ "by key predicate then add again; before any delete, check the predicate with infino_count or infino_sql. " +
326
+ "Every write is one commit and is durable when the tool returns. For a whole corpus use the infino CLI " +
327
+ "(infino ingest) or an SDK, not this server. There is no server-side write gate: the API key's " +
328
+ "capabilities decide what a hosted connection may do, and you are responsible for what you change.",
264
329
  });
265
330
  server.registerTool("infino_list_tables", {
266
331
  title: "List Infino tables",
332
+ annotations: READ_ONLY,
267
333
  description: "List the tables in the connected catalog. Call this first to discover what is available to search or query.",
268
334
  inputSchema: {},
269
335
  }, async () => {
@@ -276,6 +342,7 @@ server.registerTool("infino_list_tables", {
276
342
  });
277
343
  server.registerTool("infino_describe_table", {
278
344
  title: "Describe an Infino table",
345
+ annotations: READ_ONLY,
279
346
  description: "Return a table's column names and types — call before searching so you know which column to target and what " +
280
347
  "fields each result row carries.",
281
348
  inputSchema: {
@@ -293,6 +360,117 @@ server.registerTool("infino_describe_table", {
293
360
  return fail(`describe_table failed: ${errText(err)}`);
294
361
  }
295
362
  });
363
+ // --- catalog management ------------------------------------------------------
364
+ server.registerTool("infino_create_database", {
365
+ title: "Create the database this server is connected to",
366
+ annotations: ADDITIVE_IDEMPOTENT,
367
+ description: "Provision the database named in the connection. On Infino Cloud this registers the database; on a " +
368
+ "local path or bucket the catalog root is the database, so this is a no-op success. Idempotent: an " +
369
+ "existing database is reported as created: false. Call it when a hosted connection answers 404.",
370
+ inputSchema: {},
371
+ }, async () => {
372
+ try {
373
+ db.createDatabase();
374
+ return ok({ created: true });
375
+ }
376
+ catch (err) {
377
+ const e = err;
378
+ if (e?.status === 409)
379
+ return ok({ created: false, note: "database already exists" });
380
+ return fail(`create_database failed: ${errText(err, "create")}`);
381
+ }
382
+ });
383
+ // The scalar column types the binding's schema descriptor accepts. Full-text
384
+ // indexes require large_utf8, which is why the descriptor spells both string
385
+ // widths out instead of offering a single "string".
386
+ const COLUMN_TYPES = ["utf8", "large_utf8", "bool", "int32", "int64", "float32", "float64"];
387
+ // Name of the vector column `vector: true` adds. Fixed so the skill, the
388
+ // searches' column inference, and the tables the server creates all agree.
389
+ const VECTOR_COLUMN = "embedding";
390
+ server.registerTool("infino_create_table", {
391
+ title: "Create an Infino table",
392
+ annotations: ADDITIVE,
393
+ description: "Create a table from a {column: type} descriptor. Full-text (BM25) indexes go on the columns named in " +
394
+ "'fts' (default: every large_utf8 column; the index requires that type). With vector: true the server " +
395
+ "adds an 'embedding' column sized to its embedder and a cosine vector index on it, so semantic and hybrid " +
396
+ "search work and rows added without a vector are embedded from their text. Every column is required in " +
397
+ "every row you add, so declare only columns you will always fill. Give every table a stable key " +
398
+ "column of type utf8 so rows can be replaced or removed later by predicate (e.g. key = 'doc-1'); keep " +
399
+ "utf8 for ids and short labels and large_utf8 for the text to search, so the searches infer the right column.",
400
+ inputSchema: {
401
+ table: z.string().describe("Table name."),
402
+ columns: z
403
+ .record(z.string(), z.enum(COLUMN_TYPES))
404
+ .describe("Columns as {name: type}. large_utf8 for text to search; utf8 for a key, ids, and short labels."),
405
+ fts: z
406
+ .array(z.string())
407
+ .optional()
408
+ .describe("Columns to full-text index. Default: every large_utf8 column. Must be large_utf8."),
409
+ vector: z
410
+ .boolean()
411
+ .optional()
412
+ .describe("Add an 'embedding' vector column sized to the server's embedder, with a cosine index. Default false."),
413
+ },
414
+ }, async ({ table, columns, fts, vector }) => {
415
+ try {
416
+ const descriptor = { ...columns };
417
+ const vectorColumns = [];
418
+ let spec = new IndexSpec();
419
+ if (vector) {
420
+ if (VECTOR_COLUMN in descriptor) {
421
+ return fail(`create_table: '${VECTOR_COLUMN}' is reserved for the vector column that vector: true adds; rename it.`);
422
+ }
423
+ const dim = await embedderDim();
424
+ descriptor[VECTOR_COLUMN] = { vector: dim };
425
+ spec = spec.vector(VECTOR_COLUMN, dim, "cosine");
426
+ vectorColumns.push(VECTOR_COLUMN);
427
+ }
428
+ const ftsColumns = fts ?? Object.entries(columns).filter(([, t]) => t === "large_utf8").map(([n]) => n);
429
+ for (const col of ftsColumns) {
430
+ if (!(col in descriptor))
431
+ return fail(`create_table: fts column '${col}' is not in 'columns'.`);
432
+ if (descriptor[col] !== "large_utf8") {
433
+ return fail(`create_table: fts column '${col}' is ${descriptor[col]}; a full-text index requires large_utf8.`);
434
+ }
435
+ }
436
+ for (const col of ftsColumns)
437
+ spec = spec.fts(col);
438
+ const handle = db.createTable(table, descriptor, spec);
439
+ const schema = handle
440
+ .schema()
441
+ .fields.map((f) => ({ name: f.name, type: String(f.type) }));
442
+ return ok({ table, columns: schema, indexes: { fts: ftsColumns, vector: vectorColumns } });
443
+ }
444
+ catch (err) {
445
+ const e = err;
446
+ if (e?.status === 409 || /already ?exists/i.test(e?.message ?? "")) {
447
+ return fail(`create_table: table '${table}' already exists; inspect it with infino_describe_table.`);
448
+ }
449
+ return fail(`create_table failed: ${errText(err, "create")}`);
450
+ }
451
+ });
452
+ server.registerTool("infino_drop_table", {
453
+ title: "Drop an Infino table",
454
+ annotations: DESTRUCTIVE,
455
+ description: "Drop a table from the catalog and, by default, delete its storage objects too. Pass purge: false to only " +
456
+ "unregister the table and leave the bytes in place. Irreversible.",
457
+ inputSchema: {
458
+ table: z.string().describe("Table to drop."),
459
+ purge: z
460
+ .boolean()
461
+ .optional()
462
+ .describe("Also delete the table's storage objects. Default true; false only unregisters the name."),
463
+ },
464
+ }, async ({ table, purge }) => {
465
+ try {
466
+ const reclaim = purge ?? true;
467
+ db.dropTable(table, reclaim);
468
+ return ok({ table, dropped: true, purged: reclaim });
469
+ }
470
+ catch (err) {
471
+ return fail(`drop_table failed: ${errText(err, "write")}`);
472
+ }
473
+ });
296
474
  // Build the returned-column projection for a search hit. A caller-supplied
297
475
  // `columns` list is honored so clients can retrieve the fields they need
298
476
  // (e.g. a path + line range to cite), with `_id` and `score` always appended
@@ -302,46 +480,6 @@ function searchProjection(columns, textCol) {
302
480
  const base = columns && columns.length > 0 ? columns : textCol ? [textCol] : [];
303
481
  return [...new Set([...base, "_id", "score"])];
304
482
  }
305
- // Search hits carry the full text column by default. A deployment whose rows
306
- // are whole documents rather than chunks (a 4 KB transcript per row, say) can
307
- // set INFINO_MCP_SNIPPET_CHARS so hits carry a snippet instead: an agent
308
- // reading 50 hits needs enough text to judge relevance, not 50 documents in
309
- // its context, and it can read any hit in full by id afterwards. The operator
310
- // knows the row shape; the model finds out only after paying for it once. A
311
- // per-call `snippetChars` overrides the deployment default either way (0 =
312
- // full text). Only the searched text column is cut; ids, paths, other
313
- // projected columns, and scores pass through as-is.
314
- const SNIPPET_DEFAULT = (() => {
315
- const raw = process.env.INFINO_MCP_SNIPPET_CHARS;
316
- if (!raw)
317
- return 0;
318
- const n = Number(raw);
319
- if (!Number.isInteger(n) || n < 0) {
320
- console.error(`INFINO_MCP_SNIPPET_CHARS must be a non-negative integer (got ${raw}); using full text`);
321
- return 0;
322
- }
323
- return n;
324
- })();
325
- const snippetParam = z
326
- .number()
327
- .int()
328
- .min(0)
329
- .optional()
330
- .describe("Cut the returned text column to this many characters; 0 returns the full text. " +
331
- (SNIPPET_DEFAULT > 0
332
- ? `This deployment defaults to ${SNIPPET_DEFAULT}. `
333
- : "Defaults to the full text. ") +
334
- "Pass a small value when asking for many hits, so results stay compact; read a hit in full afterwards with infino_sql.");
335
- function snippetize(rows, textCol, limit) {
336
- if (limit <= 0 || !textCol)
337
- return rows;
338
- return rows.map((row) => {
339
- const value = row[textCol];
340
- return typeof value === "string" && value.length > limit
341
- ? { ...row, [textCol]: `${value.slice(0, limit)}…` }
342
- : row;
343
- });
344
- }
345
483
  // What a hit's `score` means differs per tool, and the direction flips: the
346
484
  // engine reports vector kNN as a distance and BM25/RRF as relevance. Every
347
485
  // search response says which, so a client never ranks or thresholds backwards.
@@ -352,10 +490,11 @@ const SCORE_KIND = {
352
490
  };
353
491
  server.registerTool("infino_semantic_search", {
354
492
  title: "Semantic (vector) search",
493
+ annotations: READ_ONLY,
355
494
  description: "Use when searching for a concept by meaning and the exact wording is unknown — this retrieves paraphrases and " +
356
495
  "synonyms, not just literal matches. Embeds the query with a local model (no API key) and ranks a table's " +
357
- "embedding column by vector similarity. Each hit carries a score that is a DISTANCE (lower is closer) and the " +
358
- "text column (full, or a snippet — see snippetChars). Optional 'filter' restricts the ranking to rows " +
496
+ "embedding column by vector similarity. Each hit carries a score that is a DISTANCE (lower is closer) plus the " +
497
+ "columns you project ('columns'; the full text column by default). Optional 'filter' restricts the ranking to rows " +
359
498
  "whose keyword column matches a predicate first (a pushdown pre-filter, e.g. semantic search only within rows " +
360
499
  "tagged 'billing'). For exact terms use infino_keyword_search; when the query has both literal terms and an " +
361
500
  "intent use infino_hybrid_search.",
@@ -365,11 +504,10 @@ server.registerTool("infino_semantic_search", {
365
504
  k: z.number().int().positive().max(100).default(10).describe("Maximum results."),
366
505
  column: z.string().optional().describe("Text column to return with each hit; inferred if omitted."),
367
506
  vectorColumn: z.string().optional().describe("Vector column to search; inferred if omitted."),
368
- snippetChars: snippetParam,
369
507
  columns: z
370
508
  .array(z.string())
371
509
  .optional()
372
- .describe("Columns to return with each hit (e.g. an id, path, or line range to cite). Defaults to the text column; '_id' and 'score' are always included."),
510
+ .describe("Which of the table's columns each hit returns, with full values (a projection passed straight to the engine). Defaults to the text column; '_id' and 'score' are always included. Any column works: ['id'] for compact hits at a large k, ['id', 'text'] to get the full text alongside an id to cite, ['title', 'created_at'] for metadata. Nothing is truncated; read fewer columns or a smaller k to keep results small."),
373
511
  filter: z
374
512
  .object({
375
513
  column: z.string().describe("Keyword-indexed (FTS) column the predicate applies to."),
@@ -382,13 +520,14 @@ server.registerTool("infino_semantic_search", {
382
520
  .optional()
383
521
  .describe("Pre-filter: rank the kNN only among rows whose FTS 'column' matches 'query' (a pushdown pre-filter, not a post-filter on the results)."),
384
522
  },
385
- }, async ({ table, query, k, column, vectorColumn, snippetChars, columns, filter }) => {
523
+ }, async ({ table, query, k, column, vectorColumn, columns, filter }) => {
386
524
  try {
387
525
  const handle = db.openTable(table);
388
526
  const vecCol = vectorColumn ?? inferVectorColumn(handle);
389
527
  if (!vecCol)
390
528
  return fail(`semantic_search: no vector column in '${table}' — pass 'vectorColumn'.`);
391
529
  const textCol = column ?? inferTextColumn(handle);
530
+ await assertVectorWidth(handle, table, vecCol);
392
531
  const vector = await embed(query);
393
532
  const projection = searchProjection(columns, textCol);
394
533
  const { value: results, tookMs } = timed(() => handle.vectorSearch(vecCol, vector, k, { projection, filter }));
@@ -396,7 +535,7 @@ server.registerTool("infino_semantic_search", {
396
535
  table,
397
536
  query,
398
537
  score_kind: SCORE_KIND.semantic,
399
- results: snippetize(results, textCol, snippetChars ?? SNIPPET_DEFAULT),
538
+ results,
400
539
  took_ms: tookMs,
401
540
  });
402
541
  }
@@ -406,10 +545,11 @@ server.registerTool("infino_semantic_search", {
406
545
  });
407
546
  server.registerTool("infino_keyword_search", {
408
547
  title: "Keyword (BM25) search",
548
+ annotations: READ_ONLY,
409
549
  description: "Use when the query is literal terms — identifiers, error codes, product names, exact phrases — and you want " +
410
550
  "results ranked by relevance. BM25 full-text search over a text column: ranks rows by how well the query's " +
411
- "tokens (and their stems) match, each with a relevance score (higher is better) and the text column (full, or " +
412
- "a snippet — see snippetChars). Matches exact tokens, not synonyms or paraphrases. " +
551
+ "tokens (and their stems) match, each with a relevance score (higher is better) plus the columns you project " +
552
+ "('columns'; the full text column by default). Matches exact tokens, not synonyms or paraphrases. " +
413
553
  "Prefer this over SQL LIKE for known literal terms. For meaning-based search use infino_semantic_search; for " +
414
554
  "both at once use infino_hybrid_search.",
415
555
  inputSchema: {
@@ -420,26 +560,33 @@ server.registerTool("infino_keyword_search", {
420
560
  .string()
421
561
  .optional()
422
562
  .describe("Text column to search; inferred from the table schema when omitted."),
423
- snippetChars: snippetParam,
563
+ mode: z
564
+ .enum(["or", "and"])
565
+ .optional()
566
+ .describe("Match any query token ('or', the default) or require every token ('and')."),
567
+ stats: z
568
+ .enum(["per_superfile", "global"])
569
+ .optional()
570
+ .describe("BM25 statistics scope: 'per_superfile' (the default; each segment scored against its own statistics) or 'global' (one table-wide idf, so a table written in many small batches ranks like one corpus)."),
424
571
  columns: z
425
572
  .array(z.string())
426
573
  .optional()
427
- .describe("Columns to return with each hit (e.g. an id, path, or line range to cite). Defaults to the searched column; '_id' and 'score' are always included."),
574
+ .describe("Which of the table's columns each hit returns, with full values (a projection passed straight to the engine). Defaults to the searched column; '_id' and 'score' are always included. Any column works: ['id'] for compact hits at a large k, ['id', 'text'] to get the full text alongside an id to cite, ['title', 'created_at'] for metadata. Nothing is truncated; read fewer columns or a smaller k to keep results small."),
428
575
  },
429
- }, async ({ table, query, k, column, snippetChars, columns }) => {
576
+ }, async ({ table, query, k, column, mode, stats, columns }) => {
430
577
  try {
431
578
  const handle = db.openTable(table);
432
579
  const col = column ?? inferTextColumn(handle);
433
580
  if (!col) {
434
581
  return fail(`keyword_search: no text column found in '${table}' — pass 'column' explicitly.`);
435
582
  }
436
- const { value: results, tookMs } = timed(() => handle.bm25Search(col, query, k, { projection: searchProjection(columns, col) }));
583
+ const { value: results, tookMs } = timed(() => handle.bm25Search(col, query, k, { mode, stats, projection: searchProjection(columns, col) }));
437
584
  return ok({
438
585
  table,
439
586
  column: col,
440
587
  query,
441
588
  score_kind: SCORE_KIND.keyword,
442
- results: snippetize(results, col, snippetChars ?? SNIPPET_DEFAULT),
589
+ results,
443
590
  took_ms: tookMs,
444
591
  });
445
592
  }
@@ -449,10 +596,11 @@ server.registerTool("infino_keyword_search", {
449
596
  });
450
597
  server.registerTool("infino_hybrid_search", {
451
598
  title: "Hybrid (keyword + semantic) search",
599
+ annotations: READ_ONLY,
452
600
  description: "Use when a query carries both specific terms and an intent — you want exact-term precision without giving up " +
453
601
  "paraphrase recall. Fuses BM25 over a text column with vector similarity over the embedding column in a single " +
454
602
  "ranking pass, so rows matching the literal terms AND the meaning rank highest; the score is the fused rank " +
455
- "(higher is better) and each hit carries the text column (full, or a snippet — see snippetChars). Embeds the query with a local " +
603
+ "(higher is better) plus the columns you project ('columns'; the full text column by default). Embeds the query with a local " +
456
604
  "model (no API key). Sits between infino_keyword_search (literal only) and infino_semantic_search (meaning only).",
457
605
  inputSchema: {
458
606
  table: z.string().describe("Table to search."),
@@ -460,13 +608,16 @@ server.registerTool("infino_hybrid_search", {
460
608
  k: z.number().int().positive().max(100).default(10).describe("Maximum results."),
461
609
  column: z.string().optional().describe("Text column for the keyword half; inferred if omitted."),
462
610
  vectorColumn: z.string().optional().describe("Vector column for the semantic half; inferred if omitted."),
463
- snippetChars: snippetParam,
611
+ mode: z
612
+ .enum(["or", "and"])
613
+ .optional()
614
+ .describe("Keyword half: match any query token ('or', the default) or require every token ('and')."),
464
615
  columns: z
465
616
  .array(z.string())
466
617
  .optional()
467
- .describe("Columns to return with each hit (e.g. an id, path, or line range to cite). Defaults to the text column; '_id' and 'score' are always included."),
618
+ .describe("Which of the table's columns each hit returns, with full values (a projection passed straight to the engine). Defaults to the text column; '_id' and 'score' are always included. Any column works: ['id'] for compact hits at a large k, ['id', 'text'] to get the full text alongside an id to cite, ['title', 'created_at'] for metadata. Nothing is truncated; read fewer columns or a smaller k to keep results small."),
468
619
  },
469
- }, async ({ table, query, k, column, vectorColumn, snippetChars, columns }) => {
620
+ }, async ({ table, query, k, column, vectorColumn, mode, columns }) => {
470
621
  try {
471
622
  const handle = db.openTable(table);
472
623
  const textCol = column ?? inferTextColumn(handle);
@@ -475,15 +626,17 @@ server.registerTool("infino_hybrid_search", {
475
626
  const vecCol = vectorColumn ?? inferVectorColumn(handle);
476
627
  if (!vecCol)
477
628
  return fail(`hybrid_search: no vector column in '${table}' — pass 'vectorColumn'.`);
629
+ await assertVectorWidth(handle, table, vecCol);
478
630
  const vector = await embed(query);
479
631
  const { value: results, tookMs } = timed(() => handle.hybridSearch(textCol, query, vecCol, vector, k, {
632
+ mode,
480
633
  projection: searchProjection(columns, textCol),
481
634
  }));
482
635
  return ok({
483
636
  table,
484
637
  query,
485
638
  score_kind: SCORE_KIND.hybrid,
486
- results: snippetize(results, textCol, snippetChars ?? SNIPPET_DEFAULT),
639
+ results,
487
640
  took_ms: tookMs,
488
641
  });
489
642
  }
@@ -493,6 +646,7 @@ server.registerTool("infino_hybrid_search", {
493
646
  });
494
647
  server.registerTool("infino_token_match", {
495
648
  title: "Token match (unranked keyword filter)",
649
+ annotations: READ_ONLY,
496
650
  description: "Use when you need the SET of rows containing a keyword, not a ranked order — a fast unranked keyword filter. " +
497
651
  "Returns rows whose text column contains the token(s), matching indexed tokens and their stems. For ranked " +
498
652
  "results use infino_keyword_search; for analytical filtering across columns use infino_sql.",
@@ -527,6 +681,7 @@ server.registerTool("infino_token_match", {
527
681
  });
528
682
  server.registerTool("infino_exact_match", {
529
683
  title: "Exact match (unranked exact filter)",
684
+ annotations: READ_ONLY,
530
685
  description: "Use to fetch rows whose column exactly equals a value — a tag, status, or id string. Unranked exact-equality " +
531
686
  "filter over an indexed column. For ranked text relevance use infino_keyword_search; for multi-column " +
532
687
  "analytical filtering use infino_sql.",
@@ -557,6 +712,7 @@ server.registerTool("infino_exact_match", {
557
712
  });
558
713
  server.registerTool("infino_count", {
559
714
  title: "Count keyword matches",
715
+ annotations: READ_ONLY,
560
716
  description: "Use when you only need HOW MANY rows match a keyword query, not the rows themselves — a fast tally over a text " +
561
717
  "column, without fetching or ranking. Cheaper than infino_keyword_search when a number is all you need (e.g. " +
562
718
  "'how many docs mention X'). For the matching rows use infino_keyword_search or infino_token_match.",
@@ -588,6 +744,7 @@ server.registerTool("infino_count", {
588
744
  });
589
745
  server.registerTool("infino_sql", {
590
746
  title: "SQL over Infino",
747
+ annotations: DESTRUCTIVE,
591
748
  description: "Use for structural or analytical questions — counts, GROUP BY, joins, aggregates, filtering by column value — " +
592
749
  "returning result rows. The engine's search functions are callable as table-valued relations, so a single query " +
593
750
  "can rank AND aggregate: bm25_search('table','text_col','terms', k) — also bm25_search_prefix / token_match / " +
@@ -596,15 +753,9 @@ server.registerTool("infino_sql", {
596
753
  "where the vector goes and pass embed:{\"name\":\"query text\"} — the server embeds the text and substitutes the " +
597
754
  "vector in. Example: SELECT path, SUM(end_line - start_line + 1) AS lines FROM " +
598
755
  "bm25_search('docs','body','error timeout', 300) GROUP BY path ORDER BY lines DESC. " +
599
- (writesEnabled
600
- ? "Any single statement is allowed (including DDL/DML), since INFINO_MCP_ENABLE_WRITES is set."
601
- : "Read-only: a single SELECT / WITH statement; DDL/DML is rejected."),
756
+ "Any single statement is allowed, DDL/DML included.",
602
757
  inputSchema: {
603
- query: writesEnabled
604
- ? z.string().describe("A single SQL statement. May use search TVFs and {{name}} vector placeholders.")
605
- : z
606
- .string()
607
- .describe("A single read-only SELECT or WITH statement. May use search TVFs and {{name}} vector placeholders."),
758
+ query: z.string().describe("A single SQL statement. May use search TVFs and {{name}} vector placeholders."),
608
759
  embed: z
609
760
  .record(z.string(), z.string())
610
761
  .optional()
@@ -615,90 +766,95 @@ server.registerTool("infino_sql", {
615
766
  }, async ({ query, embed: embeds }) => {
616
767
  try {
617
768
  const sql = await applyEmbeds(query, embeds);
618
- const { value: rows, tookMs } = timed(() => db.querySql(guardSql(sql, writesEnabled)));
769
+ const { value: rows, tookMs } = timed(() => db.querySql(guardSql(sql)));
619
770
  return ok({ rows, took_ms: tookMs });
620
771
  }
621
772
  catch (err) {
622
773
  return fail(`sql failed: ${errText(err)}`);
623
774
  }
624
775
  });
625
- // Write tool — registered only when writes are enabled, so a read-only install
626
- // never advertises it to the agent.
627
- if (writesEnabled) {
628
- server.registerTool("infino_add_documents", {
629
- title: "Add documents to an Infino table",
630
- description: "Append documents (rows, as JSON objects keyed by column name) to a table — one call is one commit. " +
631
- "If the table has a vector index and a document omits the vector, the server embeds its text column " +
632
- "(a local model, no API key). Available only because INFINO_MCP_ENABLE_WRITES is set.",
633
- inputSchema: {
634
- table: z.string().describe("Table to append to."),
635
- documents: z
636
- .array(z.record(z.string(), z.any()))
637
- .min(1)
638
- .describe("Rows to append, as JSON objects keyed by column name."),
639
- },
640
- }, async ({ table, documents }) => {
641
- try {
642
- const handle = db.openTable(table);
643
- const rows = await embedRows(handle, documents);
644
- handle.append(rows);
645
- return ok({ table, appended: rows.length });
646
- }
647
- catch (err) {
648
- return fail(`add_documents failed: ${errText(err)}`);
649
- }
650
- });
651
- server.registerTool("infino_update_documents", {
652
- title: "Update documents in an Infino table",
653
- description: "Replace the rows matching a SQL predicate with new documents, 1:1 — the number of matched rows must equal " +
654
- "the number of replacement documents. As with add, a row that omits its vector has it embedded from the text " +
655
- "column (local model, no API key). Requires durable storage (not memory://). Available only because " +
656
- "INFINO_MCP_ENABLE_WRITES is set.",
657
- inputSchema: {
658
- table: z.string().describe("Table to update."),
659
- predicate: z
660
- .string()
661
- .describe("SQL predicate selecting the rows to replace, e.g. \"status = 'draft'\"."),
662
- documents: z
663
- .array(z.record(z.string(), z.any()))
664
- .min(1)
665
- .describe("Replacement rows, as JSON objects keyed by column name (one per matched row)."),
666
- },
667
- }, async ({ table, predicate, documents }) => {
668
- try {
669
- const handle = db.openTable(table);
670
- const rows = await embedRows(handle, documents);
671
- const stats = handle.update(predicate, rows);
672
- return ok({ table, predicate, ...stats });
673
- }
674
- catch (err) {
675
- return fail(`update_documents failed: ${errText(err)}`);
676
- }
677
- });
678
- server.registerTool("infino_delete_documents", {
679
- title: "Delete documents from an Infino table",
680
- description: "Delete the rows matching a SQL predicate, e.g. \"status = 'spam'\". Returns how many rows matched and were " +
681
- "removed. Requires durable storage (not memory://). Available only because INFINO_MCP_ENABLE_WRITES is set.",
682
- inputSchema: {
683
- table: z.string().describe("Table to delete from."),
684
- predicate: z
685
- .string()
686
- .describe("SQL predicate selecting the rows to delete, e.g. \"status = 'spam'\"."),
687
- },
688
- }, async ({ table, predicate }) => {
689
- try {
690
- const stats = db.openTable(table).delete(predicate);
691
- return ok({ table, predicate, ...stats });
692
- }
693
- catch (err) {
694
- return fail(`delete_documents failed: ${errText(err)}`);
695
- }
696
- });
697
- }
776
+ // --- document writes ---------------------------------------------------------
777
+ server.registerTool("infino_add_documents", {
778
+ title: "Add documents to an Infino table",
779
+ annotations: ADDITIVE,
780
+ description: "Append documents (rows, as JSON objects keyed by column name) to a table; one call is one commit. " +
781
+ "If the table has a vector index and a document omits the vector, the server embeds its text column " +
782
+ "(a local model, no API key). Send tens of rows per call; for a whole corpus use the infino CLI or an SDK.",
783
+ inputSchema: {
784
+ table: z.string().describe("Table to append to."),
785
+ documents: z
786
+ .array(z.record(z.string(), z.any()))
787
+ .min(1)
788
+ .describe("Rows to append, as JSON objects keyed by column name."),
789
+ },
790
+ }, async ({ table, documents }) => {
791
+ try {
792
+ const handle = db.openTable(table);
793
+ const { rows, embedded } = await prepareRows(handle, table, documents);
794
+ const { tookMs } = timed(() => handle.append(rows));
795
+ return ok({
796
+ table,
797
+ appended: rows.length,
798
+ embedded,
799
+ took_ms: tookMs,
800
+ verify: `infino_count or a search on '${table}' shows the new rows`,
801
+ });
802
+ }
803
+ catch (err) {
804
+ return fail(`add_documents failed: ${errText(err, "write")}`);
805
+ }
806
+ });
807
+ server.registerTool("infino_update_documents", {
808
+ title: "Update documents in an Infino table",
809
+ annotations: DESTRUCTIVE,
810
+ description: "Replace the rows matching a SQL predicate with new documents, 1:1; the number of matched rows must equal " +
811
+ "the number of replacement documents. As with add, a row that omits its vector has it embedded from the text " +
812
+ "column (local model, no API key). Requires durable storage (not memory://).",
813
+ inputSchema: {
814
+ table: z.string().describe("Table to update."),
815
+ predicate: z
816
+ .string()
817
+ .describe("SQL predicate selecting the rows to replace, e.g. \"status = 'draft'\"."),
818
+ documents: z
819
+ .array(z.record(z.string(), z.any()))
820
+ .min(1)
821
+ .describe("Replacement rows, as JSON objects keyed by column name (one per matched row)."),
822
+ },
823
+ }, async ({ table, predicate, documents }) => {
824
+ try {
825
+ const handle = db.openTable(table);
826
+ const { rows, embedded } = await prepareRows(handle, table, documents);
827
+ const stats = handle.update(predicate, rows);
828
+ return ok({ table, predicate, ...stats, embedded });
829
+ }
830
+ catch (err) {
831
+ return fail(`update_documents failed: ${errText(err, "write")}`);
832
+ }
833
+ });
834
+ server.registerTool("infino_delete_documents", {
835
+ title: "Delete documents from an Infino table",
836
+ annotations: DESTRUCTIVE,
837
+ description: "Delete the rows matching a SQL predicate, e.g. \"status = 'spam'\". Returns how many rows matched and were " +
838
+ "removed. Check the predicate first with infino_count or infino_sql. Requires durable storage (not memory://).",
839
+ inputSchema: {
840
+ table: z.string().describe("Table to delete from."),
841
+ predicate: z
842
+ .string()
843
+ .describe("SQL predicate selecting the rows to delete, e.g. \"status = 'spam'\"."),
844
+ },
845
+ }, async ({ table, predicate }) => {
846
+ try {
847
+ const stats = db.openTable(table).delete(predicate);
848
+ return ok({ table, predicate, ...stats });
849
+ }
850
+ catch (err) {
851
+ return fail(`delete_documents failed: ${errText(err, "write")}`);
852
+ }
853
+ });
698
854
  // --- transport -------------------------------------------------------------
699
855
  // stdio for desktop/CLI clients (Claude Desktop/Code, Cursor). Logs go to
700
856
  // stderr so they never corrupt the JSON-RPC stream on stdout.
701
857
  const transport = new StdioServerTransport();
702
858
  await server.connect(transport);
703
859
  console.error(`infino MCP server ready on stdio (uri: ${uri}, mode: ${isHosted ? "hosted" : "embedded"}, ` +
704
- `writes: ${writesEnabled ? "on" : "off"}, embedder: ${embedderInfo()})`);
860
+ `embedder: ${embedderInfo()})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infino-ai/mcp-server",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "MCP server for Infino — keyword, vector, hybrid, and SQL retrieval over data on object storage, for AI agents.",
5
5
  "mcpName": "io.github.infino-ai/mcp-server",
6
6
  "license": "Apache-2.0",
@@ -51,9 +51,9 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@huggingface/transformers": "^4.2.0",
54
- "@infino-ai/infino": "^0.5.1",
54
+ "@infino-ai/infino": "^0.5.8",
55
55
  "@modelcontextprotocol/sdk": "^1.30.0",
56
- "zod": "^4.4.3"
56
+ "zod": "^4.5.1"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/node": "^26",