@infino-ai/mcp-server 0.1.0 → 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.
Files changed (3) hide show
  1. package/README.md +29 -11
  2. package/dist/index.js +64 -26
  3. package/package.json +27 -3
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, GCS, Azure, or any S3-compatible store).
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
 
@@ -16,6 +16,7 @@ An [MCP](https://modelcontextprotocol.io) server for [Infino](https://github.com
16
16
 
17
17
  - [Requirements](#requirements)
18
18
  - [Quick start](#quick-start)
19
+ - [Claude Code plugin (one-step install)](#claude-code-plugin-one-step-install)
19
20
  - [Client setup](#client-setup)
20
21
  - [Claude Code](#claude-code)
21
22
  - [Claude Desktop](#claude-desktop)
@@ -45,7 +46,7 @@ An [MCP](https://modelcontextprotocol.io) server for [Infino](https://github.com
45
46
 
46
47
  ## Quick start
47
48
 
48
- 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. At minimum, set `INFINO_MCP_URI` to the data you want to serve.
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.
49
50
 
50
51
  ```jsonc
51
52
  {
@@ -61,6 +62,19 @@ The sections below show the exact place each client expects this block.
61
62
 
62
63
  ---
63
64
 
65
+ ## Claude Code plugin (one-step install)
66
+
67
+ For [Claude Code](https://claude.com/claude-code), this repo is also a plugin marketplace. Installing the plugin wires up the MCP server **plus** a how-to-use skill and an `/infino-search` command in one step — no JSON to edit. Inside Claude Code:
68
+
69
+ ```
70
+ /plugin marketplace add infino-ai/infino-mcp
71
+ /plugin install infino@infino-ai
72
+ ```
73
+
74
+ On enable you'll be prompted for your **Infino data URI** (`INFINO_MCP_URI`) and whether to **enable writes**. That's it — the `infino_*` tools, the `using-infino` skill, and `/infino-search <query>` are then available. (Other clients: use the [Client setup](#client-setup) configs below.)
75
+
76
+ ---
77
+
64
78
  ## Client setup
65
79
 
66
80
  ### Claude Code
@@ -164,19 +178,17 @@ All configuration is via environment variables — there are no config files and
164
178
 
165
179
  | Variable | Required | Default | Description |
166
180
  | --- | --- | --- | --- |
167
- | `INFINO_MCP_URI` | **Yes** | — | Data to serve: a local path (`/Users/me/.infino/memory`) or a bucket URI (`s3://…`, `gs://…`, `az://…`). |
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. |
168
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. |
169
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). |
170
- | `INFINO_MCP_S3_ENDPOINT` | No | — | Custom S3 endpoint for non-AWS S3-compatible stores (Cloudflare R2, MinIO, Backblaze B2, …). |
171
- | `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. |
172
185
 
173
- Cloud credentials are read from the standard provider environment variables — the server does not introduce its own:
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).
174
187
 
175
188
  | Backend | Credentials |
176
189
  | --- | --- |
177
- | AWS S3 | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` (+ `AWS_SESSION_TOKEN` if used) |
178
- | S3-compatible (R2/MinIO/B2) | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` **and** `INFINO_MCP_S3_ENDPOINT` |
179
- | 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` |
180
192
  | Azure Blob | `AZURE_STORAGE_ACCOUNT`, `AZURE_STORAGE_KEY` |
181
193
 
182
194
  ### Storage backends
@@ -195,11 +207,17 @@ Cloud credentials are read from the standard provider environment variables —
195
207
  // S3-compatible (Cloudflare R2 / MinIO / Backblaze B2) — custom endpoint
196
208
  "env": {
197
209
  "INFINO_MCP_URI": "s3://my-bucket/infino",
198
- "INFINO_MCP_S3_ENDPOINT": "https://<account>.r2.cloudflarestorage.com",
199
- "INFINO_MCP_S3_REGION": "auto",
210
+ "AWS_ENDPOINT_URL": "https://<account>.r2.cloudflarestorage.com",
200
211
  "AWS_ACCESS_KEY_ID": "…",
201
212
  "AWS_SECRET_ACCESS_KEY": "…"
202
213
  }
214
+
215
+ // Azure Blob
216
+ "env": {
217
+ "INFINO_MCP_URI": "az://my-container/infino",
218
+ "AZURE_STORAGE_ACCOUNT": "…",
219
+ "AZURE_STORAGE_KEY": "…"
220
+ }
203
221
  ```
204
222
 
205
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,35 +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://|gs://|az:// bucket).
19
- // AWS S3 uses the default endpoint + ambient AWS_* creds. For any other
20
- // S3-compatible store (Cloudflare R2, MinIO, Backblaze B2, …) set
21
- // INFINO_MCP_S3_ENDPOINT (and optionally INFINO_MCP_S3_REGION) alongside
22
- // AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY. GCS/Azure use GOOGLE_*/AZURE_* creds.
23
- const uri = process.env.INFINO_MCP_URI;
24
- if (!uri) {
25
- console.error("INFINO_MCP_URI is required — a local path (e.g. /Users/me/.infino/memory) " +
26
- "or an s3://|gs://|az:// URI for the data to serve.");
27
- process.exit(1);
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
+ }
28
46
  }
29
- // A custom S3 endpoint (non-AWS S3-compatible store) requires the region and
30
- // access/secret keys to be supplied with it; AWS S3 needs none of this.
31
- let connectOptions;
32
- const s3Endpoint = process.env.INFINO_MCP_S3_ENDPOINT;
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;
33
65
  if (s3Endpoint) {
34
- const accessKey = process.env.AWS_ACCESS_KEY_ID;
35
- const secretKey = process.env.AWS_SECRET_ACCESS_KEY;
36
- if (!accessKey || !secretKey) {
37
- console.error("INFINO_MCP_S3_ENDPOINT is set but AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY are missing.");
38
- process.exit(1);
39
- }
40
- connectOptions = {
41
- endpoint: s3Endpoint,
42
- region: process.env.INFINO_MCP_S3_REGION ?? "auto",
43
- accessKey,
44
- secretKey,
45
- };
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";
46
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;
47
85
  let db;
48
86
  try {
49
87
  db = connect(uri, connectOptions);
package/package.json CHANGED
@@ -1,9 +1,33 @@
1
1
  {
2
2
  "name": "@infino-ai/mcp-server",
3
- "version": "0.1.0",
4
- "description": "MCP server for Infino — keyword, vector, and SQL retrieval over data on object storage, for AI agents.",
3
+ "version": "0.1.2",
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",
7
+ "homepage": "https://github.com/infino-ai/infino-mcp#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/infino-ai/infino-mcp.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/infino-ai/infino-mcp/issues"
14
+ },
15
+ "keywords": [
16
+ "mcp",
17
+ "model-context-protocol",
18
+ "infino",
19
+ "retrieval",
20
+ "search",
21
+ "vector",
22
+ "hybrid-search",
23
+ "bm25",
24
+ "sql",
25
+ "rag",
26
+ "agent-memory",
27
+ "object-storage",
28
+ "embeddings",
29
+ "ai"
30
+ ],
7
31
  "type": "module",
8
32
  "bin": {
9
33
  "infino-mcp": "dist/index.js"
@@ -26,7 +50,7 @@
26
50
  "dependencies": {
27
51
  "@huggingface/transformers": "^4.2.0",
28
52
  "@modelcontextprotocol/sdk": "^1.29.0",
29
- "@infino-ai/infino": "^0.1.0",
53
+ "@infino-ai/infino": "^0.1.1",
30
54
  "zod": "^3.23.0"
31
55
  },
32
56
  "devDependencies": {