@shodh/memory-mcp 0.1.70 → 0.1.72

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
@@ -5,7 +5,7 @@
5
5
  <h1 align="center">Shodh-Memory MCP Server</h1>
6
6
 
7
7
  <p align="center">
8
- <strong>v0.1.61</strong> | Persistent cognitive memory for AI agents
8
+ <strong>v0.1.70</strong> | Persistent cognitive memory for AI agents
9
9
  </p>
10
10
 
11
11
  <p align="center">
@@ -30,7 +30,7 @@
30
30
  - **Knowledge Graph**: Entity extraction and relationship tracking
31
31
  - **Memory Consolidation**: Automatic decay, replay, and strengthening
32
32
  - **1-Click Install**: Auto-downloads native server binary for your platform
33
- - **Offline-First**: All models bundled (~15MB), no internet required after install
33
+ - **Offline-First**: All models auto-downloaded on first run (~38MB total), no internet required after
34
34
  - **Fast**: Sub-millisecond graph lookup, 30-50ms semantic search
35
35
 
36
36
  ## Installation
@@ -57,6 +57,17 @@ Config file locations:
57
57
  - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
58
58
  - Linux: `~/.config/Claude/claude_desktop_config.json`
59
59
 
60
+ **Codex CLI** (`.codex/config.toml`):
61
+ ```toml
62
+ [mcp_servers.shodh-memory]
63
+ startup_timeout_sec = 60
64
+ command = "npx"
65
+ args = ["-y", "@shodh/memory-mcp"]
66
+ env = { SHODH_API_KEY = "your-api-key-here" }
67
+ ```
68
+
69
+ > **Note**: First run downloads the server binary (~15MB) plus embedding model (~23MB). The `startup_timeout_sec = 60` ensures enough time for initial setup.
70
+
60
71
  **For Cursor/other MCP clients**: Similar configuration with the npx command.
61
72
 
62
73
  ## Environment Variables
@@ -169,7 +180,7 @@ Based on Cowan's working memory model:
169
180
  ## How It Works
170
181
 
171
182
  1. **Install**: `npx -y @shodh/memory-mcp` downloads the package
172
- 2. **Auto-spawn**: On first run, downloads the native server binary (~15MB)
183
+ 2. **Auto-spawn**: On first run, downloads the native server binary (~15MB) and embedding model (~23MB)
173
184
  3. **Connect**: MCP client connects to the server via stdio
174
185
  4. **Ready**: Start using `remember` and `recall` tools
175
186
 
package/dist/index.js CHANGED
@@ -5125,7 +5125,11 @@ async function apiCall(endpoint, method = "GET", body) {
5125
5125
  }
5126
5126
  }
5127
5127
  }
5128
- throw new Error(`Failed after ${RETRY_ATTEMPTS} attempts: ${lastError?.message || "Unknown error"}`);
5128
+ const errMsg = lastError?.message || "Unknown error";
5129
+ if (errMsg.includes("ECONNREFUSED") || errMsg.includes("fetch failed")) {
5130
+ throw new Error(`Cannot connect to shodh-memory server at ${API_URL}. ` + `Start the server with: shodh-memory-server`);
5131
+ }
5132
+ throw new Error(`Failed after ${RETRY_ATTEMPTS} attempts: ${errMsg}`);
5129
5133
  }
5130
5134
  async function isServerAvailable() {
5131
5135
  try {
@@ -7842,7 +7846,12 @@ async function ensureServerRunning() {
7842
7846
  return;
7843
7847
  }
7844
7848
  if (!AUTO_SPAWN_ENABLED) {
7845
- console.error("[shodh-memory] Auto-spawn disabled. Please start the server manually.");
7849
+ console.error("[shodh-memory] Server not running at", API_URL);
7850
+ console.error("[shodh-memory] Auto-spawn disabled (SHODH_AUTO_SPAWN=false).");
7851
+ console.error("[shodh-memory] Start the server manually:");
7852
+ console.error("[shodh-memory] shodh-memory-server");
7853
+ console.error("[shodh-memory] Or with Docker:");
7854
+ console.error("[shodh-memory] docker run -d -p 3030:3030 roshera/shodh-memory");
7846
7855
  return;
7847
7856
  }
7848
7857
  const binaryPath = getBinaryPath();
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@shodh/memory-mcp",
3
- "version": "0.1.70",
3
+ "version": "0.1.72",
4
4
  "mcpName": "io.github.varun29ankuS/shodh-memory",
5
5
  "description": "MCP server for persistent AI memory - store and recall context across sessions",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
8
8
  "bin": {
9
- "shodh-memory-mcp": "./dist/index.js"
9
+ "shodh-memory-mcp": "dist/index.js"
10
10
  },
11
11
  "scripts": {
12
12
  "start": "bun run index.ts",
@@ -36,7 +36,7 @@
36
36
  "license": "Apache-2.0",
37
37
  "repository": {
38
38
  "type": "git",
39
- "url": "https://github.com/varun29ankuS/shodh-memory"
39
+ "url": "git+https://github.com/varun29ankuS/shodh-memory.git"
40
40
  },
41
41
  "homepage": "https://github.com/varun29ankuS/shodh-memory#readme",
42
42
  "bugs": {
@@ -1,134 +1,134 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Postinstall script for @shodh/memory-mcp
4
- *
5
- * Downloads the appropriate shodh-memory-server binary for the current platform
6
- * from GitHub releases.
7
- */
8
-
9
- const fs = require('fs');
10
- const path = require('path');
11
- const https = require('https');
12
- const { execSync } = require('child_process');
13
-
14
- const VERSION = '0.1.6';
15
- const REPO = 'varun29ankuS/shodh-memory';
16
- const BIN_DIR = path.join(__dirname, '..', 'bin');
17
-
18
- // Platform detection
19
- function getPlatformInfo() {
20
- const platform = process.platform;
21
- const arch = process.arch;
22
-
23
- if (platform === 'linux' && arch === 'x64') {
24
- return { name: 'shodh-memory-linux-x64', ext: '.tar.gz', binary: 'shodh-memory-server' };
25
- } else if (platform === 'linux' && arch === 'arm64') {
26
- return { name: 'shodh-memory-linux-arm64', ext: '.tar.gz', binary: 'shodh-memory-server' };
27
- } else if (platform === 'darwin' && arch === 'x64') {
28
- return { name: 'shodh-memory-macos-x64', ext: '.tar.gz', binary: 'shodh-memory-server' };
29
- } else if (platform === 'darwin' && arch === 'arm64') {
30
- return { name: 'shodh-memory-macos-arm64', ext: '.tar.gz', binary: 'shodh-memory-server' };
31
- } else if (platform === 'win32' && arch === 'x64') {
32
- return { name: 'shodh-memory-windows-x64', ext: '.zip', binary: 'shodh-memory-server.exe' };
33
- } else {
34
- return null;
35
- }
36
- }
37
-
38
- // Download file with redirect following
39
- function download(url, dest) {
40
- return new Promise((resolve, reject) => {
41
- const file = fs.createWriteStream(dest);
42
-
43
- const request = (url) => {
44
- https.get(url, (response) => {
45
- if (response.statusCode === 302 || response.statusCode === 301) {
46
- // Follow redirect
47
- request(response.headers.location);
48
- return;
49
- }
50
-
51
- if (response.statusCode !== 200) {
52
- reject(new Error(`Failed to download: ${response.statusCode}`));
53
- return;
54
- }
55
-
56
- response.pipe(file);
57
- file.on('finish', () => {
58
- file.close();
59
- resolve();
60
- });
61
- }).on('error', (err) => {
62
- fs.unlink(dest, () => {});
63
- reject(err);
64
- });
65
- };
66
-
67
- request(url);
68
- });
69
- }
70
-
71
- // Extract archive
72
- function extract(archive, dest, platformInfo) {
73
- if (platformInfo.ext === '.tar.gz') {
74
- execSync(`tar -xzf "${archive}" -C "${dest}"`, { stdio: 'inherit' });
75
- } else if (platformInfo.ext === '.zip') {
76
- // Use PowerShell on Windows
77
- execSync(`powershell -Command "Expand-Archive -Path '${archive}' -DestinationPath '${dest}' -Force"`, { stdio: 'inherit' });
78
- }
79
- }
80
-
81
- async function main() {
82
- const platformInfo = getPlatformInfo();
83
-
84
- if (!platformInfo) {
85
- console.log('[shodh-memory] Unsupported platform:', process.platform, process.arch);
86
- console.log('[shodh-memory] You will need to run the server manually.');
87
- return;
88
- }
89
-
90
- console.log('[shodh-memory] Installing server binary for', process.platform, process.arch);
91
-
92
- // Create bin directory
93
- if (!fs.existsSync(BIN_DIR)) {
94
- fs.mkdirSync(BIN_DIR, { recursive: true });
95
- }
96
-
97
- const binaryPath = path.join(BIN_DIR, platformInfo.binary);
98
-
99
- // Check if already installed
100
- if (fs.existsSync(binaryPath)) {
101
- console.log('[shodh-memory] Binary already installed at', binaryPath);
102
- return;
103
- }
104
-
105
- // Download URL
106
- const downloadUrl = `https://github.com/${REPO}/releases/download/v${VERSION}/${platformInfo.name}${platformInfo.ext}`;
107
- const archivePath = path.join(BIN_DIR, `${platformInfo.name}${platformInfo.ext}`);
108
-
109
- console.log('[shodh-memory] Downloading from', downloadUrl);
110
-
111
- try {
112
- await download(downloadUrl, archivePath);
113
- console.log('[shodh-memory] Downloaded archive');
114
-
115
- // Extract
116
- extract(archivePath, BIN_DIR, platformInfo);
117
- console.log('[shodh-memory] Extracted binary');
118
-
119
- // Clean up archive
120
- fs.unlinkSync(archivePath);
121
-
122
- // Make executable (Unix)
123
- if (process.platform !== 'win32') {
124
- fs.chmodSync(binaryPath, 0o755);
125
- }
126
-
127
- console.log('[shodh-memory] Server binary installed at', binaryPath);
128
- } catch (err) {
129
- console.error('[shodh-memory] Failed to install binary:', err.message);
130
- console.log('[shodh-memory] You can manually download from:', `https://github.com/${REPO}/releases`);
131
- }
132
- }
133
-
134
- main();
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Postinstall script for @shodh/memory-mcp
4
+ *
5
+ * Downloads the appropriate shodh-memory-server binary for the current platform
6
+ * from GitHub releases.
7
+ */
8
+
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+ const https = require('https');
12
+ const { execSync } = require('child_process');
13
+
14
+ const VERSION = '0.1.72';
15
+ const REPO = 'varun29ankuS/shodh-memory';
16
+ const BIN_DIR = path.join(__dirname, '..', 'bin');
17
+
18
+ // Platform detection
19
+ function getPlatformInfo() {
20
+ const platform = process.platform;
21
+ const arch = process.arch;
22
+
23
+ if (platform === 'linux' && arch === 'x64') {
24
+ return { name: 'shodh-memory-linux-x64', ext: '.tar.gz', binary: 'shodh-memory-server' };
25
+ } else if (platform === 'linux' && arch === 'arm64') {
26
+ return { name: 'shodh-memory-linux-arm64', ext: '.tar.gz', binary: 'shodh-memory-server' };
27
+ } else if (platform === 'darwin' && arch === 'x64') {
28
+ return { name: 'shodh-memory-macos-x64', ext: '.tar.gz', binary: 'shodh-memory-server' };
29
+ } else if (platform === 'darwin' && arch === 'arm64') {
30
+ return { name: 'shodh-memory-macos-arm64', ext: '.tar.gz', binary: 'shodh-memory-server' };
31
+ } else if (platform === 'win32' && arch === 'x64') {
32
+ return { name: 'shodh-memory-windows-x64', ext: '.zip', binary: 'shodh-memory-server.exe' };
33
+ } else {
34
+ return null;
35
+ }
36
+ }
37
+
38
+ // Download file with redirect following
39
+ function download(url, dest) {
40
+ return new Promise((resolve, reject) => {
41
+ const file = fs.createWriteStream(dest);
42
+
43
+ const request = (url) => {
44
+ https.get(url, (response) => {
45
+ if (response.statusCode === 302 || response.statusCode === 301) {
46
+ // Follow redirect
47
+ request(response.headers.location);
48
+ return;
49
+ }
50
+
51
+ if (response.statusCode !== 200) {
52
+ reject(new Error(`Failed to download: ${response.statusCode}`));
53
+ return;
54
+ }
55
+
56
+ response.pipe(file);
57
+ file.on('finish', () => {
58
+ file.close();
59
+ resolve();
60
+ });
61
+ }).on('error', (err) => {
62
+ fs.unlink(dest, () => {});
63
+ reject(err);
64
+ });
65
+ };
66
+
67
+ request(url);
68
+ });
69
+ }
70
+
71
+ // Extract archive
72
+ function extract(archive, dest, platformInfo) {
73
+ if (platformInfo.ext === '.tar.gz') {
74
+ execSync(`tar -xzf "${archive}" -C "${dest}"`, { stdio: 'inherit' });
75
+ } else if (platformInfo.ext === '.zip') {
76
+ // Use PowerShell on Windows
77
+ execSync(`powershell -Command "Expand-Archive -Path '${archive}' -DestinationPath '${dest}' -Force"`, { stdio: 'inherit' });
78
+ }
79
+ }
80
+
81
+ async function main() {
82
+ const platformInfo = getPlatformInfo();
83
+
84
+ if (!platformInfo) {
85
+ console.log('[shodh-memory] Unsupported platform:', process.platform, process.arch);
86
+ console.log('[shodh-memory] You will need to run the server manually.');
87
+ return;
88
+ }
89
+
90
+ console.log('[shodh-memory] Installing server binary for', process.platform, process.arch);
91
+
92
+ // Create bin directory
93
+ if (!fs.existsSync(BIN_DIR)) {
94
+ fs.mkdirSync(BIN_DIR, { recursive: true });
95
+ }
96
+
97
+ const binaryPath = path.join(BIN_DIR, platformInfo.binary);
98
+
99
+ // Check if already installed
100
+ if (fs.existsSync(binaryPath)) {
101
+ console.log('[shodh-memory] Binary already installed at', binaryPath);
102
+ return;
103
+ }
104
+
105
+ // Download URL
106
+ const downloadUrl = `https://github.com/${REPO}/releases/download/v${VERSION}/${platformInfo.name}${platformInfo.ext}`;
107
+ const archivePath = path.join(BIN_DIR, `${platformInfo.name}${platformInfo.ext}`);
108
+
109
+ console.log('[shodh-memory] Downloading from', downloadUrl);
110
+
111
+ try {
112
+ await download(downloadUrl, archivePath);
113
+ console.log('[shodh-memory] Downloaded archive');
114
+
115
+ // Extract
116
+ extract(archivePath, BIN_DIR, platformInfo);
117
+ console.log('[shodh-memory] Extracted binary');
118
+
119
+ // Clean up archive
120
+ fs.unlinkSync(archivePath);
121
+
122
+ // Make executable (Unix)
123
+ if (process.platform !== 'win32') {
124
+ fs.chmodSync(binaryPath, 0o755);
125
+ }
126
+
127
+ console.log('[shodh-memory] Server binary installed at', binaryPath);
128
+ } catch (err) {
129
+ console.error('[shodh-memory] Failed to install binary:', err.message);
130
+ console.log('[shodh-memory] You can manually download from:', `https://github.com/${REPO}/releases`);
131
+ }
132
+ }
133
+
134
+ main();