@infino-ai/mcp-server 0.6.0 → 0.7.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 +41 -8
- package/dist/index.js +46 -13
- 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
|
-
- **
|
|
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
|
-
- **
|
|
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,
|
|
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`)
|
|
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
|
|
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
|
|
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
|
|
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
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
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,7 +37,8 @@ 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
|
|
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) {
|
|
@@ -45,11 +49,18 @@ function defaultUri() {
|
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
const uri = process.env.INFINO_MCP_URI ?? defaultUri();
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
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 (
|
|
82
|
-
|
|
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;
|
|
@@ -559,4 +591,5 @@ if (writesEnabled) {
|
|
|
559
591
|
// stderr so they never corrupt the JSON-RPC stream on stdout.
|
|
560
592
|
const transport = new StdioServerTransport();
|
|
561
593
|
await server.connect(transport);
|
|
562
|
-
console.error(`infino MCP server ready on stdio (uri: ${uri},
|
|
594
|
+
console.error(`infino MCP server ready on stdio (uri: ${uri}, mode: ${isHosted ? "hosted" : "embedded"}, ` +
|
|
595
|
+
`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.
|
|
3
|
+
"version": "0.7.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.
|
|
52
|
+
"@infino-ai/infino": "^0.3.0",
|
|
53
53
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
54
54
|
"zod": "^3.23.0"
|
|
55
55
|
},
|