@infino-ai/mcp-server 0.11.0 → 0.12.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 +4 -5
- package/dist/index.js +14 -57
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -201,7 +201,6 @@ All configuration is via environment variables — there are no config files and
|
|
|
201
201
|
| `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
202
|
| `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
203
|
| `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
204
|
|
|
206
205
|
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
206
|
|
|
@@ -276,9 +275,9 @@ the data.
|
|
|
276
275
|
|
|
277
276
|
| Tool | Arguments | What it does |
|
|
278
277
|
| --- | --- | --- |
|
|
279
|
-
| `infino_semantic_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `
|
|
280
|
-
| `infino_keyword_search` | `table`, `query`, `k`, `column?`, `
|
|
281
|
-
| `infino_hybrid_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `
|
|
278
|
+
| `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. |
|
|
279
|
+
| `infino_keyword_search` | `table`, `query`, `k`, `column?`, `columns?` | BM25 full-text search — for exact terms, identifiers, error codes, product names. `score` is a relevance (higher is better). |
|
|
280
|
+
| `infino_hybrid_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `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
281
|
| `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
282
|
| `infino_exact_match` | `table`, `value`, `column?`, `limit?` | Unranked exact-equality filter over an indexed column (tag, status, id string). |
|
|
284
283
|
| `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`. |
|
|
@@ -289,7 +288,7 @@ the data.
|
|
|
289
288
|
| `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
289
|
| `infino_delete_documents` | `table`, `predicate` | Delete the rows matching a SQL predicate. Durable storage only. **Only when `INFINO_MCP_ENABLE_WRITES` is set.** |
|
|
291
290
|
|
|
292
|
-
Search hits
|
|
291
|
+
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
292
|
|
|
294
293
|
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
294
|
|
package/dist/index.js
CHANGED
|
@@ -302,46 +302,6 @@ function searchProjection(columns, textCol) {
|
|
|
302
302
|
const base = columns && columns.length > 0 ? columns : textCol ? [textCol] : [];
|
|
303
303
|
return [...new Set([...base, "_id", "score"])];
|
|
304
304
|
}
|
|
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
305
|
// What a hit's `score` means differs per tool, and the direction flips: the
|
|
346
306
|
// engine reports vector kNN as a distance and BM25/RRF as relevance. Every
|
|
347
307
|
// search response says which, so a client never ranks or thresholds backwards.
|
|
@@ -354,8 +314,8 @@ server.registerTool("infino_semantic_search", {
|
|
|
354
314
|
title: "Semantic (vector) search",
|
|
355
315
|
description: "Use when searching for a concept by meaning and the exact wording is unknown — this retrieves paraphrases and " +
|
|
356
316
|
"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)
|
|
358
|
-
"
|
|
317
|
+
"embedding column by vector similarity. Each hit carries a score that is a DISTANCE (lower is closer) plus the " +
|
|
318
|
+
"columns you project ('columns'; the full text column by default). Optional 'filter' restricts the ranking to rows " +
|
|
359
319
|
"whose keyword column matches a predicate first (a pushdown pre-filter, e.g. semantic search only within rows " +
|
|
360
320
|
"tagged 'billing'). For exact terms use infino_keyword_search; when the query has both literal terms and an " +
|
|
361
321
|
"intent use infino_hybrid_search.",
|
|
@@ -365,11 +325,10 @@ server.registerTool("infino_semantic_search", {
|
|
|
365
325
|
k: z.number().int().positive().max(100).default(10).describe("Maximum results."),
|
|
366
326
|
column: z.string().optional().describe("Text column to return with each hit; inferred if omitted."),
|
|
367
327
|
vectorColumn: z.string().optional().describe("Vector column to search; inferred if omitted."),
|
|
368
|
-
snippetChars: snippetParam,
|
|
369
328
|
columns: z
|
|
370
329
|
.array(z.string())
|
|
371
330
|
.optional()
|
|
372
|
-
.describe("
|
|
331
|
+
.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
332
|
filter: z
|
|
374
333
|
.object({
|
|
375
334
|
column: z.string().describe("Keyword-indexed (FTS) column the predicate applies to."),
|
|
@@ -382,7 +341,7 @@ server.registerTool("infino_semantic_search", {
|
|
|
382
341
|
.optional()
|
|
383
342
|
.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
343
|
},
|
|
385
|
-
}, async ({ table, query, k, column, vectorColumn,
|
|
344
|
+
}, async ({ table, query, k, column, vectorColumn, columns, filter }) => {
|
|
386
345
|
try {
|
|
387
346
|
const handle = db.openTable(table);
|
|
388
347
|
const vecCol = vectorColumn ?? inferVectorColumn(handle);
|
|
@@ -396,7 +355,7 @@ server.registerTool("infino_semantic_search", {
|
|
|
396
355
|
table,
|
|
397
356
|
query,
|
|
398
357
|
score_kind: SCORE_KIND.semantic,
|
|
399
|
-
results
|
|
358
|
+
results,
|
|
400
359
|
took_ms: tookMs,
|
|
401
360
|
});
|
|
402
361
|
}
|
|
@@ -408,8 +367,8 @@ server.registerTool("infino_keyword_search", {
|
|
|
408
367
|
title: "Keyword (BM25) search",
|
|
409
368
|
description: "Use when the query is literal terms — identifiers, error codes, product names, exact phrases — and you want " +
|
|
410
369
|
"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)
|
|
412
|
-
"
|
|
370
|
+
"tokens (and their stems) match, each with a relevance score (higher is better) plus the columns you project " +
|
|
371
|
+
"('columns'; the full text column by default). Matches exact tokens, not synonyms or paraphrases. " +
|
|
413
372
|
"Prefer this over SQL LIKE for known literal terms. For meaning-based search use infino_semantic_search; for " +
|
|
414
373
|
"both at once use infino_hybrid_search.",
|
|
415
374
|
inputSchema: {
|
|
@@ -420,13 +379,12 @@ server.registerTool("infino_keyword_search", {
|
|
|
420
379
|
.string()
|
|
421
380
|
.optional()
|
|
422
381
|
.describe("Text column to search; inferred from the table schema when omitted."),
|
|
423
|
-
snippetChars: snippetParam,
|
|
424
382
|
columns: z
|
|
425
383
|
.array(z.string())
|
|
426
384
|
.optional()
|
|
427
|
-
.describe("
|
|
385
|
+
.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
386
|
},
|
|
429
|
-
}, async ({ table, query, k, column,
|
|
387
|
+
}, async ({ table, query, k, column, columns }) => {
|
|
430
388
|
try {
|
|
431
389
|
const handle = db.openTable(table);
|
|
432
390
|
const col = column ?? inferTextColumn(handle);
|
|
@@ -439,7 +397,7 @@ server.registerTool("infino_keyword_search", {
|
|
|
439
397
|
column: col,
|
|
440
398
|
query,
|
|
441
399
|
score_kind: SCORE_KIND.keyword,
|
|
442
|
-
results
|
|
400
|
+
results,
|
|
443
401
|
took_ms: tookMs,
|
|
444
402
|
});
|
|
445
403
|
}
|
|
@@ -452,7 +410,7 @@ server.registerTool("infino_hybrid_search", {
|
|
|
452
410
|
description: "Use when a query carries both specific terms and an intent — you want exact-term precision without giving up " +
|
|
453
411
|
"paraphrase recall. Fuses BM25 over a text column with vector similarity over the embedding column in a single " +
|
|
454
412
|
"ranking pass, so rows matching the literal terms AND the meaning rank highest; the score is the fused rank " +
|
|
455
|
-
"(higher is better)
|
|
413
|
+
"(higher is better) plus the columns you project ('columns'; the full text column by default). Embeds the query with a local " +
|
|
456
414
|
"model (no API key). Sits between infino_keyword_search (literal only) and infino_semantic_search (meaning only).",
|
|
457
415
|
inputSchema: {
|
|
458
416
|
table: z.string().describe("Table to search."),
|
|
@@ -460,13 +418,12 @@ server.registerTool("infino_hybrid_search", {
|
|
|
460
418
|
k: z.number().int().positive().max(100).default(10).describe("Maximum results."),
|
|
461
419
|
column: z.string().optional().describe("Text column for the keyword half; inferred if omitted."),
|
|
462
420
|
vectorColumn: z.string().optional().describe("Vector column for the semantic half; inferred if omitted."),
|
|
463
|
-
snippetChars: snippetParam,
|
|
464
421
|
columns: z
|
|
465
422
|
.array(z.string())
|
|
466
423
|
.optional()
|
|
467
|
-
.describe("
|
|
424
|
+
.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
425
|
},
|
|
469
|
-
}, async ({ table, query, k, column, vectorColumn,
|
|
426
|
+
}, async ({ table, query, k, column, vectorColumn, columns }) => {
|
|
470
427
|
try {
|
|
471
428
|
const handle = db.openTable(table);
|
|
472
429
|
const textCol = column ?? inferTextColumn(handle);
|
|
@@ -483,7 +440,7 @@ server.registerTool("infino_hybrid_search", {
|
|
|
483
440
|
table,
|
|
484
441
|
query,
|
|
485
442
|
score_kind: SCORE_KIND.hybrid,
|
|
486
|
-
results
|
|
443
|
+
results,
|
|
487
444
|
took_ms: tookMs,
|
|
488
445
|
});
|
|
489
446
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infino-ai/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.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",
|