@whenmoon-afk/memory-mcp 2.0.0 ā 2.1.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/README.md +98 -9
- package/dist/index.js +1 -1
- package/install.js +144 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
# claude-memory-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@whenmoon-afk/memory-mcp)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
|
|
7
|
+
**Local, Persistent Memory for Any MCP-Compatible AI**
|
|
4
8
|
A lightweight, **zero-cloud**, **token-efficient** Model Context Protocol (MCP) server that gives your AI **durable, searchable, and context-aware memory** - entirely under your control.
|
|
5
9
|
|
|
6
|
-
Built with **TypeScript**, **SQLite + FTS5**, and **
|
|
10
|
+
Built with **TypeScript**, **SQLite + FTS5**, and **minimal runtime dependencies** (MCP SDK + better-sqlite3), it runs locally and stores everything in a single, portable `.db` file.
|
|
7
11
|
|
|
8
12
|
Works with **Claude Desktop**, **Cursor**, **Windsurf**, or any MCP client.
|
|
9
13
|
|
|
14
|
+
š¦ **Now available on npm**: Install with `npx @whenmoon-afk/memory-mcp`
|
|
15
|
+
|
|
10
16
|
---
|
|
11
17
|
|
|
12
18
|
## Why Local Memory?
|
|
@@ -40,20 +46,32 @@ Works with **Claude Desktop**, **Cursor**, **Windsurf**, or any MCP client.
|
|
|
40
46
|
|
|
41
47
|
### Prerequisites
|
|
42
48
|
- Node.js ā„ 18
|
|
43
|
-
- An **MCP-compatible client**
|
|
49
|
+
- An **MCP-compatible client** (Claude Desktop, Cursor, Windsurf, etc.)
|
|
50
|
+
|
|
51
|
+
### Option 1: NPM Package with Auto-Setup (Recommended)
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
**Automatic installation** (configures Claude Desktop for you):
|
|
46
54
|
```bash
|
|
47
55
|
npx @whenmoon-afk/memory-mcp
|
|
48
56
|
```
|
|
49
57
|
|
|
50
|
-
|
|
58
|
+
This will automatically:
|
|
59
|
+
- Detect your operating system (macOS/Windows/Linux)
|
|
60
|
+
- Add the memory server to your Claude Desktop configuration
|
|
61
|
+
- Create a backup of your existing config
|
|
62
|
+
- Configure the correct command format for your platform
|
|
63
|
+
|
|
64
|
+
After installation, **restart Claude Desktop completely** (quit and reopen).
|
|
65
|
+
|
|
66
|
+
**Or install globally**:
|
|
51
67
|
```bash
|
|
52
68
|
npm install -g @whenmoon-afk/memory-mcp
|
|
53
69
|
memory-mcp
|
|
54
70
|
```
|
|
55
71
|
|
|
56
|
-
### From Source
|
|
72
|
+
### Option 2: From Source
|
|
73
|
+
|
|
74
|
+
For development or customization:
|
|
57
75
|
```bash
|
|
58
76
|
git clone https://github.com/WhenMoon-afk/claude-memory-mcp.git
|
|
59
77
|
cd claude-memory-mcp
|
|
@@ -67,15 +85,42 @@ npm run build
|
|
|
67
85
|
|
|
68
86
|
## Integrate with Your MCP Client
|
|
69
87
|
|
|
70
|
-
Add to your client's MCP config:
|
|
88
|
+
Add to your client's MCP config file:
|
|
89
|
+
|
|
90
|
+
**Claude Desktop**:
|
|
91
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
92
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
93
|
+
- Linux: `~/.config/Claude/claude_desktop_config.json`
|
|
94
|
+
|
|
95
|
+
**Cursor/Windsurf**: Check your editor's MCP settings
|
|
71
96
|
|
|
72
|
-
|
|
97
|
+
> **š” Recommended**: Use the automatic installer (`npx @whenmoon-afk/memory-mcp`) which handles platform differences automatically.
|
|
98
|
+
|
|
99
|
+
### Manual Configuration (macOS/Linux)
|
|
73
100
|
```json
|
|
74
101
|
{
|
|
75
102
|
"mcpServers": {
|
|
76
103
|
"memory": {
|
|
77
104
|
"command": "npx",
|
|
78
|
-
"args": ["@whenmoon-afk/memory-mcp"],
|
|
105
|
+
"args": ["-y", "@whenmoon-afk/memory-mcp"],
|
|
106
|
+
"env": {
|
|
107
|
+
"MEMORY_DB_PATH": "./memory.db"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Manual Configuration (Windows)
|
|
115
|
+
|
|
116
|
+
**Windows requires the `cmd /c` wrapper** to execute npx properly:
|
|
117
|
+
|
|
118
|
+
```json
|
|
119
|
+
{
|
|
120
|
+
"mcpServers": {
|
|
121
|
+
"memory": {
|
|
122
|
+
"command": "cmd",
|
|
123
|
+
"args": ["/c", "npx", "-y", "@whenmoon-afk/memory-mcp"],
|
|
79
124
|
"env": {
|
|
80
125
|
"MEMORY_DB_PATH": "./memory.db"
|
|
81
126
|
}
|
|
@@ -234,6 +279,23 @@ Your AI **knows what it knows** ā and can ask for more.
|
|
|
234
279
|
|
|
235
280
|
---
|
|
236
281
|
|
|
282
|
+
## Dependencies
|
|
283
|
+
|
|
284
|
+
This project uses minimal runtime dependencies to keep the package lightweight:
|
|
285
|
+
|
|
286
|
+
| Dependency | Version | Purpose |
|
|
287
|
+
|-----------|---------|---------|
|
|
288
|
+
| `@modelcontextprotocol/sdk` | ^1.0.4 | Official MCP protocol implementation |
|
|
289
|
+
| `better-sqlite3` | ^11.0.0 | Fast, native SQLite3 bindings with FTS5 support |
|
|
290
|
+
|
|
291
|
+
**Why these dependencies?**
|
|
292
|
+
- **MCP SDK**: Required for implementing the Model Context Protocol standard
|
|
293
|
+
- **better-sqlite3**: Native performance for full-text search and database operations, essential for memory recall speed
|
|
294
|
+
|
|
295
|
+
All other dependencies are dev-only (TypeScript, testing, linting).
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
237
299
|
## Environment Variables
|
|
238
300
|
|
|
239
301
|
| Var | Default | Description |
|
|
@@ -259,5 +321,32 @@ For sensitive data, use OS-level encryption (FileVault, BitLocker).
|
|
|
259
321
|
4. **Reference provenance**: Track source and context for audit trails.
|
|
260
322
|
5. **Backup `memory.db`** regularly ā it's just a file!
|
|
261
323
|
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## Quick Links
|
|
262
327
|
|
|
328
|
+
- š¦ **NPM Package**: https://www.npmjs.com/package/@whenmoon-afk/memory-mcp
|
|
329
|
+
- š **GitHub Repository**: https://github.com/WhenMoon-afk/claude-memory-mcp
|
|
330
|
+
- š **Report Issues**: https://github.com/WhenMoon-afk/claude-memory-mcp/issues
|
|
331
|
+
- š **MCP Documentation**: https://modelcontextprotocol.io
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Contributing
|
|
336
|
+
|
|
337
|
+
Contributions are welcome! Feel free to:
|
|
338
|
+
- Report bugs or request features via [GitHub Issues](https://github.com/WhenMoon-afk/claude-memory-mcp/issues)
|
|
339
|
+
- Submit pull requests for improvements
|
|
340
|
+
- Share your use cases and feedback
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## License
|
|
345
|
+
|
|
346
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
347
|
+
|
|
348
|
+
**Copyright (c) 2025 WhenMoon-afk**
|
|
349
|
+
|
|
350
|
+
---
|
|
263
351
|
|
|
352
|
+
**Built with ā¤ļø for the MCP community**
|
package/dist/index.js
CHANGED
package/install.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Memory MCP Server - Automatic Installation Script
|
|
5
|
+
* Configures Claude Desktop to use the memory server
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import { dirname, join } from 'path';
|
|
10
|
+
import { homedir, platform } from 'os';
|
|
11
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
12
|
+
|
|
13
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
14
|
+
const __dirname = dirname(__filename);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Get Claude Desktop config path based on platform
|
|
18
|
+
*/
|
|
19
|
+
function getClaudeConfigPath() {
|
|
20
|
+
const plat = platform();
|
|
21
|
+
|
|
22
|
+
switch (plat) {
|
|
23
|
+
case 'darwin': // macOS
|
|
24
|
+
return join(homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
25
|
+
|
|
26
|
+
case 'win32': // Windows
|
|
27
|
+
return join(process.env.APPDATA || join(homedir(), 'AppData', 'Roaming'), 'Claude', 'claude_desktop_config.json');
|
|
28
|
+
|
|
29
|
+
default: // Linux and others
|
|
30
|
+
const configHome = process.env.XDG_CONFIG_HOME || join(homedir(), '.config');
|
|
31
|
+
return join(configHome, 'Claude', 'claude_desktop_config.json');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get platform-specific MCP server configuration
|
|
37
|
+
*/
|
|
38
|
+
function getMcpServerConfig() {
|
|
39
|
+
// Get the absolute path to the installed package
|
|
40
|
+
const packageRoot = dirname(__dirname);
|
|
41
|
+
const serverPath = join(packageRoot, 'dist', 'index.js');
|
|
42
|
+
|
|
43
|
+
// All platforms use node directly with the server path
|
|
44
|
+
return {
|
|
45
|
+
command: 'node',
|
|
46
|
+
args: [serverPath]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Install the memory server configuration
|
|
52
|
+
*/
|
|
53
|
+
function install() {
|
|
54
|
+
console.log('š§ Memory MCP Server - Automatic Installation\n');
|
|
55
|
+
|
|
56
|
+
const configPath = getClaudeConfigPath();
|
|
57
|
+
const configDir = dirname(configPath);
|
|
58
|
+
|
|
59
|
+
// Ensure config directory exists
|
|
60
|
+
if (!existsSync(configDir)) {
|
|
61
|
+
console.log(`š Creating config directory: ${configDir}`);
|
|
62
|
+
try {
|
|
63
|
+
mkdirSync(configDir, { recursive: true });
|
|
64
|
+
} catch (error) {
|
|
65
|
+
console.error(`ā Failed to create config directory: ${error.message}`);
|
|
66
|
+
console.log('\nā ļø Please create the directory manually and run this installer again.');
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Read existing config or create new one
|
|
72
|
+
let config = { mcpServers: {} };
|
|
73
|
+
let isNewConfig = true;
|
|
74
|
+
|
|
75
|
+
if (existsSync(configPath)) {
|
|
76
|
+
isNewConfig = false;
|
|
77
|
+
console.log(`š Reading existing config: ${configPath}`);
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
const configContent = readFileSync(configPath, 'utf-8');
|
|
81
|
+
config = JSON.parse(configContent);
|
|
82
|
+
|
|
83
|
+
// Ensure mcpServers object exists
|
|
84
|
+
if (!config.mcpServers) {
|
|
85
|
+
config.mcpServers = {};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Create backup
|
|
89
|
+
const backupPath = `${configPath}.backup`;
|
|
90
|
+
writeFileSync(backupPath, configContent, 'utf-8');
|
|
91
|
+
console.log(`š¾ Backup created: ${backupPath}`);
|
|
92
|
+
|
|
93
|
+
} catch (error) {
|
|
94
|
+
console.error(`ā Failed to read/parse config file: ${error.message}`);
|
|
95
|
+
console.log('\nā ļø Your config file may be corrupted. Please fix it manually or delete it to create a new one.');
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
console.log(`š Creating new config file: ${configPath}`);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Add or update memory server configuration
|
|
103
|
+
const serverConfig = getMcpServerConfig();
|
|
104
|
+
const serverExists = config.mcpServers.memory !== undefined;
|
|
105
|
+
|
|
106
|
+
config.mcpServers.memory = serverConfig;
|
|
107
|
+
|
|
108
|
+
// Write updated config
|
|
109
|
+
try {
|
|
110
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
111
|
+
|
|
112
|
+
if (serverExists) {
|
|
113
|
+
console.log('ā
Memory server configuration updated!');
|
|
114
|
+
} else {
|
|
115
|
+
console.log('ā
Memory server configuration added!');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
} catch (error) {
|
|
119
|
+
console.error(`ā Failed to write config file: ${error.message}`);
|
|
120
|
+
console.log('\nā ļø Please check file permissions and try again.');
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Display next steps
|
|
125
|
+
console.log('\nš Next Steps:');
|
|
126
|
+
console.log('1. Restart Claude Desktop completely (quit and reopen)');
|
|
127
|
+
console.log('2. The memory server will be available automatically');
|
|
128
|
+
console.log('3. Try asking Claude to "store a memory" or "recall memories about..."');
|
|
129
|
+
|
|
130
|
+
console.log('\nš Configuration Location:');
|
|
131
|
+
console.log(` ${configPath}`);
|
|
132
|
+
|
|
133
|
+
console.log('\n⨠Installation complete! Enjoy your persistent AI memory!\n');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Run installer
|
|
137
|
+
try {
|
|
138
|
+
install();
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error('ā Installation failed:', error.message);
|
|
141
|
+
console.error('\nš For manual installation instructions, see:');
|
|
142
|
+
console.error(' https://github.com/WhenMoon-afk/claude-memory-mcp#readme');
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whenmoon-afk/memory-mcp",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Brain-inspired memory for AI agents - MCP server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"memory-mcp": "
|
|
8
|
+
"memory-mcp": "install.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist/",
|
|
12
|
+
"install.js",
|
|
12
13
|
"README.md",
|
|
13
14
|
"LICENSE"
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|
|
16
17
|
"dev": "tsx watch src/index.ts",
|
|
17
18
|
"build": "tsc",
|
|
19
|
+
"prepare": "npm run build",
|
|
18
20
|
"test": "vitest run",
|
|
19
21
|
"test:watch": "vitest",
|
|
20
22
|
"test:coverage": "vitest run --coverage",
|
|
@@ -40,7 +42,7 @@
|
|
|
40
42
|
"license": "MIT",
|
|
41
43
|
"repository": {
|
|
42
44
|
"type": "git",
|
|
43
|
-
"url": "https://github.com/whenmoon-afk/claude-memory-mcp.git"
|
|
45
|
+
"url": "git+https://github.com/whenmoon-afk/claude-memory-mcp.git"
|
|
44
46
|
},
|
|
45
47
|
"bugs": {
|
|
46
48
|
"url": "https://github.com/whenmoon-afk/claude-memory-mcp/issues"
|