@t0ken.ai/memoryx-mcp-server 2.0.2 → 2.1.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.
package/README.md CHANGED
@@ -1,44 +1,31 @@
1
- # MemoryX MCP Server
1
+ # 🧠 MemoryX MCP Server
2
2
 
3
- MemoryX MCP Server for Cursor, VS Code, Claude Desktop and other MCP clients.
3
+ [![NPM version](https://badge.fury.io/js/@t0ken%2Fai%2Fmemoryx-mcp-server.svg)](https://www.npmjs.com/package/@t0ken.ai/memoryx-mcp-server)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
5
 
5
- Powered by **@t0ken.ai/memoryx-sdk**
6
+ **Give your AI assistants long-term memory via Model Context Protocol.**
6
7
 
7
- ## Features
8
+ MemoryX MCP Server enables Cursor, VS Code, Claude Desktop, and other MCP clients to store and retrieve memories across conversations.
8
9
 
9
- - **save_memory**: Save important information to memory system
10
- - **search_memory**: Search historical memories
11
- - **get_account_info**: Get account information
10
+ ## ✨ Features
12
11
 
13
- ## Characteristics
12
+ - 🚀 **Zero Config** - Auto-registers on first use, no API key needed
13
+ - 🔍 **save_memory** - Store important information with automatic categorization
14
+ - 🔎 **search_memory** - Semantic search across all historical memories
15
+ - 📋 **list_memory** - List recent memories in chronological order
16
+ - đŸ—‘ī¸ **delete_memory** - Remove outdated or incorrect memories
17
+ - â„šī¸ **get_account_info** - Check connection status and agent info
18
+ - 📝 **Prompts** - Pre-built templates for common workflows
14
19
 
15
- - Based on @t0ken.ai/memoryx-sdk
16
- - MCP mode: LLM summarizes and sends single memory additions
17
- - Server extracts entities directly without LLM summarization
18
- - Trigger: 20k tokens or 1 minute idle
19
- - Automatic retry mechanism
20
- - Offline support
20
+ ## 🚀 Quick Start
21
21
 
22
- ## Installation
23
-
24
- ### Option 1: NPM Install
22
+ ### Install
25
23
 
26
24
  ```bash
27
25
  npm install -g @t0ken.ai/memoryx-mcp-server
28
26
  ```
29
27
 
30
- ### Option 2: Install from Source
31
-
32
- ```bash
33
- cd plugins/memoryx-mcp-server
34
- npm install
35
- npm run build
36
- npm link
37
- ```
38
-
39
- ## Configuration
40
-
41
- ### Cursor / VS Code
28
+ ### Configure Cursor / VS Code
42
29
 
43
30
  Add to `~/.cursor/mcp.json` or VS Code MCP config:
44
31
 
@@ -46,61 +33,178 @@ Add to `~/.cursor/mcp.json` or VS Code MCP config:
46
33
  {
47
34
  "mcpServers": {
48
35
  "memoryx": {
49
- "command": "memoryx-mcp-server",
50
- "env": {
51
- "MEMORYX_API_KEY": "your_api_key_here",
52
- "MEMORYX_URL": "https://t0ken.ai/api"
53
- }
36
+ "command": "memoryx-mcp-server"
54
37
  }
55
38
  }
56
39
  }
57
40
  ```
58
41
 
59
- ### Claude Desktop
42
+ **That's it!** The server auto-registers on first use - no additional configuration needed.
60
43
 
61
- Add to Claude Desktop config file:
44
+ ### Configure Claude Desktop
62
45
 
63
46
  **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
47
+
64
48
  **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
65
49
 
66
50
  ```json
67
51
  {
68
52
  "mcpServers": {
69
53
  "memoryx": {
70
- "command": "memoryx-mcp-server",
71
- "env": {
72
- "MEMORYX_API_KEY": "your_api_key_here"
73
- }
54
+ "command": "memoryx-mcp-server"
74
55
  }
75
56
  }
76
57
  }
77
58
  ```
78
59
 
79
- ## Usage
60
+ ## 📖 Tools
61
+
62
+ ### save_memory
63
+
64
+ Save information to long-term memory.
65
+
66
+ **When to call (automatic triggers):**
67
+ 1. User explicitly says "remember", "note this", "don't forget"
68
+ 2. User corrects your error (store the correct version)
69
+ 3. User expresses preferences (I like/hate/usually...)
70
+ 4. User mentions important experiences or future plans
71
+ 5. End of conversation - generate a 100-word summary
72
+
73
+ **Categories (use in metadata.category):**
74
+ - `semantic` - facts, knowledge, user preferences
75
+ - `episodic` - specific events, experiences
76
+ - `procedural` - skills, methods, how-to steps
77
+ - `emotional` - feelings, emotional states
78
+ - `reflective` - insights, patterns, lessons learned
79
+
80
+ **Example:**
81
+ ```json
82
+ {
83
+ "content": "User prefers dark theme in VS Code",
84
+ "metadata": {
85
+ "category": "semantic",
86
+ "tags": ["preference", "editor"]
87
+ }
88
+ }
89
+ ```
90
+
91
+ ### search_memory
92
+
93
+ Search historical memories before responding.
94
+
95
+ **Always call BEFORE:**
96
+ - Answering questions about user preferences/history
97
+ - Topics that might relate to past conversations
98
+ - Any personalized response needed
99
+
100
+ **Workflow:** `search` → `review results` → `generate informed response`
101
+
102
+ ### list_memory
103
+
104
+ List recent memories in chronological order (newest first).
105
+
106
+ **Use when:**
107
+ - Reviewing what has been stored
108
+ - Getting context at the start of a conversation
109
+ - Finding specific memories when unsure of keywords
110
+
111
+ **Parameters:**
112
+ - `limit` - Number of memories to return (default: 20)
113
+
114
+ ### delete_memory
80
115
 
81
- ### Auto Registration
116
+ Delete a specific memory by ID.
82
117
 
83
- If no API Key is provided, MCP Server will auto-register and generate one.
118
+ **Use when:**
119
+ - User explicitly asks to forget something
120
+ - You find outdated or incorrect information
84
121
 
85
- ### Manual Binding
122
+ **Parameters:**
123
+ - `memory_id` - The ID of the memory to delete (from list_memory or search_memory)
86
124
 
87
- 1. Visit https://t0ken.ai/portal
88
- 2. Login and copy API Key
89
- 3. Configure environment variable `MEMORYX_API_KEY`
125
+ ### get_account_info
90
126
 
91
- ## Local Storage
127
+ Get current connection status including:
128
+ - API Key (masked)
129
+ - Agent ID
130
+ - Queue length
92
131
 
93
- Data is stored in `~/.memoryx/mcp-server/` directory.
132
+ ## 📝 Prompts
94
133
 
95
- ## MCP Mode vs OpenClaw Conversation Mode
134
+ Pre-built templates for common memory workflows:
135
+
136
+ | Prompt | Description | Use Case |
137
+ |--------|-------------|----------|
138
+ | `start-with-memory` | Retrieve recent memories | Beginning of a new session |
139
+ | `archive-session` | Extract and save key points | End of a conversation |
140
+ | `recall-context` | Recall context from memory | Before responding to questions |
141
+
142
+ ### start-with-memory
143
+
144
+ Use at the start of a new conversation to restore context:
145
+
146
+ ```
147
+ As my personal assistant at the start of a new conversation,
148
+ please first read the memoryx://memories/recent resource to retrieve my recent memories.
149
+ Based on retrieved information, briefly summarize what we've been working on
150
+ and ask about my next plans.
151
+ ```
152
+
153
+ ### archive-session
154
+
155
+ Use at the end of a conversation to save important points:
156
+
157
+ ```
158
+ Please review this conversation about {topic}. Extract:
159
+ 1. Key decisions made
160
+ 2. TODO items and action items
161
+ 3. Important facts mentioned by user
162
+ Use save_memory tool to store these in structured format.
163
+ ```
164
+
165
+ ### recall-context
166
+
167
+ Recall relevant context before responding:
168
+
169
+ ```
170
+ Please recall relevant context from memory about: "{topic}".
171
+ Call search_memory to retrieve related historical discussions,
172
+ then use that context to inform your response.
173
+ ```
174
+
175
+ ## 🔗 Resources
176
+
177
+ MCP Resources for direct access to memory data:
178
+
179
+ | Resource | Description |
180
+ |----------|-------------|
181
+ | `memoryx://status` | Connection status and queue info |
182
+ | `memoryx://memories/recent` | Recent 20 memories in chronological order |
183
+
184
+ LLM can read these resources directly via MCP's `ReadResource` API to get context without calling tools.
185
+
186
+ ## 📁 Local Storage
187
+
188
+ Data stored in `~/.memoryx/sdk/` (managed by SDK):
189
+ - `memoryx.db` - SQLite database with agent info, queue, and cached data
190
+
191
+ ## 🔄 MCP Mode vs OpenClaw Mode
96
192
 
97
193
  | Feature | MCP Server | OpenClaw Plugin |
98
194
  |---------|------------|-----------------|
99
195
  | Data Source | LLM summarized single additions | Bidirectional conversation flow |
100
196
  | Server Processing | Direct entity extraction | LLM summarization then extraction |
101
- | Trigger Mechanism | 20k tokens / 1 min idle | 30k tokens / 5 min idle |
197
+ | Trigger | 20k tokens / 1 min idle | 30k tokens / 5 min idle |
102
198
  | Use Case | Cursor/Claude Desktop | OpenClaw Gateway |
103
199
 
104
- ## License
200
+ ## 📚 More Resources
201
+
202
+ - [MemoryX Platform](https://t0ken.ai)
203
+ - [Documentation](https://docs.t0ken.ai)
204
+ - [Node.js SDK](https://www.npmjs.com/package/@t0ken.ai/memoryx-sdk)
205
+ - [Python SDK](https://pypi.org/project/t0ken-memoryx/)
206
+ - [GitHub](https://github.com/t0ken-ai/MemoryX)
207
+
208
+ ## 📄 License
105
209
 
106
- MIT
210
+ MIT Š MemoryX Team
package/dist/index.js CHANGED
@@ -143,6 +143,38 @@ async function searchMemory(query, limit = 5) {
143
143
  return { memories: [], isLimited: false, remainingQuota: 0 };
144
144
  }
145
145
  }
146
+ async function listMemory(limit = 20) {
147
+ try {
148
+ const sdk = await getSDK();
149
+ const result = await sdk.list(limit, 0);
150
+ return {
151
+ memories: (result.data || []).map((m) => ({
152
+ id: m.id,
153
+ content: m.content,
154
+ category: m.category || "other"
155
+ })),
156
+ total: result.total || 0
157
+ };
158
+ }
159
+ catch (e) {
160
+ log(`listMemory failed: ${e}`);
161
+ return { memories: [], total: 0 };
162
+ }
163
+ }
164
+ async function deleteMemory(memoryId) {
165
+ if (!memoryId) {
166
+ return { success: false, message: "memory_id is required" };
167
+ }
168
+ try {
169
+ const sdk = await getSDK();
170
+ await sdk.delete(memoryId);
171
+ return { success: true, message: "Memory deleted successfully" };
172
+ }
173
+ catch (e) {
174
+ log(`deleteMemory failed: ${e}`);
175
+ return { success: false, message: String(e) };
176
+ }
177
+ }
146
178
  async function getAccountInfo() {
147
179
  try {
148
180
  const sdk = await getSDK();
@@ -167,12 +199,95 @@ async function getAccountInfo() {
167
199
  }
168
200
  const server = new index_js_1.Server({
169
201
  name: "memoryx-mcp-server",
170
- version: "2.0.0",
202
+ version: "2.1.0",
171
203
  }, {
172
204
  capabilities: {
173
205
  tools: {},
174
206
  resources: {},
207
+ prompts: {},
208
+ },
209
+ });
210
+ // Prompt templates
211
+ const PROMPTS = [
212
+ {
213
+ name: "start-with-memory",
214
+ description: "Start a new conversation by retrieving recent memories to restore context. Use this at the beginning of a session.",
215
+ arguments: []
175
216
  },
217
+ {
218
+ name: "archive-session",
219
+ description: "Archive the current conversation by extracting key decisions, TODOs, and facts. Use this at the end of a session.",
220
+ arguments: [
221
+ {
222
+ name: "topic",
223
+ description: "The main topic or theme of the conversation",
224
+ required: true
225
+ }
226
+ ]
227
+ },
228
+ {
229
+ name: "recall-context",
230
+ description: "Recall relevant context from memory before responding. Activates memory retrieval by searching historical memories related to the topic. Use this to ensure responses are informed by past discussions.",
231
+ arguments: [
232
+ {
233
+ name: "topic",
234
+ description: "The topic or question to recall context for",
235
+ required: true
236
+ }
237
+ ]
238
+ }
239
+ ];
240
+ server.setRequestHandler(types_js_1.ListPromptsRequestSchema, async () => {
241
+ return { prompts: PROMPTS };
242
+ });
243
+ server.setRequestHandler(types_js_1.GetPromptRequestSchema, async (request) => {
244
+ const { name, arguments: args } = request.params;
245
+ switch (name) {
246
+ case "start-with-memory":
247
+ return {
248
+ messages: [
249
+ {
250
+ role: "user",
251
+ content: {
252
+ type: "text",
253
+ text: "As my personal assistant at the start of a new conversation, please first read the memoryx://memories/recent resource to retrieve my recent memories. Based on retrieved information, briefly summarize what we've been working on and ask about my next plans. This helps maintain context across sessions."
254
+ }
255
+ }
256
+ ]
257
+ };
258
+ case "archive-session":
259
+ const topic = args?.topic || "this conversation";
260
+ return {
261
+ messages: [
262
+ {
263
+ role: "user",
264
+ content: {
265
+ type: "text",
266
+ text: `Please review this conversation about ${topic}. Extract:
267
+ 1. Key decisions made
268
+ 2. TODO items and action items
269
+ 3. Important facts mentioned by user
270
+ Use save_memory tool to store these in structured format with tags: ${topic} and today's date. Keep the summary concise (under 100 words).`
271
+ }
272
+ }
273
+ ]
274
+ };
275
+ case "recall-context":
276
+ const recallTopic = args?.topic || "";
277
+ return {
278
+ messages: [
279
+ {
280
+ role: "user",
281
+ content: {
282
+ type: "text",
283
+ text: `Please recall relevant context from memory about: "${recallTopic}". Call search_memory to retrieve related historical discussions, then use that context to inform your response. This ensures consistency with past conversations.`
284
+ }
285
+ }
286
+ ]
287
+ };
288
+ default:
289
+ throw new Error(`Unknown prompt: ${name}`);
290
+ }
176
291
  });
177
292
  server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
178
293
  return {
@@ -214,6 +329,34 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
214
329
  required: ["query"]
215
330
  }
216
331
  },
332
+ {
333
+ name: "list_memory",
334
+ description: "List recent memories in chronological order (newest first). Use this to: (1) Review what has been stored; (2) Get context at the start of a conversation; (3) Find specific memories when you're unsure of keywords. Returns memory id, content, and category.",
335
+ inputSchema: {
336
+ type: "object",
337
+ properties: {
338
+ limit: {
339
+ type: "number",
340
+ description: "Number of memories to return, default 20",
341
+ default: 20
342
+ }
343
+ }
344
+ }
345
+ },
346
+ {
347
+ name: "delete_memory",
348
+ description: "Delete a specific memory by ID. Use when: (1) User explicitly asks to forget something; (2) You find outdated or incorrect information. Requires memory_id from list_memory or search_memory results.",
349
+ inputSchema: {
350
+ type: "object",
351
+ properties: {
352
+ memory_id: {
353
+ type: "string",
354
+ description: "The ID of the memory to delete"
355
+ }
356
+ },
357
+ required: ["memory_id"]
358
+ }
359
+ },
217
360
  {
218
361
  name: "get_account_info",
219
362
  description: "Get current MemoryX account info including API Key, Agent ID, and queue status.",
@@ -254,6 +397,30 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
254
397
  ]
255
398
  };
256
399
  }
400
+ case "list_memory": {
401
+ const limit = args?.limit || 20;
402
+ const result = await listMemory(limit);
403
+ return {
404
+ content: [
405
+ {
406
+ type: "text",
407
+ text: JSON.stringify(result, null, 2)
408
+ }
409
+ ]
410
+ };
411
+ }
412
+ case "delete_memory": {
413
+ const memoryId = args?.memory_id;
414
+ const result = await deleteMemory(memoryId);
415
+ return {
416
+ content: [
417
+ {
418
+ type: "text",
419
+ text: JSON.stringify(result, null, 2)
420
+ }
421
+ ]
422
+ };
423
+ }
257
424
  case "get_account_info": {
258
425
  const result = await getAccountInfo();
259
426
  return {
@@ -277,6 +444,12 @@ server.setRequestHandler(types_js_1.ListResourcesRequestSchema, async () => {
277
444
  name: "MemoryX Status",
278
445
  description: "Current MemoryX connection status and queue info",
279
446
  mimeType: "application/json"
447
+ },
448
+ {
449
+ uri: "memoryx://memories/recent",
450
+ name: "Recent Memories",
451
+ description: "List of recent memories (last 20) in chronological order",
452
+ mimeType: "application/json"
280
453
  }
281
454
  ]
282
455
  };
@@ -295,12 +468,24 @@ server.setRequestHandler(types_js_1.ReadResourceRequestSchema, async (request) =
295
468
  ]
296
469
  };
297
470
  }
471
+ if (uri === "memoryx://memories/recent") {
472
+ const result = await listMemory(20);
473
+ return {
474
+ contents: [
475
+ {
476
+ uri,
477
+ mimeType: "application/json",
478
+ text: JSON.stringify(result, null, 2)
479
+ }
480
+ ]
481
+ };
482
+ }
298
483
  throw new Error(`Unknown resource: ${uri}`);
299
484
  });
300
485
  async function main() {
301
486
  const transport = new stdio_js_1.StdioServerTransport();
302
487
  await server.connect(transport);
303
- log("MemoryX MCP Server v2.0.0 started (powered by SDK)");
488
+ log("MemoryX MCP Server v2.1.0 started (powered by SDK)");
304
489
  }
305
490
  main().catch((error) => {
306
491
  console.error("Fatal error:", error);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,wEAAmE;AACnE,wEAAiF;AACjF,iEAK4C;AAC5C,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAChD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC;AAErE,2BAA2B;AAC3B,IAAI,WAAW,GAAQ,IAAI,CAAC;AAC5B,IAAI,cAAc,GAAwB,IAAI,CAAC;AAE/C,SAAS,GAAG,CAAC,OAAe;IAC1B,MAAM,SAAS,GAAG,IAAI,IAAI,EA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AAC;iBACtC;aACF;SACF,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;AAC9C,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,GAAG,CAAC,oDAAoD,CAAC,CAAC;AAC5D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t0ken.ai/memoryx-mcp-server",
3
- "version": "2.0.2",
3
+ "version": "2.1.0",
4
4
  "description": "MemoryX MCP Server for Cursor/VS Code/Claude Desktop (powered by @t0ken.ai/memoryx-sdk)",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -22,6 +22,8 @@ import {
22
22
  ListToolsRequestSchema,
23
23
  ListResourcesRequestSchema,
24
24
  ReadResourceRequestSchema,
25
+ ListPromptsRequestSchema,
26
+ GetPromptRequestSchema,
25
27
  } from "@modelcontextprotocol/sdk/types.js";
26
28
  import * as path from "path";
27
29
  import * as os from "os";
@@ -135,6 +137,44 @@ async function searchMemory(query: string, limit: number = 5): Promise<{
135
137
  }
136
138
  }
137
139
 
140
+ async function listMemory(limit: number = 20): Promise<{
141
+ memories: any[];
142
+ total: number;
143
+ }> {
144
+ try {
145
+ const sdk = await getSDK();
146
+ const result = await sdk.list(limit, 0);
147
+
148
+ return {
149
+ memories: (result.data || []).map((m: any) => ({
150
+ id: m.id,
151
+ content: m.content,
152
+ category: m.category || "other"
153
+ })),
154
+ total: result.total || 0
155
+ };
156
+ } catch (e) {
157
+ log(`listMemory failed: ${e}`);
158
+ return { memories: [], total: 0 };
159
+ }
160
+ }
161
+
162
+ async function deleteMemory(memoryId: string): Promise<{ success: boolean; message: string }> {
163
+ if (!memoryId) {
164
+ return { success: false, message: "memory_id is required" };
165
+ }
166
+
167
+ try {
168
+ const sdk = await getSDK();
169
+ await sdk.delete(memoryId);
170
+
171
+ return { success: true, message: "Memory deleted successfully" };
172
+ } catch (e) {
173
+ log(`deleteMemory failed: ${e}`);
174
+ return { success: false, message: String(e) };
175
+ }
176
+ }
177
+
138
178
  async function getAccountInfo(): Promise<{
139
179
  apiKey: string | null;
140
180
  agentId: string | null;
@@ -166,16 +206,106 @@ async function getAccountInfo(): Promise<{
166
206
  const server = new Server(
167
207
  {
168
208
  name: "memoryx-mcp-server",
169
- version: "2.0.0",
209
+ version: "2.1.0",
170
210
  },
171
211
  {
172
212
  capabilities: {
173
213
  tools: {},
174
214
  resources: {},
215
+ prompts: {},
175
216
  },
176
217
  }
177
218
  );
178
219
 
220
+ // Prompt templates
221
+ const PROMPTS = [
222
+ {
223
+ name: "start-with-memory",
224
+ description: "Start a new conversation by retrieving recent memories to restore context. Use this at the beginning of a session.",
225
+ arguments: []
226
+ },
227
+ {
228
+ name: "archive-session",
229
+ description: "Archive the current conversation by extracting key decisions, TODOs, and facts. Use this at the end of a session.",
230
+ arguments: [
231
+ {
232
+ name: "topic",
233
+ description: "The main topic or theme of the conversation",
234
+ required: true
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ name: "recall-context",
240
+ description: "Recall relevant context from memory before responding. Activates memory retrieval by searching historical memories related to the topic. Use this to ensure responses are informed by past discussions.",
241
+ arguments: [
242
+ {
243
+ name: "topic",
244
+ description: "The topic or question to recall context for",
245
+ required: true
246
+ }
247
+ ]
248
+ }
249
+ ];
250
+
251
+ server.setRequestHandler(ListPromptsRequestSchema, async () => {
252
+ return { prompts: PROMPTS };
253
+ });
254
+
255
+ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
256
+ const { name, arguments: args } = request.params;
257
+
258
+ switch (name) {
259
+ case "start-with-memory":
260
+ return {
261
+ messages: [
262
+ {
263
+ role: "user",
264
+ content: {
265
+ type: "text",
266
+ text: "As my personal assistant at the start of a new conversation, please first read the memoryx://memories/recent resource to retrieve my recent memories. Based on retrieved information, briefly summarize what we've been working on and ask about my next plans. This helps maintain context across sessions."
267
+ }
268
+ }
269
+ ]
270
+ };
271
+
272
+ case "archive-session":
273
+ const topic = args?.topic || "this conversation";
274
+ return {
275
+ messages: [
276
+ {
277
+ role: "user",
278
+ content: {
279
+ type: "text",
280
+ text: `Please review this conversation about ${topic}. Extract:
281
+ 1. Key decisions made
282
+ 2. TODO items and action items
283
+ 3. Important facts mentioned by user
284
+ Use save_memory tool to store these in structured format with tags: ${topic} and today's date. Keep the summary concise (under 100 words).`
285
+ }
286
+ }
287
+ ]
288
+ };
289
+
290
+ case "recall-context":
291
+ const recallTopic = args?.topic || "";
292
+ return {
293
+ messages: [
294
+ {
295
+ role: "user",
296
+ content: {
297
+ type: "text",
298
+ text: `Please recall relevant context from memory about: "${recallTopic}". Call search_memory to retrieve related historical discussions, then use that context to inform your response. This ensures consistency with past conversations.`
299
+ }
300
+ }
301
+ ]
302
+ };
303
+
304
+ default:
305
+ throw new Error(`Unknown prompt: ${name}`);
306
+ }
307
+ });
308
+
179
309
  server.setRequestHandler(ListToolsRequestSchema, async () => {
180
310
  return {
181
311
  tools: [
@@ -216,6 +346,34 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
216
346
  required: ["query"]
217
347
  }
218
348
  },
349
+ {
350
+ name: "list_memory",
351
+ description: "List recent memories in chronological order (newest first). Use this to: (1) Review what has been stored; (2) Get context at the start of a conversation; (3) Find specific memories when you're unsure of keywords. Returns memory id, content, and category.",
352
+ inputSchema: {
353
+ type: "object",
354
+ properties: {
355
+ limit: {
356
+ type: "number",
357
+ description: "Number of memories to return, default 20",
358
+ default: 20
359
+ }
360
+ }
361
+ }
362
+ },
363
+ {
364
+ name: "delete_memory",
365
+ description: "Delete a specific memory by ID. Use when: (1) User explicitly asks to forget something; (2) You find outdated or incorrect information. Requires memory_id from list_memory or search_memory results.",
366
+ inputSchema: {
367
+ type: "object",
368
+ properties: {
369
+ memory_id: {
370
+ type: "string",
371
+ description: "The ID of the memory to delete"
372
+ }
373
+ },
374
+ required: ["memory_id"]
375
+ }
376
+ },
219
377
  {
220
378
  name: "get_account_info",
221
379
  description: "Get current MemoryX account info including API Key, Agent ID, and queue status.",
@@ -260,6 +418,32 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
260
418
  };
261
419
  }
262
420
 
421
+ case "list_memory": {
422
+ const limit = (args?.limit as number) || 20;
423
+ const result = await listMemory(limit);
424
+ return {
425
+ content: [
426
+ {
427
+ type: "text",
428
+ text: JSON.stringify(result, null, 2)
429
+ }
430
+ ]
431
+ };
432
+ }
433
+
434
+ case "delete_memory": {
435
+ const memoryId = args?.memory_id as string;
436
+ const result = await deleteMemory(memoryId);
437
+ return {
438
+ content: [
439
+ {
440
+ type: "text",
441
+ text: JSON.stringify(result, null, 2)
442
+ }
443
+ ]
444
+ };
445
+ }
446
+
263
447
  case "get_account_info": {
264
448
  const result = await getAccountInfo();
265
449
  return {
@@ -285,6 +469,12 @@ server.setRequestHandler(ListResourcesRequestSchema, async () => {
285
469
  name: "MemoryX Status",
286
470
  description: "Current MemoryX connection status and queue info",
287
471
  mimeType: "application/json"
472
+ },
473
+ {
474
+ uri: "memoryx://memories/recent",
475
+ name: "Recent Memories",
476
+ description: "List of recent memories (last 20) in chronological order",
477
+ mimeType: "application/json"
288
478
  }
289
479
  ]
290
480
  };
@@ -306,6 +496,19 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
306
496
  };
307
497
  }
308
498
 
499
+ if (uri === "memoryx://memories/recent") {
500
+ const result = await listMemory(20);
501
+ return {
502
+ contents: [
503
+ {
504
+ uri,
505
+ mimeType: "application/json",
506
+ text: JSON.stringify(result, null, 2)
507
+ }
508
+ ]
509
+ };
510
+ }
511
+
309
512
  throw new Error(`Unknown resource: ${uri}`);
310
513
  });
311
514
 
@@ -313,7 +516,7 @@ async function main() {
313
516
  const transport = new StdioServerTransport();
314
517
  await server.connect(transport);
315
518
 
316
- log("MemoryX MCP Server v2.0.0 started (powered by SDK)");
519
+ log("MemoryX MCP Server v2.1.0 started (powered by SDK)");
317
520
  }
318
521
 
319
522
  main().catch((error) => {