@infino-ai/mcp-server 0.1.1 → 0.1.2
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 +15 -11
- package/dist/index.js +64 -30
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ An [MCP](https://modelcontextprotocol.io) server for [Infino](https://github.com
|
|
|
8
8
|
|
|
9
9
|
- **No API 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,
|
|
11
|
+
- **Bring your own storage.** Point it at a local path or your own bucket (S3, Azure, or any S3-compatible store).
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -46,7 +46,7 @@ An [MCP](https://modelcontextprotocol.io) server for [Infino](https://github.com
|
|
|
46
46
|
|
|
47
47
|
## Quick start
|
|
48
48
|
|
|
49
|
-
The server is launched by your MCP client over stdio — you don't run it directly in normal use. Every client config follows the same shape: command `npx -y @infino-ai/mcp-server`, with configuration supplied via environment variables. Set `INFINO_MCP_URI` to the data you want to serve — a local path or a bucket URI. If it's omitted, the server
|
|
49
|
+
The server is launched by your MCP client over stdio — you don't run it directly in normal use. Every client config follows the same shape: command `npx -y @infino-ai/mcp-server`, with configuration supplied via environment variables. Set `INFINO_MCP_URI` to the data you want to serve — a local path or a bucket URI. If it's omitted, the server uses a durable per-user directory (`~/.infino/mcp`) so data persists across restarts; point `INFINO_MCP_URI` at your own path or bucket to serve existing data.
|
|
50
50
|
|
|
51
51
|
```jsonc
|
|
52
52
|
{
|
|
@@ -178,19 +178,17 @@ All configuration is via environment variables — there are no config files and
|
|
|
178
178
|
|
|
179
179
|
| Variable | Required | Default | Description |
|
|
180
180
|
| --- | --- | --- | --- |
|
|
181
|
-
| `INFINO_MCP_URI` | No | `
|
|
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. |
|
|
182
182
|
| `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
183
|
| `INFINO_MCP_EMBED_MODEL` | No | `Xenova/all-MiniLM-L6-v2` | Hugging Face feature-extraction model used for embedding. Must match the table's vector index dimension (default model is 384-dim). |
|
|
184
|
-
| `
|
|
185
|
-
| `INFINO_MCP_S3_REGION` | No | `auto` | Region to send with a custom S3 endpoint. |
|
|
184
|
+
| `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. |
|
|
186
185
|
|
|
187
|
-
Cloud credentials are read from the standard provider environment variables — the server
|
|
186
|
+
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).
|
|
188
187
|
|
|
189
188
|
| Backend | Credentials |
|
|
190
189
|
| --- | --- |
|
|
191
|
-
| AWS S3 | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (+ `AWS_SESSION_TOKEN` if used) |
|
|
192
|
-
| S3-compatible (R2/MinIO/B2) | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` **and** `
|
|
193
|
-
| Google Cloud Storage | `GOOGLE_APPLICATION_CREDENTIALS` (or ambient ADC) |
|
|
190
|
+
| AWS S3 | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (+ `AWS_SESSION_TOKEN`, `AWS_REGION` if used) |
|
|
191
|
+
| S3-compatible (R2/MinIO/B2) | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` **and** `AWS_ENDPOINT_URL` |
|
|
194
192
|
| Azure Blob | `AZURE_STORAGE_ACCOUNT`, `AZURE_STORAGE_KEY` |
|
|
195
193
|
|
|
196
194
|
### Storage backends
|
|
@@ -209,11 +207,17 @@ Cloud credentials are read from the standard provider environment variables —
|
|
|
209
207
|
// S3-compatible (Cloudflare R2 / MinIO / Backblaze B2) — custom endpoint
|
|
210
208
|
"env": {
|
|
211
209
|
"INFINO_MCP_URI": "s3://my-bucket/infino",
|
|
212
|
-
"
|
|
213
|
-
"INFINO_MCP_S3_REGION": "auto",
|
|
210
|
+
"AWS_ENDPOINT_URL": "https://<account>.r2.cloudflarestorage.com",
|
|
214
211
|
"AWS_ACCESS_KEY_ID": "…",
|
|
215
212
|
"AWS_SECRET_ACCESS_KEY": "…"
|
|
216
213
|
}
|
|
214
|
+
|
|
215
|
+
// Azure Blob
|
|
216
|
+
"env": {
|
|
217
|
+
"INFINO_MCP_URI": "az://my-container/infino",
|
|
218
|
+
"AZURE_STORAGE_ACCOUNT": "…",
|
|
219
|
+
"AZURE_STORAGE_KEY": "…"
|
|
220
|
+
}
|
|
217
221
|
```
|
|
218
222
|
|
|
219
223
|
---
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
// keyword (BM25), semantic (local-embedding vector), and hybrid (fused)
|
|
8
8
|
// search, unranked token/exact match, and read-only SQL; document writes
|
|
9
9
|
// (add/update/delete) and full SQL are opt-in behind INFINO_MCP_ENABLE_WRITES.
|
|
10
|
+
import { mkdirSync } from "node:fs";
|
|
11
|
+
import { homedir } from "node:os";
|
|
12
|
+
import { join } from "node:path";
|
|
10
13
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
14
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
12
15
|
import { z } from "zod";
|
|
@@ -15,39 +18,70 @@ import { embed, embedderInfo } from "./embedding.js";
|
|
|
15
18
|
// --- connection (env-configured, opened once at startup) -------------------
|
|
16
19
|
//
|
|
17
20
|
// The agent never manages connections: the server is pointed at the data via
|
|
18
|
-
// INFINO_MCP_URI (a local path, or the user's own s3://|
|
|
19
|
-
//
|
|
20
|
-
// S3-compatible store (Cloudflare R2,
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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.
|
|
25
|
+
// When INFINO_MCP_URI is unset, default to a durable per-user directory so a
|
|
26
|
+
// fresh install persists across restarts with no configuration. Fall back to
|
|
27
|
+
// an ephemeral in-process catalog if that directory can't be created (a
|
|
28
|
+
// sandboxed or read-only host, or a registry health-check spawn): the server
|
|
29
|
+
// must always start — a hard exit would leave it permanently "unhealthy".
|
|
30
|
+
// Real deployments set INFINO_MCP_URI to their own path or an s3://|az:// URI.
|
|
31
|
+
function defaultUri() {
|
|
32
|
+
const dir = join(homedir(), ".infino", "mcp");
|
|
33
|
+
try {
|
|
34
|
+
mkdirSync(dir, { recursive: true });
|
|
35
|
+
console.error(`INFINO_MCP_URI not set — using ${dir} (persistent; read-only until ` +
|
|
36
|
+
"INFINO_MCP_ENABLE_WRITES is set). Set INFINO_MCP_URI to point at your " +
|
|
37
|
+
"own path or an s3://|az:// bucket.");
|
|
38
|
+
return dir;
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
console.error(`INFINO_MCP_URI not set and ${dir} is not writable ` +
|
|
42
|
+
`(${err.message}) — serving an ephemeral in-process ` +
|
|
43
|
+
"catalog (memory://).");
|
|
44
|
+
return "memory://";
|
|
45
|
+
}
|
|
32
46
|
}
|
|
33
|
-
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
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).
|
|
53
|
+
const storageOptions = {};
|
|
54
|
+
const addStorageOption = (key, value) => {
|
|
55
|
+
if (value)
|
|
56
|
+
storageOptions[key] = value;
|
|
57
|
+
};
|
|
58
|
+
// S3, and S3-compatible stores (Cloudflare R2 / MinIO / Backblaze B2) via a
|
|
59
|
+
// custom endpoint.
|
|
60
|
+
addStorageOption("aws_access_key_id", process.env.AWS_ACCESS_KEY_ID);
|
|
61
|
+
addStorageOption("aws_secret_access_key", process.env.AWS_SECRET_ACCESS_KEY);
|
|
62
|
+
addStorageOption("aws_session_token", process.env.AWS_SESSION_TOKEN);
|
|
63
|
+
addStorageOption("aws_region", process.env.AWS_REGION);
|
|
64
|
+
const s3Endpoint = process.env.AWS_ENDPOINT_URL;
|
|
37
65
|
if (s3Endpoint) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (!
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
endpoint: s3Endpoint,
|
|
46
|
-
region: process.env.INFINO_MCP_S3_REGION ?? "auto",
|
|
47
|
-
accessKey,
|
|
48
|
-
secretKey,
|
|
49
|
-
};
|
|
66
|
+
storageOptions.aws_endpoint = s3Endpoint;
|
|
67
|
+
// A custom endpoint needs a region; default to "auto" (what R2 expects).
|
|
68
|
+
if (!storageOptions.aws_region)
|
|
69
|
+
storageOptions.aws_region = "auto";
|
|
70
|
+
// object_store rejects a plain-HTTP endpoint unless HTTP is allowed.
|
|
71
|
+
if (s3Endpoint.startsWith("http://"))
|
|
72
|
+
storageOptions.aws_allow_http = "true";
|
|
50
73
|
}
|
|
74
|
+
// Azure Blob.
|
|
75
|
+
addStorageOption("azure_storage_account_name", process.env.AZURE_STORAGE_ACCOUNT);
|
|
76
|
+
addStorageOption("azure_storage_account_key", process.env.AZURE_STORAGE_KEY);
|
|
77
|
+
// Opt into a connect-time probe so bad credentials or an unreachable bucket
|
|
78
|
+
// fail at startup instead of on the first search.
|
|
79
|
+
const validate = ["1", "true", "yes"].includes((process.env.INFINO_MCP_VALIDATE ?? "").toLowerCase());
|
|
80
|
+
const connectOptions = {};
|
|
81
|
+
if (Object.keys(storageOptions).length > 0)
|
|
82
|
+
connectOptions.storageOptions = storageOptions;
|
|
83
|
+
if (validate)
|
|
84
|
+
connectOptions.validate = true;
|
|
51
85
|
let db;
|
|
52
86
|
try {
|
|
53
87
|
db = connect(uri, connectOptions);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infino-ai/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@huggingface/transformers": "^4.2.0",
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
53
|
-
"@infino-ai/infino": "^0.1.
|
|
53
|
+
"@infino-ai/infino": "^0.1.1",
|
|
54
54
|
"zod": "^3.23.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|