@shodh/memory-mcp 0.1.1 → 0.1.4
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 +57 -86
- package/dist/index.js +182 -2
- package/package.json +46 -46
package/README.md
CHANGED
|
@@ -1,86 +1,57 @@
|
|
|
1
|
-
# Shodh-Memory MCP Server
|
|
2
|
-
|
|
3
|
-
Persistent AI memory with semantic search. Store observations, decisions, learnings, and recall them across sessions.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- **Semantic Search**: Find memories by meaning, not just keywords
|
|
8
|
-
- **Memory Types**: Categorize as Observation, Decision, Learning, Error, Pattern, etc.
|
|
9
|
-
- **Persistent**: Memories survive across sessions and restarts
|
|
10
|
-
- **Fast**: Sub-millisecond retrieval with vector indexing
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
##
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
"Remember that the user prefers Rust over Python for systems programming"
|
|
61
|
-
"Recall what I know about user's programming preferences"
|
|
62
|
-
"List my recent memories"
|
|
63
|
-
"Show memory stats"
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Environment Variables
|
|
67
|
-
|
|
68
|
-
| Variable | Default | Description |
|
|
69
|
-
|----------|---------|-------------|
|
|
70
|
-
| `SHODH_API_URL` | `http://127.0.0.1:3030` | Backend server URL |
|
|
71
|
-
| `SHODH_API_KEY` | (dev key) | API key for authentication |
|
|
72
|
-
| `SHODH_USER_ID` | `default` | User ID for memory isolation |
|
|
73
|
-
|
|
74
|
-
## Architecture
|
|
75
|
-
|
|
76
|
-
```
|
|
77
|
-
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
78
|
-
│ AI Client │────▶│ MCP Server │────▶│ Shodh Backend │
|
|
79
|
-
│ (Claude, etc.) │ │ (this package) │ │ (Rust server) │
|
|
80
|
-
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
81
|
-
stdio REST API
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## License
|
|
85
|
-
|
|
86
|
-
Apache-2.0
|
|
1
|
+
# Shodh-Memory MCP Server
|
|
2
|
+
|
|
3
|
+
Persistent AI memory with semantic search. Store observations, decisions, learnings, and recall them across sessions.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Semantic Search**: Find memories by meaning, not just keywords
|
|
8
|
+
- **Memory Types**: Categorize as Observation, Decision, Learning, Error, Pattern, etc.
|
|
9
|
+
- **Persistent**: Memories survive across sessions and restarts
|
|
10
|
+
- **Fast**: Sub-millisecond retrieval with vector indexing
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
Add to your MCP client config:
|
|
15
|
+
|
|
16
|
+
**Claude Desktop / Claude Code** (`claude_desktop_config.json`):
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"shodh-memory": {
|
|
21
|
+
"command": "npx",
|
|
22
|
+
"args": ["-y", "@shodh/memory-mcp"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Config file locations:
|
|
29
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
30
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
31
|
+
- Linux: `~/.config/Claude/claude_desktop_config.json`
|
|
32
|
+
|
|
33
|
+
**For Cursor/other MCP clients**: Similar configuration with the npx command.
|
|
34
|
+
|
|
35
|
+
## Tools
|
|
36
|
+
|
|
37
|
+
| Tool | Description |
|
|
38
|
+
|------|-------------|
|
|
39
|
+
| `remember` | Store a memory with optional type and tags |
|
|
40
|
+
| `recall` | Semantic search to find relevant memories |
|
|
41
|
+
| `context_summary` | Get categorized context for session bootstrap |
|
|
42
|
+
| `list_memories` | List all stored memories |
|
|
43
|
+
| `forget` | Delete a specific memory by ID |
|
|
44
|
+
| `memory_stats` | Get statistics about stored memories |
|
|
45
|
+
|
|
46
|
+
## Usage Examples
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
"Remember that the user prefers Rust over Python for systems programming"
|
|
50
|
+
"Recall what I know about user's programming preferences"
|
|
51
|
+
"List my recent memories"
|
|
52
|
+
"Show memory stats"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
Apache-2.0
|
package/dist/index.js
CHANGED
|
@@ -4945,7 +4945,7 @@ async function isServerAvailable() {
|
|
|
4945
4945
|
}
|
|
4946
4946
|
var server = new Server({
|
|
4947
4947
|
name: "shodh-memory",
|
|
4948
|
-
version: "0.1.
|
|
4948
|
+
version: "0.1.2"
|
|
4949
4949
|
}, {
|
|
4950
4950
|
capabilities: {
|
|
4951
4951
|
tools: {},
|
|
@@ -5063,6 +5063,82 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
5063
5063
|
type: "object",
|
|
5064
5064
|
properties: {}
|
|
5065
5065
|
}
|
|
5066
|
+
},
|
|
5067
|
+
{
|
|
5068
|
+
name: "recall_by_tags",
|
|
5069
|
+
description: "Search memories by tags. Returns memories matching ANY of the provided tags.",
|
|
5070
|
+
inputSchema: {
|
|
5071
|
+
type: "object",
|
|
5072
|
+
properties: {
|
|
5073
|
+
tags: {
|
|
5074
|
+
type: "array",
|
|
5075
|
+
items: { type: "string" },
|
|
5076
|
+
description: "Tags to search for (returns memories matching ANY tag)"
|
|
5077
|
+
},
|
|
5078
|
+
limit: {
|
|
5079
|
+
type: "number",
|
|
5080
|
+
description: "Maximum number of results (default: 20)",
|
|
5081
|
+
default: 20
|
|
5082
|
+
}
|
|
5083
|
+
},
|
|
5084
|
+
required: ["tags"]
|
|
5085
|
+
}
|
|
5086
|
+
},
|
|
5087
|
+
{
|
|
5088
|
+
name: "recall_by_date",
|
|
5089
|
+
description: "Search memories within a date range.",
|
|
5090
|
+
inputSchema: {
|
|
5091
|
+
type: "object",
|
|
5092
|
+
properties: {
|
|
5093
|
+
start: {
|
|
5094
|
+
type: "string",
|
|
5095
|
+
description: "Start date (ISO 8601 format, e.g., '2024-01-01T00:00:00Z')"
|
|
5096
|
+
},
|
|
5097
|
+
end: {
|
|
5098
|
+
type: "string",
|
|
5099
|
+
description: "End date (ISO 8601 format, e.g., '2024-12-31T23:59:59Z')"
|
|
5100
|
+
},
|
|
5101
|
+
limit: {
|
|
5102
|
+
type: "number",
|
|
5103
|
+
description: "Maximum number of results (default: 20)",
|
|
5104
|
+
default: 20
|
|
5105
|
+
}
|
|
5106
|
+
},
|
|
5107
|
+
required: ["start", "end"]
|
|
5108
|
+
}
|
|
5109
|
+
},
|
|
5110
|
+
{
|
|
5111
|
+
name: "forget_by_tags",
|
|
5112
|
+
description: "Delete memories matching ANY of the provided tags.",
|
|
5113
|
+
inputSchema: {
|
|
5114
|
+
type: "object",
|
|
5115
|
+
properties: {
|
|
5116
|
+
tags: {
|
|
5117
|
+
type: "array",
|
|
5118
|
+
items: { type: "string" },
|
|
5119
|
+
description: "Tags to match for deletion"
|
|
5120
|
+
}
|
|
5121
|
+
},
|
|
5122
|
+
required: ["tags"]
|
|
5123
|
+
}
|
|
5124
|
+
},
|
|
5125
|
+
{
|
|
5126
|
+
name: "forget_by_date",
|
|
5127
|
+
description: "Delete memories within a date range.",
|
|
5128
|
+
inputSchema: {
|
|
5129
|
+
type: "object",
|
|
5130
|
+
properties: {
|
|
5131
|
+
start: {
|
|
5132
|
+
type: "string",
|
|
5133
|
+
description: "Start date (ISO 8601 format)"
|
|
5134
|
+
},
|
|
5135
|
+
end: {
|
|
5136
|
+
type: "string",
|
|
5137
|
+
description: "End date (ISO 8601 format)"
|
|
5138
|
+
}
|
|
5139
|
+
},
|
|
5140
|
+
required: ["start", "end"]
|
|
5141
|
+
}
|
|
5066
5142
|
}
|
|
5067
5143
|
]
|
|
5068
5144
|
};
|
|
@@ -5292,6 +5368,110 @@ ${JSON.stringify(result, null, 2)}`
|
|
|
5292
5368
|
]
|
|
5293
5369
|
};
|
|
5294
5370
|
}
|
|
5371
|
+
case "recall_by_tags": {
|
|
5372
|
+
const { tags, limit = 20 } = args;
|
|
5373
|
+
const result = await apiCall("/api/recall/tags", "POST", {
|
|
5374
|
+
user_id: USER_ID,
|
|
5375
|
+
tags,
|
|
5376
|
+
limit
|
|
5377
|
+
});
|
|
5378
|
+
const memories = result.memories || [];
|
|
5379
|
+
if (memories.length === 0) {
|
|
5380
|
+
return {
|
|
5381
|
+
content: [
|
|
5382
|
+
{
|
|
5383
|
+
type: "text",
|
|
5384
|
+
text: `No memories found with tags: ${tags.join(", ")}`
|
|
5385
|
+
}
|
|
5386
|
+
]
|
|
5387
|
+
};
|
|
5388
|
+
}
|
|
5389
|
+
const formatted = memories.map((m, i) => {
|
|
5390
|
+
const content = getContent(m);
|
|
5391
|
+
return `${i + 1}. ${content.slice(0, 80)}${content.length > 80 ? "..." : ""}
|
|
5392
|
+
Type: ${getType(m)} | ID: ${m.id.slice(0, 8)}...`;
|
|
5393
|
+
}).join(`
|
|
5394
|
+
|
|
5395
|
+
`);
|
|
5396
|
+
return {
|
|
5397
|
+
content: [
|
|
5398
|
+
{
|
|
5399
|
+
type: "text",
|
|
5400
|
+
text: `Found ${memories.length} memories with tags [${tags.join(", ")}]:
|
|
5401
|
+
|
|
5402
|
+
${formatted}`
|
|
5403
|
+
}
|
|
5404
|
+
]
|
|
5405
|
+
};
|
|
5406
|
+
}
|
|
5407
|
+
case "recall_by_date": {
|
|
5408
|
+
const { start, end, limit = 20 } = args;
|
|
5409
|
+
const result = await apiCall("/api/recall/date", "POST", {
|
|
5410
|
+
user_id: USER_ID,
|
|
5411
|
+
start,
|
|
5412
|
+
end,
|
|
5413
|
+
limit
|
|
5414
|
+
});
|
|
5415
|
+
const memories = result.memories || [];
|
|
5416
|
+
if (memories.length === 0) {
|
|
5417
|
+
return {
|
|
5418
|
+
content: [
|
|
5419
|
+
{
|
|
5420
|
+
type: "text",
|
|
5421
|
+
text: `No memories found between ${start} and ${end}`
|
|
5422
|
+
}
|
|
5423
|
+
]
|
|
5424
|
+
};
|
|
5425
|
+
}
|
|
5426
|
+
const formatted = memories.map((m, i) => {
|
|
5427
|
+
const content = getContent(m);
|
|
5428
|
+
return `${i + 1}. ${content.slice(0, 80)}${content.length > 80 ? "..." : ""}
|
|
5429
|
+
Type: ${getType(m)} | Created: ${m.created_at || "unknown"}`;
|
|
5430
|
+
}).join(`
|
|
5431
|
+
|
|
5432
|
+
`);
|
|
5433
|
+
return {
|
|
5434
|
+
content: [
|
|
5435
|
+
{
|
|
5436
|
+
type: "text",
|
|
5437
|
+
text: `Found ${memories.length} memories between ${start} and ${end}:
|
|
5438
|
+
|
|
5439
|
+
${formatted}`
|
|
5440
|
+
}
|
|
5441
|
+
]
|
|
5442
|
+
};
|
|
5443
|
+
}
|
|
5444
|
+
case "forget_by_tags": {
|
|
5445
|
+
const { tags } = args;
|
|
5446
|
+
const result = await apiCall("/api/forget/tags", "POST", {
|
|
5447
|
+
user_id: USER_ID,
|
|
5448
|
+
tags
|
|
5449
|
+
});
|
|
5450
|
+
return {
|
|
5451
|
+
content: [
|
|
5452
|
+
{
|
|
5453
|
+
type: "text",
|
|
5454
|
+
text: `Deleted ${result.deleted_count} memories with tags: ${tags.join(", ")}`
|
|
5455
|
+
}
|
|
5456
|
+
]
|
|
5457
|
+
};
|
|
5458
|
+
}
|
|
5459
|
+
case "forget_by_date": {
|
|
5460
|
+
const { start, end } = args;
|
|
5461
|
+
const result = await apiCall("/api/forget/date", "POST", {
|
|
5462
|
+
user_id: USER_ID,
|
|
5463
|
+
start,
|
|
5464
|
+
end
|
|
5465
|
+
});
|
|
5466
|
+
return {
|
|
5467
|
+
content: [
|
|
5468
|
+
{
|
|
5469
|
+
type: "text",
|
|
5470
|
+
text: `Deleted ${result.deleted_count} memories between ${start} and ${end}`
|
|
5471
|
+
}
|
|
5472
|
+
]
|
|
5473
|
+
};
|
|
5474
|
+
}
|
|
5295
5475
|
default:
|
|
5296
5476
|
throw new Error(`Unknown tool: ${name}`);
|
|
5297
5477
|
}
|
|
@@ -5377,7 +5557,7 @@ ID: ${memory.id}`
|
|
|
5377
5557
|
async function main() {
|
|
5378
5558
|
const transport = new StdioServerTransport;
|
|
5379
5559
|
await server.connect(transport);
|
|
5380
|
-
console.error("Shodh-Memory MCP server v0.1.
|
|
5560
|
+
console.error("Shodh-Memory MCP server v0.1.2 running");
|
|
5381
5561
|
console.error(`Connecting to: ${API_URL}`);
|
|
5382
5562
|
console.error(`User ID: ${USER_ID}`);
|
|
5383
5563
|
}
|
package/package.json
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@shodh/memory-mcp",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"mcpName": "io.github.varun29ankuS/shodh-memory",
|
|
5
|
-
"description": "MCP server for persistent AI memory - store and recall context across sessions",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "dist/index.js",
|
|
8
|
-
"bin": {
|
|
9
|
-
"shodh-memory-mcp": "./dist/index.js"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"start": "bun run index.ts",
|
|
13
|
-
"build": "bun build index.ts --outdir dist --target node",
|
|
14
|
-
"prepublishOnly": "npm run build"
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"dist",
|
|
18
|
-
"README.md"
|
|
19
|
-
],
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@modelcontextprotocol/sdk": "^0.5.0"
|
|
22
|
-
},
|
|
23
|
-
"keywords": [
|
|
24
|
-
"mcp",
|
|
25
|
-
"model-context-protocol",
|
|
26
|
-
"memory",
|
|
27
|
-
"ai",
|
|
28
|
-
"llm",
|
|
29
|
-
"persistent-memory",
|
|
30
|
-
"semantic-search",
|
|
31
|
-
"shodh"
|
|
32
|
-
],
|
|
33
|
-
"author": "Shodh Team <29.varuns@gmail.com>",
|
|
34
|
-
"license": "Apache-2.0",
|
|
35
|
-
"repository": {
|
|
36
|
-
"type": "git",
|
|
37
|
-
"url": "https://github.com/varun29ankuS/shodh-memory"
|
|
38
|
-
},
|
|
39
|
-
"homepage": "https://github.com/varun29ankuS/shodh-memory#readme",
|
|
40
|
-
"bugs": {
|
|
41
|
-
"url": "https://github.com/varun29ankuS/shodh-memory/issues"
|
|
42
|
-
},
|
|
43
|
-
"engines": {
|
|
44
|
-
"node": ">=18.0.0"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@shodh/memory-mcp",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"mcpName": "io.github.varun29ankuS/shodh-memory",
|
|
5
|
+
"description": "MCP server for persistent AI memory - store and recall context across sessions",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "dist/index.js",
|
|
8
|
+
"bin": {
|
|
9
|
+
"shodh-memory-mcp": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"start": "bun run index.ts",
|
|
13
|
+
"build": "bun build index.ts --outdir dist --target node",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "^0.5.0"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"mcp",
|
|
25
|
+
"model-context-protocol",
|
|
26
|
+
"memory",
|
|
27
|
+
"ai",
|
|
28
|
+
"llm",
|
|
29
|
+
"persistent-memory",
|
|
30
|
+
"semantic-search",
|
|
31
|
+
"shodh"
|
|
32
|
+
],
|
|
33
|
+
"author": "Shodh Team <29.varuns@gmail.com>",
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/varun29ankuS/shodh-memory"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/varun29ankuS/shodh-memory#readme",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/varun29ankuS/shodh-memory/issues"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=18.0.0"
|
|
45
|
+
}
|
|
46
|
+
}
|