prism-mcp-server 2.1.0 → 2.1.1
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 +8 -21
- package/dist/utils/embeddingApi.js +18 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,17 +44,15 @@ Add this to your `claude_desktop_config.json` or `.cursor/mcp.json`:
|
|
|
44
44
|
"mcpServers": {
|
|
45
45
|
"prism-mcp": {
|
|
46
46
|
"command": "npx",
|
|
47
|
-
"args": ["-y", "prism-mcp-server"]
|
|
48
|
-
"env": {
|
|
49
|
-
"PRISM_STORAGE": "local",
|
|
50
|
-
"BRAVE_API_KEY": "your-brave-api-key"
|
|
51
|
-
}
|
|
47
|
+
"args": ["-y", "prism-mcp-server"]
|
|
52
48
|
}
|
|
53
49
|
}
|
|
54
50
|
}
|
|
55
51
|
```
|
|
56
52
|
|
|
57
|
-
|
|
53
|
+
That's it — **zero env vars needed** for local memory, Mind Palace dashboard, Time Travel, and Telepathy.
|
|
54
|
+
|
|
55
|
+
> **Optional API keys:** Add `BRAVE_API_KEY` for web search, `GOOGLE_API_KEY` for semantic search + Morning Briefings + paper analysis. See [Environment Variables](#environment-variables) for the full list.
|
|
58
56
|
|
|
59
57
|
### Option B: Cloud Sync Mode (Supabase)
|
|
60
58
|
|
|
@@ -68,7 +66,6 @@ To share memory across multiple machines or teams, switch to Supabase:
|
|
|
68
66
|
"args": ["-y", "prism-mcp-server"],
|
|
69
67
|
"env": {
|
|
70
68
|
"PRISM_STORAGE": "supabase",
|
|
71
|
-
"BRAVE_API_KEY": "your-brave-api-key",
|
|
72
69
|
"SUPABASE_URL": "https://your-project.supabase.co",
|
|
73
70
|
"SUPABASE_KEY": "your-supabase-anon-key"
|
|
74
71
|
}
|
|
@@ -95,7 +92,6 @@ Then add to your MCP config:
|
|
|
95
92
|
"command": "node",
|
|
96
93
|
"args": ["/absolute/path/to/prism-mcp/dist/server.js"],
|
|
97
94
|
"env": {
|
|
98
|
-
"PRISM_STORAGE": "local",
|
|
99
95
|
"BRAVE_API_KEY": "your-brave-api-key",
|
|
100
96
|
"GOOGLE_API_KEY": "your-google-gemini-key"
|
|
101
97
|
}
|
|
@@ -159,10 +155,7 @@ Add to your `claude_desktop_config.json`:
|
|
|
159
155
|
"prism-mcp": {
|
|
160
156
|
"command": "npx",
|
|
161
157
|
"args": ["-y", "prism-mcp-server"],
|
|
162
|
-
"env": {
|
|
163
|
-
"PRISM_STORAGE": "local",
|
|
164
|
-
"BRAVE_API_KEY": "your-brave-api-key"
|
|
165
|
-
}
|
|
158
|
+
"env": {}
|
|
166
159
|
}
|
|
167
160
|
}
|
|
168
161
|
}
|
|
@@ -181,10 +174,7 @@ Add to `.cursor/mcp.json` in your project root (or `~/.cursor/mcp.json` for glob
|
|
|
181
174
|
"prism-mcp": {
|
|
182
175
|
"command": "npx",
|
|
183
176
|
"args": ["-y", "prism-mcp-server"],
|
|
184
|
-
"env": {
|
|
185
|
-
"PRISM_STORAGE": "local",
|
|
186
|
-
"BRAVE_API_KEY": "your-brave-api-key"
|
|
187
|
-
}
|
|
177
|
+
"env": {}
|
|
188
178
|
}
|
|
189
179
|
}
|
|
190
180
|
}
|
|
@@ -203,10 +193,7 @@ Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
|
203
193
|
"prism-mcp": {
|
|
204
194
|
"command": "npx",
|
|
205
195
|
"args": ["-y", "prism-mcp-server"],
|
|
206
|
-
"env": {
|
|
207
|
-
"PRISM_STORAGE": "local",
|
|
208
|
-
"BRAVE_API_KEY": "your-brave-api-key"
|
|
209
|
-
}
|
|
196
|
+
"env": {}
|
|
210
197
|
}
|
|
211
198
|
}
|
|
212
199
|
}
|
|
@@ -348,7 +335,7 @@ Instead of writing custom JavaScript, pass a `template` name for instant extract
|
|
|
348
335
|
|
|
349
336
|
| Variable | Required | Description |
|
|
350
337
|
|----------|----------|-------------|
|
|
351
|
-
| `BRAVE_API_KEY` |
|
|
338
|
+
| `BRAVE_API_KEY` | No | Brave Search Pro API key (enables web/local search tools) |
|
|
352
339
|
| `PRISM_STORAGE` | No | `"local"` (default) or `"supabase"` |
|
|
353
340
|
| `GOOGLE_API_KEY` | No | Google AI / Gemini — enables paper analysis, Morning Briefings, compaction |
|
|
354
341
|
| `BRAVE_ANSWERS_API_KEY` | No | Separate Brave Answers key for AI-grounded answers |
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Embedding Generation Utility (v0.
|
|
2
|
+
* Embedding Generation Utility (v0.5.0 — Model Migration)
|
|
3
3
|
*
|
|
4
4
|
* ═══════════════════════════════════════════════════════════════════
|
|
5
|
-
* REVIEWER NOTE: This module wraps Google's
|
|
5
|
+
* REVIEWER NOTE: This module wraps Google's gemini-embedding-001 model
|
|
6
6
|
* to generate 768-dimensional vector embeddings for text.
|
|
7
7
|
*
|
|
8
|
+
* MIGRATION (2026-03): text-embedding-004 was deprecated Jan 14, 2026.
|
|
9
|
+
* Replaced with gemini-embedding-001 (GA on v1 API). The new model
|
|
10
|
+
* supports Matryoshka Representation Learning (MRL) for flexible
|
|
11
|
+
* output dimensions (768, 1536, 3072). We use 768 for compatibility
|
|
12
|
+
* with existing pgvector columns.
|
|
13
|
+
*
|
|
8
14
|
* USAGE — Called in two places:
|
|
9
15
|
* 1. sessionSaveLedgerHandler — embeds summary+decisions at save time
|
|
10
16
|
* (fire-and-forget, non-blocking)
|
|
@@ -16,25 +22,24 @@
|
|
|
16
22
|
* Using a separate embedding service (OpenAI, Cohere) would add
|
|
17
23
|
* another API key dependency and increase configuration complexity.
|
|
18
24
|
*
|
|
19
|
-
* COST: Gemini's
|
|
25
|
+
* COST: Gemini's gemini-embedding-001 is free tier for <1500 req/min.
|
|
20
26
|
* At typical usage (~10-50 ledger saves/day), we'll never approach
|
|
21
27
|
* this limit.
|
|
22
28
|
*
|
|
23
|
-
* TRUNCATION GUARD:
|
|
24
|
-
*
|
|
25
|
-
* the API
|
|
26
|
-
*
|
|
27
|
-
* This is applied before sending to the API, not after.
|
|
29
|
+
* TRUNCATION GUARD: gemini-embedding-001 supports up to 2048 tokens
|
|
30
|
+
* per input. We implement a hard character limit (default 8000 chars)
|
|
31
|
+
* to guarantee the API call never crashes. This is applied before
|
|
32
|
+
* sending to the API, not after.
|
|
28
33
|
* ═══════════════════════════════════════════════════════════════════
|
|
29
34
|
*/
|
|
30
35
|
import { GoogleGenerativeAI } from "@google/generative-ai";
|
|
31
36
|
import { GOOGLE_API_KEY } from "../config.js";
|
|
32
37
|
// ─── Constants ────────────────────────────────────────────────
|
|
33
38
|
// REVIEWER NOTE: Maximum characters to send to the embedding API.
|
|
34
|
-
//
|
|
39
|
+
// gemini-embedding-001 supports up to 2048 tokens. At ~4 chars/token,
|
|
35
40
|
// 8000 chars is a safe ceiling. Truncation is silent and non-fatal —
|
|
36
|
-
// the embedding still captures the semantic meaning of the
|
|
37
|
-
//
|
|
41
|
+
// the embedding still captures the semantic meaning of the leading
|
|
42
|
+
// content, which is more than enough for similarity search.
|
|
38
43
|
const MAX_EMBEDDING_CHARS = 8000;
|
|
39
44
|
// ─── Embedding Client ─────────────────────────────────────────
|
|
40
45
|
/**
|
|
@@ -76,7 +81,8 @@ export async function generateEmbedding(text) {
|
|
|
76
81
|
throw new Error("Cannot generate embedding for empty text");
|
|
77
82
|
}
|
|
78
83
|
const genAI = new GoogleGenerativeAI(GOOGLE_API_KEY);
|
|
79
|
-
const model = genAI.getGenerativeModel({ model: "
|
|
84
|
+
const model = genAI.getGenerativeModel({ model: "gemini-embedding-001" }, { apiVersion: "v1beta" } // gemini-embedding-001 requires v1beta
|
|
85
|
+
);
|
|
80
86
|
console.error(`[embedding] Generating 768-dim embedding for ${inputText.length} chars`);
|
|
81
87
|
const result = await model.embedContent(inputText);
|
|
82
88
|
return result.embedding.values;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prism-mcp-server",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"mcpName": "io.github.dcostenco/prism-mcp",
|
|
5
5
|
"description": "The Mind Palace for AI Agents — local-first MCP server with persistent memory (SQLite/Supabase), visual dashboard, time travel, multi-agent sync, Morning Briefings, reality drift detection, code mode templates, semantic vector search, and Brave Search + Gemini analysis. Zero-config local mode.",
|
|
6
6
|
"module": "index.ts",
|