memoryai-mcp 2.4.0 → 2.4.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/dist/index.js +17 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { z } from "zod";
|
|
|
11
11
|
const API_URL = process.env.MEMORYAI_ENDPOINT || process.env.HM_ENDPOINT || "http://localhost:8420";
|
|
12
12
|
const API_KEY = process.env.MEMORYAI_API_KEY || process.env.HM_API_KEY || "";
|
|
13
13
|
const REQUEST_TIMEOUT_MS = 30_000; // P2 #6: 30s default timeout for API requests
|
|
14
|
+
const MCP_VERSION = "2.4.1";
|
|
14
15
|
// Context Guard — per-IDE settings via env vars.
|
|
15
16
|
// HM_COMPACT_AT and HM_CRITICAL_AT are now ABSOLUTE token counts (e.g. "100000",
|
|
16
17
|
// "150000"). The legacy meaning ("30" = 30%) is detected automatically: any
|
|
@@ -55,6 +56,7 @@ async function api(method, path, body) {
|
|
|
55
56
|
headers: {
|
|
56
57
|
Authorization: `Bearer ${API_KEY}`,
|
|
57
58
|
"Content-Type": "application/json",
|
|
59
|
+
"User-Agent": `memoryai-mcp/${MCP_VERSION}`,
|
|
58
60
|
},
|
|
59
61
|
body: body ? JSON.stringify(body) : undefined,
|
|
60
62
|
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
@@ -150,7 +152,7 @@ function err(e) {
|
|
|
150
152
|
return { content, isError: true };
|
|
151
153
|
}
|
|
152
154
|
// --- MCP Server ---
|
|
153
|
-
const server = new McpServer({ name: "memoryai", version: "2.4.
|
|
155
|
+
const server = new McpServer({ name: "memoryai", version: "2.4.1" }, {
|
|
154
156
|
capabilities: { tools: {} },
|
|
155
157
|
instructions: "MemoryAI persistent memory. Call memory_bootstrap on session start. After decisions/preferences, call memory_store. Context compaction is automatic via piggybacking — follow any [Context Guard] directives in tool responses.",
|
|
156
158
|
});
|
|
@@ -270,6 +272,7 @@ server.tool("memory_recall", "[CORE] Search persistent memory for relevant conte
|
|
|
270
272
|
priority_min: z.enum(["critical", "important", "standard", "ephemeral"]).optional().describe("Minimum zone priority filter (default: all zones)"),
|
|
271
273
|
project_id: z.string().optional().describe("Scope recall to a project/workspace. DNA memories are always visible cross-project."),
|
|
272
274
|
thread_id: z.string().optional().describe("Scope recall to a conversation thread. Memories without thread_id are always visible."),
|
|
275
|
+
since: z.string().optional().describe("ISO datetime filter — only return memories created after this time (e.g. '2026-06-05T10:00:00Z' or '5m' for 5 minutes ago, '1h' for 1 hour ago, '1d' for 1 day ago)"),
|
|
273
276
|
}, async (args) => {
|
|
274
277
|
try {
|
|
275
278
|
const body = {
|
|
@@ -287,6 +290,19 @@ server.tool("memory_recall", "[CORE] Search persistent memory for relevant conte
|
|
|
287
290
|
body.project_id = args.project_id;
|
|
288
291
|
if (args.thread_id)
|
|
289
292
|
body.thread_id = args.thread_id;
|
|
293
|
+
if (args.since) {
|
|
294
|
+
// Support relative time shorthand: "5m", "1h", "1d"
|
|
295
|
+
const match = args.since.match(/^(\d+)(m|h|d)$/);
|
|
296
|
+
if (match) {
|
|
297
|
+
const val = parseInt(match[1]);
|
|
298
|
+
const unit = match[2];
|
|
299
|
+
const ms = unit === "m" ? val * 60000 : unit === "h" ? val * 3600000 : val * 86400000;
|
|
300
|
+
body.since = new Date(Date.now() - ms).toISOString();
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
body.since = args.since;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
290
306
|
const r = (await api("POST", "/v1/recall", body));
|
|
291
307
|
if (!r.results?.length)
|
|
292
308
|
return ok("No relevant memories found.");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memoryai-mcp",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "MCP server for MemoryAI v2.3 — One brain. Every AI you use. Forever. Persistent memory and context guard tools for IDEs and bots.",
|
|
5
5
|
"homepage": "https://memoryai.dev",
|
|
6
6
|
"repository": {
|