@whenmoon-afk/memory-mcp 2.0.0 → 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,12 +1,18 @@
1
1
  # claude-memory-mcp
2
2
 
3
- **Local, Persistent Memory for Any MCP-Compatible AI**
3
+ [![npm version](https://badge.fury.io/js/@whenmoon-afk%2Fmemory-mcp.svg)](https://www.npmjs.com/package/@whenmoon-afk/memory-mcp)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Node.js >= 18](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](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 **no external dependencies**, it runs locally and stores everything in a single, portable `.db` file.
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
- ### Quick Install (NPM)
53
+ **Automatic installation** (configures Claude Desktop for you):
46
54
  ```bash
47
55
  npx @whenmoon-afk/memory-mcp
48
56
  ```
49
57
 
50
- Or install globally:
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
- ### Using NPM Package (Recommended)
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
@@ -22,7 +22,7 @@ const config = {
22
22
  */
23
23
  const server = new Server({
24
24
  name: '@whenmoon-afk/memory-mcp',
25
- version: '2.0.0',
25
+ version: '2.1.0',
26
26
  }, {
27
27
  capabilities: {
28
28
  tools: {},
package/install.js ADDED
@@ -0,0 +1,155 @@
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
+ const plat = platform();
40
+
41
+ if (plat === 'win32') {
42
+ // Windows requires cmd /c wrapper for npx
43
+ return {
44
+ command: 'cmd',
45
+ args: ['/c', 'npx', '-y', '@whenmoon-afk/memory-mcp']
46
+ };
47
+ } else {
48
+ // macOS and Linux can use npx directly
49
+ return {
50
+ command: 'npx',
51
+ args: ['-y', '@whenmoon-afk/memory-mcp']
52
+ };
53
+ }
54
+ }
55
+
56
+ /**
57
+ * Install the memory server configuration
58
+ */
59
+ function install() {
60
+ console.log('🧠 Memory MCP Server - Automatic Installation\n');
61
+
62
+ const configPath = getClaudeConfigPath();
63
+ const configDir = dirname(configPath);
64
+
65
+ // Ensure config directory exists
66
+ if (!existsSync(configDir)) {
67
+ console.log(`šŸ“ Creating config directory: ${configDir}`);
68
+ try {
69
+ mkdirSync(configDir, { recursive: true });
70
+ } catch (error) {
71
+ console.error(`āŒ Failed to create config directory: ${error.message}`);
72
+ console.log('\nāš ļø Please create the directory manually and run this installer again.');
73
+ process.exit(1);
74
+ }
75
+ }
76
+
77
+ // Read existing config or create new one
78
+ let config = { mcpServers: {} };
79
+ let isNewConfig = true;
80
+
81
+ if (existsSync(configPath)) {
82
+ isNewConfig = false;
83
+ console.log(`šŸ“– Reading existing config: ${configPath}`);
84
+
85
+ try {
86
+ const configContent = readFileSync(configPath, 'utf-8');
87
+ config = JSON.parse(configContent);
88
+
89
+ // Ensure mcpServers object exists
90
+ if (!config.mcpServers) {
91
+ config.mcpServers = {};
92
+ }
93
+
94
+ // Create backup
95
+ const backupPath = `${configPath}.backup`;
96
+ writeFileSync(backupPath, configContent, 'utf-8');
97
+ console.log(`šŸ’¾ Backup created: ${backupPath}`);
98
+
99
+ } catch (error) {
100
+ console.error(`āŒ Failed to read/parse config file: ${error.message}`);
101
+ console.log('\nāš ļø Your config file may be corrupted. Please fix it manually or delete it to create a new one.');
102
+ process.exit(1);
103
+ }
104
+ } else {
105
+ console.log(`šŸ“ Creating new config file: ${configPath}`);
106
+ }
107
+
108
+ // Add or update memory server configuration
109
+ const serverConfig = getMcpServerConfig();
110
+ const serverExists = config.mcpServers.memory !== undefined;
111
+
112
+ config.mcpServers.memory = serverConfig;
113
+
114
+ // Write updated config
115
+ try {
116
+ writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf-8');
117
+
118
+ if (serverExists) {
119
+ console.log('āœ… Memory server configuration updated!');
120
+ } else {
121
+ console.log('āœ… Memory server configuration added!');
122
+ }
123
+
124
+ } catch (error) {
125
+ console.error(`āŒ Failed to write config file: ${error.message}`);
126
+ console.log('\nāš ļø Please check file permissions and try again.');
127
+ process.exit(1);
128
+ }
129
+
130
+ // Display next steps
131
+ console.log('\nšŸ“‹ Next Steps:');
132
+ console.log('1. Restart Claude Desktop completely (quit and reopen)');
133
+ console.log('2. The memory server will be available automatically');
134
+ console.log('3. Try asking Claude to "store a memory" or "recall memories about..."');
135
+
136
+ console.log('\nšŸ“ Configuration Location:');
137
+ console.log(` ${configPath}`);
138
+
139
+ if (platform() === 'win32') {
140
+ console.log('\nšŸ’” Windows Note:');
141
+ console.log(' This installer configured the server with the cmd /c wrapper required for Windows.');
142
+ }
143
+
144
+ console.log('\n✨ Installation complete! Enjoy your persistent AI memory!\n');
145
+ }
146
+
147
+ // Run installer
148
+ try {
149
+ install();
150
+ } catch (error) {
151
+ console.error('āŒ Installation failed:', error.message);
152
+ console.error('\nšŸ“– For manual installation instructions, see:');
153
+ console.error(' https://github.com/WhenMoon-afk/claude-memory-mcp#readme');
154
+ process.exit(1);
155
+ }
package/package.json CHANGED
@@ -1,20 +1,22 @@
1
1
  {
2
2
  "name": "@whenmoon-afk/memory-mcp",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
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": "./dist/index.js"
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"