@infino-ai/mcp-server 0.3.0 → 0.4.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
@@ -243,9 +243,9 @@ The model must match what produced the stored vectors — a mismatch yields mean
243
243
 
244
244
  | Tool | Arguments | What it does |
245
245
  | --- | --- | --- |
246
- | `infino_semantic_search` | `table`, `query`, `k`, `column?`, `vectorColumn?`, `filter?` | Find passages by **meaning** — embeds the query with a local model (no key) and ranks by vector similarity. Handles paraphrase and synonyms. Optional `filter` (`{column, query, mode?}`) restricts the ranking to rows whose keyword column matches first (a pushdown pre-filter). |
247
- | `infino_keyword_search` | `table`, `query`, `k`, `column?` | BM25 full-text search — for exact terms, identifiers, error codes, product names. |
248
- | `infino_hybrid_search` | `table`, `query`, `k`, `column?`, `vectorColumn?` | **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. |
246
+ | `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. 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. |
247
+ | `infino_keyword_search` | `table`, `query`, `k`, `column?`, `columns?` | BM25 full-text search — for exact terms, identifiers, error codes, product names. |
248
+ | `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. |
249
249
  | `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. |
250
250
  | `infino_exact_match` | `table`, `value`, `column?`, `limit?` | Unranked exact-equality filter over an indexed column (tag, status, id string). |
251
251
  | `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`. |
package/dist/index.js CHANGED
@@ -203,6 +203,15 @@ server.registerTool("infino_describe_table", {
203
203
  return fail(`describe_table failed: ${err.message}`);
204
204
  }
205
205
  });
206
+ // Build the returned-column projection for a search hit. A caller-supplied
207
+ // `columns` list is honored so clients can retrieve the fields they need
208
+ // (e.g. a path + line range to cite), with `_id` and `score` always appended
209
+ // so every hit keeps its id and ranking score. Defaults to the (searched)
210
+ // text column plus `_id`/`score`.
211
+ function searchProjection(columns, textCol) {
212
+ const base = columns && columns.length > 0 ? columns : textCol ? [textCol] : [];
213
+ return [...new Set([...base, "_id", "score"])];
214
+ }
206
215
  server.registerTool("infino_semantic_search", {
207
216
  title: "Semantic (vector) search",
208
217
  description: "Use when searching for a concept by meaning and the exact wording is unknown — this retrieves paraphrases and " +
@@ -217,6 +226,10 @@ server.registerTool("infino_semantic_search", {
217
226
  k: z.number().int().positive().max(100).default(10).describe("Maximum results."),
218
227
  column: z.string().optional().describe("Text column to return with each hit; inferred if omitted."),
219
228
  vectorColumn: z.string().optional().describe("Vector column to search; inferred if omitted."),
229
+ columns: z
230
+ .array(z.string())
231
+ .optional()
232
+ .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."),
220
233
  filter: z
221
234
  .object({
222
235
  column: z.string().describe("Keyword-indexed (FTS) column the predicate applies to."),
@@ -229,7 +242,7 @@ server.registerTool("infino_semantic_search", {
229
242
  .optional()
230
243
  .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)."),
231
244
  },
232
- }, async ({ table, query, k, column, vectorColumn, filter }) => {
245
+ }, async ({ table, query, k, column, vectorColumn, columns, filter }) => {
233
246
  try {
234
247
  const handle = db.openTable(table);
235
248
  const vecCol = vectorColumn ?? inferVectorColumn(handle);
@@ -237,7 +250,7 @@ server.registerTool("infino_semantic_search", {
237
250
  return fail(`semantic_search: no vector column in '${table}' — pass 'vectorColumn'.`);
238
251
  const textCol = column ?? inferTextColumn(handle);
239
252
  const vector = await embed(query);
240
- const projection = textCol ? [textCol, "_id", "score"] : ["_id", "score"];
253
+ const projection = searchProjection(columns, textCol);
241
254
  const results = handle.vectorSearch(vecCol, vector, k, { projection, filter });
242
255
  return ok({ table, query, results });
243
256
  }
@@ -260,15 +273,19 @@ server.registerTool("infino_keyword_search", {
260
273
  .string()
261
274
  .optional()
262
275
  .describe("Text column to search; inferred from the table schema when omitted."),
276
+ columns: z
277
+ .array(z.string())
278
+ .optional()
279
+ .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."),
263
280
  },
264
- }, async ({ table, query, k, column }) => {
281
+ }, async ({ table, query, k, column, columns }) => {
265
282
  try {
266
283
  const handle = db.openTable(table);
267
284
  const col = column ?? inferTextColumn(handle);
268
285
  if (!col) {
269
286
  return fail(`keyword_search: no text column found in '${table}' — pass 'column' explicitly.`);
270
287
  }
271
- const results = handle.bm25Search(col, query, k, { projection: [col, "_id", "score"] });
288
+ const results = handle.bm25Search(col, query, k, { projection: searchProjection(columns, col) });
272
289
  return ok({ table, column: col, query, results });
273
290
  }
274
291
  catch (err) {
@@ -287,8 +304,12 @@ server.registerTool("infino_hybrid_search", {
287
304
  k: z.number().int().positive().max(100).default(10).describe("Maximum results."),
288
305
  column: z.string().optional().describe("Text column for the keyword half; inferred if omitted."),
289
306
  vectorColumn: z.string().optional().describe("Vector column for the semantic half; inferred if omitted."),
307
+ columns: z
308
+ .array(z.string())
309
+ .optional()
310
+ .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."),
290
311
  },
291
- }, async ({ table, query, k, column, vectorColumn }) => {
312
+ }, async ({ table, query, k, column, vectorColumn, columns }) => {
292
313
  try {
293
314
  const handle = db.openTable(table);
294
315
  const textCol = column ?? inferTextColumn(handle);
@@ -299,7 +320,7 @@ server.registerTool("infino_hybrid_search", {
299
320
  return fail(`hybrid_search: no vector column in '${table}' — pass 'vectorColumn'.`);
300
321
  const vector = await embed(query);
301
322
  const results = handle.hybridSearch(textCol, query, vecCol, vector, k, {
302
- projection: [textCol, "_id", "score"],
323
+ projection: searchProjection(columns, textCol),
303
324
  });
304
325
  return ok({ table, query, results });
305
326
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infino-ai/mcp-server",
3
- "version": "0.3.0",
3
+ "version": "0.4.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",