memoryai-mcp 0.3.0 → 0.5.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.
Files changed (3) hide show
  1. package/README.md +19 -10
  2. package/dist/index.js +92 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,8 +1,15 @@
1
1
  # memoryai-mcp
2
2
 
3
- MCP server for [MemoryAI](https://memoryai.dev) — persistent AI memory as a service.
3
+ MCP server for [MemoryAI](https://memoryai.dev) — a brain for your AI agent.
4
4
 
5
- Gives your IDE agent long-term memory that persists across sessions.
5
+ Gives your IDE agent long-term memory that persists across sessions. Memories are processed through 4 stages, just like the human brain:
6
+
7
+ - ⚡ **Instant Recall** — What's on the tip of your tongue. Always ready.
8
+ - 🔍 **Deep Search** — Scans memory by meaning, not just keywords.
9
+ - 🧠 **Reasoning** — Connects the dots across memories, synthesizes precise answers. *(Pro)*
10
+ - 📦 **Archive** — Compressed long-term storage. Nothing truly forgotten.
11
+
12
+ The more you recall a memory, the stronger it gets. Unused ones gently age — but can always be recovered.
6
13
 
7
14
  ## Install
8
15
 
@@ -120,18 +127,18 @@ mcp:
120
127
 
121
128
  | Tool | Description |
122
129
  |------|-------------|
123
- | `memory_bootstrap` | Load context block at session start |
130
+ | `memory_bootstrap` | Load context at session start — wake up with full memory |
124
131
  | `memory_store` | Store information in persistent memory |
125
132
  | `memory_recall` | Search memories by semantic query |
126
- | `memory_compact` | Compact text into memory chunks |
127
- | `memory_recover` | Recover session context after break |
128
- | `memory_health` | Check context window health |
129
- | `memory_explore` | Explore memory connections (neural graph) |
133
+ | `memory_compact` | Consolidate context into key memories (like brain during sleep) |
134
+ | `memory_recover` | Recover session context after a break |
135
+ | `memory_health` | Check how full your working memory is |
136
+ | `memory_explore` | Explore connections between memories |
130
137
  | `memory_clusters` | View topic clusters |
131
138
  | `learn` | Store action + result + lesson |
132
- | `entity_list` | List tracked entities |
133
- | `reasoning_store/recall` | Deep reasoning banks (Pro+) |
134
- | `snapshot_create/restore` | Backup and restore memory |
139
+ | `entity_list` | List tracked entities (files, people, packages) |
140
+ | `reasoning_store/recall` | Deep reasoning memory (Pro+) |
141
+ | `snapshot_create/restore` | Backup and restore memory state |
135
142
 
136
143
  ## Auto-Bootstrap
137
144
 
@@ -151,6 +158,8 @@ curl -X POST https://memoryai.dev/v1/admin/provision \
151
158
  -d '{"name": "my-agent", "tos_accepted": true}'
152
159
  ```
153
160
 
161
+ Or visit https://memoryai.dev to create one instantly.
162
+
154
163
  ## Links
155
164
 
156
165
  - Website: https://memoryai.dev
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ function err(e) {
34
34
  return { content: [{ type: "text", text: `Error: ${msg}` }], isError: true };
35
35
  }
36
36
  // --- MCP Server ---
37
- const server = new McpServer({ name: "memoryai", version: "0.2.0" }, { capabilities: { tools: {} } });
37
+ const server = new McpServer({ name: "memoryai", version: "0.5.0" }, { capabilities: { tools: {} } });
38
38
  // 1. memory_store
39
39
  server.tool("memory_store", "Store information in persistent memory. Use when you learn something important — project context, user preferences, architectural decisions, patterns, or bugs.", {
40
40
  content: z.string().describe("What to remember"),
@@ -700,6 +700,97 @@ server.tool("memory_clusters", "View memory topic clusters — groups of related
700
700
  return err(e);
701
701
  }
702
702
  });
703
+ // 24. session_handoff_start
704
+ server.tool("session_handoff_start", "Start a session handoff — save old session conversation to MemoryAI server for new session to read. Use when context window is filling up and you need to switch sessions without losing context.", {
705
+ conversation: z.array(z.object({
706
+ role: z.string().describe("Message role: user, assistant, system"),
707
+ content: z.string().describe("Message content"),
708
+ timestamp: z.string().optional().describe("ISO timestamp"),
709
+ })).describe("Last N conversation turns from this session"),
710
+ metadata: z.record(z.string(), z.unknown()).optional().describe("Session metadata (platform, model, session_id)"),
711
+ }, async (args) => {
712
+ try {
713
+ const r = (await api("POST", "/v1/session/handoff/start", {
714
+ conversation: args.conversation,
715
+ metadata: args.metadata,
716
+ }));
717
+ return ok(`Handoff started (id=${r.handoff_id}): ${r.turns_stored} turns stored. New session can call session_handoff_restore to get this context.`);
718
+ }
719
+ catch (e) {
720
+ return err(e);
721
+ }
722
+ });
723
+ // 25. session_handoff_restore
724
+ server.tool("session_handoff_restore", "Restore old session conversation + related MemoryAI memories for a new session. Call this at the start of a new session to pick up where the old session left off — zero context loss.", {
725
+ handoff_id: z.string().optional().describe("Specific handoff ID, or omit for latest"),
726
+ include_memories: z.boolean().optional().describe("Also include related MemoryAI memories (default: true)"),
727
+ memory_limit: z.number().optional().describe("Max related memories to include (default: 5)"),
728
+ }, async (args) => {
729
+ try {
730
+ const body = {
731
+ include_memories: args.include_memories !== false,
732
+ memory_limit: args.memory_limit || 5,
733
+ };
734
+ if (args.handoff_id)
735
+ body.handoff_id = args.handoff_id;
736
+ const r = (await api("POST", "/v1/session/handoff/restore", body));
737
+ if (r.status === "not_found")
738
+ return ok("No pending handoff found.");
739
+ const conv = (r.conversation || [])
740
+ .slice(-20)
741
+ .map((t) => `[${t.role}] ${t.content?.substring(0, 300) || ""}`)
742
+ .join("\n\n");
743
+ const mems = (r.memories || [])
744
+ .map((m) => `[${((m.score || 0) * 100).toFixed(0)}%] ${m.content?.substring(0, 200) || ""}`)
745
+ .join("\n");
746
+ return ok(`Handoff ${r.handoff_id} restored: ${r.turns_count} turns, ${(r.memories || []).length} memories\n\n` +
747
+ `=== Old Session ===\n${conv}\n\n` +
748
+ (mems ? `=== Related Memories ===\n${mems}` : ""));
749
+ }
750
+ catch (e) {
751
+ return err(e);
752
+ }
753
+ });
754
+ // 26. session_handoff_complete
755
+ server.tool("session_handoff_complete", "Complete a session handoff — archive old session conversation into long-term MemoryAI storage. Call this when the new session has enough context (e.g., after working for a while).", {
756
+ handoff_id: z.string().optional().describe("Specific handoff ID, or omit for latest"),
757
+ archive_to_memory: z.boolean().optional().describe("Store old conversation as MemoryAI chunks (default: true)"),
758
+ }, async (args) => {
759
+ try {
760
+ const body = {
761
+ archive_to_memory: args.archive_to_memory !== false,
762
+ };
763
+ if (args.handoff_id)
764
+ body.handoff_id = args.handoff_id;
765
+ const r = (await api("POST", "/v1/session/handoff/complete", body));
766
+ if (r.status === "not_found")
767
+ return ok("No pending handoff found.");
768
+ return ok(`Handoff ${r.handoff_id} completed: ${r.chunks_archived} chunks archived to long-term memory.`);
769
+ }
770
+ catch (e) {
771
+ return err(e);
772
+ }
773
+ });
774
+ // 27. session_handoff_status
775
+ server.tool("session_handoff_status", "Check current session handoff status — whether there's a pending handoff and its state.", {}, async () => {
776
+ try {
777
+ const r = (await api("GET", "/v1/session/handoff/status"));
778
+ if (!r.handoff_id)
779
+ return ok("No handoffs found.");
780
+ return ok(`Handoff Status:\n` +
781
+ `- ID: ${r.handoff_id}\n` +
782
+ `- Active: ${r.active}\n` +
783
+ `- Status: ${r.status}\n` +
784
+ `- Turns: ${r.turns_count}\n` +
785
+ `- Tokens: ${r.tokens_snapshot}\n` +
786
+ `- Created: ${r.created_at}` +
787
+ (r.completed_at ? `\n- Completed: ${r.completed_at}` : "") +
788
+ (r.archived_chunks ? `\n- Archived chunks: ${r.archived_chunks}` : ""));
789
+ }
790
+ catch (e) {
791
+ return err(e);
792
+ }
793
+ });
703
794
  async function main() {
704
795
  const transport = new StdioServerTransport();
705
796
  await server.connect(transport);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "memoryai-mcp",
3
- "version": "0.3.0",
4
- "description": "MCP server for MemoryAI — persistent AI memory as a service",
3
+ "version": "0.5.0",
4
+ "description": "MCP server for MemoryAI — a brain for your AI agent",
5
5
  "homepage": "https://memoryai.dev",
6
6
  "repository": {
7
7
  "type": "git",