@infino-ai/mcp-server 0.6.0 → 0.8.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.
Files changed (3) hide show
  1. package/README.md +41 -8
  2. package/dist/index.js +89 -27
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -6,9 +6,9 @@
6
6
 
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
- - **No API key.** Semantic search embeds queries with a local model — nothing leaves the machine for embedding.
9
+ - **Local embeddings, no key.** Semantic search embeds queries with a local model — nothing leaves the machine for embedding.
10
10
  - **Read-only by default.** Writes and full SQL are opt-in behind a single environment flag.
11
- - **Bring your own storage.** Point it at a local path or your own bucket (S3, Azure, or any S3-compatible store).
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
  ---
14
14
 
@@ -39,7 +39,7 @@ An [MCP](https://modelcontextprotocol.io) server for [Infino](https://github.com
39
39
 
40
40
  - **Node.js ≥ 18** (the server runs as a Node process over stdio).
41
41
  - **An MCP-compatible client** (Claude Code, Claude Desktop, Cursor, VS Code, …).
42
- - **Data reachable by Infino** — a local directory, or a bucket with credentials available in the environment (see [Storage backends](#storage-backends)).
42
+ - **Data reachable by Infino** — a local directory, a bucket with credentials available in the environment, or a hosted Infino Cloud endpoint with an API key (see [Storage backends](#storage-backends)).
43
43
  - On first run the server downloads the local embedding model (~90 MB) once and caches it; subsequent runs are offline for embedding.
44
44
 
45
45
  ---
@@ -58,6 +58,21 @@ The server is launched by your MCP client over stdio — you don't run it direct
58
58
  }
59
59
  ```
60
60
 
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:
64
+
65
+ ```jsonc
66
+ {
67
+ "command": "npx",
68
+ "args": ["-y", "@infino-ai/mcp-server"],
69
+ "env": {
70
+ "INFINO_MCP_URI": "https://api.platform.infino.ai/my-database",
71
+ "INFINO_API_KEY": "inf_…"
72
+ }
73
+ }
74
+ ```
75
+
61
76
  The sections below show the exact place each client expects this block.
62
77
 
63
78
  ---
@@ -178,7 +193,8 @@ All configuration is via environment variables — there are no config files and
178
193
 
179
194
  | Variable | Required | Default | Description |
180
195
  | --- | --- | --- | --- |
181
- | `INFINO_MCP_URI` | No | `~/.infino/mcp` (persistent) | Data to serve: a local path (`/Users/me/.infino/memory`) or a bucket URI (`s3://…`, `az://…`). 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. |
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
+ | `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. |
182
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. |
183
199
  | `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. |
184
200
  | `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`. |
@@ -207,6 +223,7 @@ The model must match what produced the stored vectors — a mismatch yields mean
207
223
  | AWS S3 | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (+ `AWS_SESSION_TOKEN`, `AWS_REGION` if used) |
208
224
  | S3-compatible (R2/MinIO/B2) | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` **and** `AWS_ENDPOINT_URL` |
209
225
  | Azure Blob | `AZURE_STORAGE_ACCOUNT`, `AZURE_STORAGE_KEY` |
226
+ | Infino Cloud (hosted) | `INFINO_API_KEY` — no object-storage credentials needed (the platform owns the storage) |
210
227
 
211
228
  ### Storage backends
212
229
 
@@ -235,8 +252,23 @@ The model must match what produced the stored vectors — a mismatch yields mean
235
252
  "AZURE_STORAGE_ACCOUNT": "…",
236
253
  "AZURE_STORAGE_KEY": "…"
237
254
  }
255
+
256
+ // Infino Cloud (hosted) — the database is the last path segment
257
+ "env": {
258
+ "INFINO_MCP_URI": "https://api.platform.infino.ai/my-database",
259
+ "INFINO_API_KEY": "inf_…"
260
+ }
238
261
  ```
239
262
 
263
+ On a hosted connection the search, SQL, and (when enabled) write tools all
264
+ behave exactly as they do locally — the only difference is where the data
265
+ lives. Compaction and garbage collection are handled server-side, so they are
266
+ not exposed as client operations. Note that semantic and hybrid search still
267
+ embed queries **locally** in this server, so `INFINO_MCP_EMBED_MODEL` must match
268
+ the model that produced the hosted table's stored vectors (see the OpenAI /
269
+ Azure OpenAI note above) — this matters especially when someone else ingested
270
+ the data.
271
+
240
272
  ---
241
273
 
242
274
  ## Tools
@@ -262,11 +294,11 @@ The engine's search table functions (`bm25_search`, `vector_search`, `hybrid_sea
262
294
 
263
295
  ## Security & data handling
264
296
 
265
- This server is designed to run locally, beside the client, and to keep data and credentials on the user's machine.
297
+ This server runs locally, beside the client, and keeps data and credentials on the user's machine.
266
298
 
267
- - **Local execution.** It runs as a subprocess of your MCP client over stdio. There is no network listener and no remote service.
268
- - **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 API key to provision or leak.
269
- - **Credentials stay in the environment.** Storage credentials are read from standard provider environment variables and used only to reach the bucket you configured. They are never logged or returned in tool output.
299
+ - **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.
300
+ - **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.)
301
+ - **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.
270
302
  - **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.
271
303
  - **Least privilege.** Point `INFINO_MCP_URI` at the narrowest dataset the task needs, and supply storage credentials scoped to that bucket/prefix.
272
304
 
@@ -288,6 +320,7 @@ If you change `INFINO_MCP_EMBED_MODEL`, the table's vector index must match the
288
320
  | `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). |
289
321
  | `add_documents` not available | `INFINO_MCP_ENABLE_WRITES` isn't set, or the client wasn't restarted after setting it. |
290
322
  | Slow first query | One-time embedding-model download (~90 MB). Subsequent runs use the cache. |
323
+ | 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. |
291
324
  | 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. |
292
325
  | `… 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. |
293
326
 
package/dist/index.js CHANGED
@@ -18,10 +18,13 @@ import { embed, embedderInfo } from "./embedding.js";
18
18
  // --- connection (env-configured, opened once at startup) -------------------
19
19
  //
20
20
  // The agent never manages connections: the server is pointed at the data via
21
- // INFINO_MCP_URI (a local path, or the user's own s3://|az:// bucket).
22
- // Credentials come from the standard AWS_*/AZURE_* environment variables. AWS
23
- // S3 uses the default endpoint; for any S3-compatible store (Cloudflare R2,
24
- // MinIO, Backblaze B2, …) set AWS_ENDPOINT_URL alongside the AWS_* keys.
21
+ // INFINO_MCP_URI, which selects the backend by its scheme:
22
+ // - a local path or an s3://|az:// bucket → an embedded catalog opened
23
+ // in-process, with credentials from the standard AWS_*/AZURE_* variables
24
+ // (AWS S3 uses the default endpoint; for an S3-compatible store — Cloudflare
25
+ // R2, MinIO, Backblaze B2 — set AWS_ENDPOINT_URL alongside the AWS_* keys);
26
+ // - an https://<host>/<database> URI → the hosted Infino Cloud service,
27
+ // authenticated with an API key (INFINO_API_KEY).
25
28
  // When INFINO_MCP_URI is unset, default to a durable per-user directory so a
26
29
  // fresh install persists across restarts with no configuration. Fall back to
27
30
  // an ephemeral in-process catalog if that directory can't be created (a
@@ -34,22 +37,30 @@ function defaultUri() {
34
37
  mkdirSync(dir, { recursive: true });
35
38
  console.error(`INFINO_MCP_URI not set — using ${dir} (persistent; read-only until ` +
36
39
  "INFINO_MCP_ENABLE_WRITES is set). Set INFINO_MCP_URI to point at your " +
37
- "own path or an s3://|az:// bucket.");
40
+ "own path, an s3://|az:// bucket, or a hosted https://<host>/<database> " +
41
+ "endpoint.");
38
42
  return dir;
39
43
  }
40
44
  catch (err) {
41
45
  console.error(`INFINO_MCP_URI not set and ${dir} is not writable ` +
42
- `(${err.message}) — serving an ephemeral in-process ` +
46
+ `(${errText(err)}) — serving an ephemeral in-process ` +
43
47
  "catalog (memory://).");
44
48
  return "memory://";
45
49
  }
46
50
  }
47
51
  const uri = process.env.INFINO_MCP_URI ?? defaultUri();
48
- // infino reads no credentials from the environment, so gather the standard
49
- // provider variables here and hand them to connect as storageOptions, keyed
50
- // by object_store's aws_*/azure_* config strings. Leaving them all unset
51
- // falls back to ambient cloud identity (an IAM instance role or Azure managed
52
- // identity).
52
+ // A hosted (Infino Cloud) target is an https:// URI that carries the database
53
+ // in its path (https://<host>/<database>); any other scheme is an embedded
54
+ // catalog on a local path or an object-storage bucket. The two authenticate
55
+ // differently — a hosted connection with an API key, an embedded one with the
56
+ // object store's own AWS_*/AZURE_* variables — so the scheme selects which
57
+ // credential we hand to connect below.
58
+ const isHosted = /^https?:\/\//i.test(uri);
59
+ // For an embedded catalog, infino reads no credentials from the environment, so
60
+ // gather the standard provider variables here and hand them to connect as
61
+ // storageOptions, keyed by object_store's aws_*/azure_* config strings. Leaving
62
+ // them all unset falls back to ambient cloud identity (an IAM instance role or
63
+ // Azure managed identity). These are ignored for a hosted connection.
53
64
  const storageOptions = {};
54
65
  const addStorageOption = (key, value) => {
55
66
  if (value)
@@ -74,12 +85,33 @@ if (s3Endpoint) {
74
85
  // Azure Blob.
75
86
  addStorageOption("azure_storage_account_name", process.env.AZURE_STORAGE_ACCOUNT);
76
87
  addStorageOption("azure_storage_account_key", process.env.AZURE_STORAGE_KEY);
88
+ // API key for a hosted (https://) connection. The binding also reads
89
+ // INFINO_API_KEY on its own, but we pass it explicitly so the credential path
90
+ // is visible here and we can warn on an obvious misconfiguration.
91
+ const apiKey = process.env.INFINO_API_KEY;
77
92
  // Opt into a connect-time probe so bad credentials or an unreachable bucket
78
93
  // fail at startup instead of on the first search.
79
94
  const validate = ["1", "true", "yes"].includes((process.env.INFINO_MCP_VALIDATE ?? "").toLowerCase());
80
95
  const connectOptions = {};
81
- if (Object.keys(storageOptions).length > 0)
82
- connectOptions.storageOptions = storageOptions;
96
+ if (isHosted) {
97
+ // Hosted (Infino Cloud): authenticate with the API key; the platform owns the
98
+ // storage, so the object-store credentials don't apply.
99
+ if (apiKey) {
100
+ connectOptions.apiKey = apiKey;
101
+ }
102
+ else {
103
+ console.error("INFINO_MCP_URI is a hosted https:// endpoint but INFINO_API_KEY is not " +
104
+ "set — requests will likely be rejected with an authentication error.");
105
+ }
106
+ }
107
+ else {
108
+ if (Object.keys(storageOptions).length > 0)
109
+ connectOptions.storageOptions = storageOptions;
110
+ if (apiKey) {
111
+ console.error("INFINO_API_KEY is set but INFINO_MCP_URI is not a hosted https:// " +
112
+ "endpoint — the key is ignored for local and object-storage connections.");
113
+ }
114
+ }
83
115
  if (validate)
84
116
  connectOptions.validate = true;
85
117
  let db;
@@ -87,7 +119,7 @@ try {
87
119
  db = connect(uri, connectOptions);
88
120
  }
89
121
  catch (err) {
90
- console.error(`Failed to connect to ${uri}: ${err.message}`);
122
+ console.error(`Failed to connect to ${uri}: ${errText(err)}`);
91
123
  process.exit(1);
92
124
  }
93
125
  // Writes (infino_add_documents) are off unless explicitly enabled, so the
@@ -136,6 +168,35 @@ const fail = (message) => ({
136
168
  content: [{ type: "text", text: message }],
137
169
  isError: true,
138
170
  });
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
+ }
139
200
  // When the caller doesn't name a column, search the first UTF-8 text column in
140
201
  // the table's schema. (A table can have several; an explicit `column` overrides.)
141
202
  function inferTextColumn(table) {
@@ -203,7 +264,7 @@ server.registerTool("infino_list_tables", {
203
264
  return ok({ tables: db.listTables() });
204
265
  }
205
266
  catch (err) {
206
- return fail(`list_tables failed: ${err.message}`);
267
+ return fail(`list_tables failed: ${errText(err)}`);
207
268
  }
208
269
  });
209
270
  server.registerTool("infino_describe_table", {
@@ -222,7 +283,7 @@ server.registerTool("infino_describe_table", {
222
283
  return ok({ table, columns });
223
284
  }
224
285
  catch (err) {
225
- return fail(`describe_table failed: ${err.message}`);
286
+ return fail(`describe_table failed: ${errText(err)}`);
226
287
  }
227
288
  });
228
289
  // Build the returned-column projection for a search hit. A caller-supplied
@@ -277,7 +338,7 @@ server.registerTool("infino_semantic_search", {
277
338
  return ok({ table, query, results, took_ms: tookMs });
278
339
  }
279
340
  catch (err) {
280
- return fail(`semantic_search failed: ${err.message}`);
341
+ return fail(`semantic_search failed: ${errText(err)}`);
281
342
  }
282
343
  });
283
344
  server.registerTool("infino_keyword_search", {
@@ -311,7 +372,7 @@ server.registerTool("infino_keyword_search", {
311
372
  return ok({ table, column: col, query, results, took_ms: tookMs });
312
373
  }
313
374
  catch (err) {
314
- return fail(`keyword_search failed: ${err.message}`);
375
+ return fail(`keyword_search failed: ${errText(err)}`);
315
376
  }
316
377
  });
317
378
  server.registerTool("infino_hybrid_search", {
@@ -347,7 +408,7 @@ server.registerTool("infino_hybrid_search", {
347
408
  return ok({ table, query, results, took_ms: tookMs });
348
409
  }
349
410
  catch (err) {
350
- return fail(`hybrid_search failed: ${err.message}`);
411
+ return fail(`hybrid_search failed: ${errText(err)}`);
351
412
  }
352
413
  });
353
414
  server.registerTool("infino_token_match", {
@@ -381,7 +442,7 @@ server.registerTool("infino_token_match", {
381
442
  return ok({ table, column: col, query, matched: rows.length, results: rows.slice(0, limit), took_ms: tookMs });
382
443
  }
383
444
  catch (err) {
384
- return fail(`token_match failed: ${err.message}`);
445
+ return fail(`token_match failed: ${errText(err)}`);
385
446
  }
386
447
  });
387
448
  server.registerTool("infino_exact_match", {
@@ -411,7 +472,7 @@ server.registerTool("infino_exact_match", {
411
472
  return ok({ table, column: col, value, matched: rows.length, results: rows.slice(0, limit), took_ms: tookMs });
412
473
  }
413
474
  catch (err) {
414
- return fail(`exact_match failed: ${err.message}`);
475
+ return fail(`exact_match failed: ${errText(err)}`);
415
476
  }
416
477
  });
417
478
  server.registerTool("infino_count", {
@@ -442,7 +503,7 @@ server.registerTool("infino_count", {
442
503
  return ok({ table, column: col, query, count, took_ms: tookMs });
443
504
  }
444
505
  catch (err) {
445
- return fail(`count failed: ${err.message}`);
506
+ return fail(`count failed: ${errText(err)}`);
446
507
  }
447
508
  });
448
509
  server.registerTool("infino_sql", {
@@ -478,7 +539,7 @@ server.registerTool("infino_sql", {
478
539
  return ok({ rows, took_ms: tookMs });
479
540
  }
480
541
  catch (err) {
481
- return fail(`sql failed: ${err.message}`);
542
+ return fail(`sql failed: ${errText(err)}`);
482
543
  }
483
544
  });
484
545
  // Write tool — registered only when writes are enabled, so a read-only install
@@ -504,7 +565,7 @@ if (writesEnabled) {
504
565
  return ok({ table, appended: rows.length });
505
566
  }
506
567
  catch (err) {
507
- return fail(`add_documents failed: ${err.message}`);
568
+ return fail(`add_documents failed: ${errText(err)}`);
508
569
  }
509
570
  });
510
571
  server.registerTool("infino_update_documents", {
@@ -531,7 +592,7 @@ if (writesEnabled) {
531
592
  return ok({ table, predicate, ...stats });
532
593
  }
533
594
  catch (err) {
534
- return fail(`update_documents failed: ${err.message}`);
595
+ return fail(`update_documents failed: ${errText(err)}`);
535
596
  }
536
597
  });
537
598
  server.registerTool("infino_delete_documents", {
@@ -550,7 +611,7 @@ if (writesEnabled) {
550
611
  return ok({ table, predicate, ...stats });
551
612
  }
552
613
  catch (err) {
553
- return fail(`delete_documents failed: ${err.message}`);
614
+ return fail(`delete_documents failed: ${errText(err)}`);
554
615
  }
555
616
  });
556
617
  }
@@ -559,4 +620,5 @@ if (writesEnabled) {
559
620
  // stderr so they never corrupt the JSON-RPC stream on stdout.
560
621
  const transport = new StdioServerTransport();
561
622
  await server.connect(transport);
562
- console.error(`infino MCP server ready on stdio (uri: ${uri}, writes: ${writesEnabled ? "on" : "off"}, embedder: ${embedderInfo()})`);
623
+ console.error(`infino MCP server ready on stdio (uri: ${uri}, mode: ${isHosted ? "hosted" : "embedded"}, ` +
624
+ `writes: ${writesEnabled ? "on" : "off"}, embedder: ${embedderInfo()})`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infino-ai/mcp-server",
3
- "version": "0.6.0",
3
+ "version": "0.8.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",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@huggingface/transformers": "^4.2.0",
52
- "@infino-ai/infino": "^0.1.2",
52
+ "@infino-ai/infino": "^0.5.0",
53
53
  "@modelcontextprotocol/sdk": "^1.29.0",
54
54
  "zod": "^3.23.0"
55
55
  },