@vheins/local-memory-mcp 0.1.11 → 0.1.12
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 +64 -259
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,311 +1,116 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @vheins/local-memory-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@vheins/local-memory-mcp)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
A Model Context Protocol (MCP) server that provides **persistent, long-term memory** for AI coding agents. It helps agents remember architectural decisions, project-specific patterns, past mistakes, and codebase facts across different chat sessions.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Includes a **Web Dashboard** for easy management and visualization of stored memories.
|
|
8
9
|
|
|
9
|
-
## Features
|
|
10
|
+
## 🚀 Key Features
|
|
10
11
|
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **Antigravity Summaries**: High-level project
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
12
|
+
- **Project-Specific Memory**: Automatic isolation of memories per Git repository.
|
|
13
|
+
- **Durable Knowledge**: Store decisions, facts, mistakes, and patterns that survive context window resets.
|
|
14
|
+
- **Hybrid Search**: Combines semantic similarity scoring with keyword fallback.
|
|
15
|
+
- **Antigravity Summaries**: High-level project-wide "rules of engagement" for agents.
|
|
16
|
+
- **Web Dashboard**: Interactive UI to browse, edit, and delete memories (default: `http://localhost:3456`).
|
|
17
|
+
- **SQLite Backend**: Fast, local, and file-based storage.
|
|
17
18
|
|
|
18
|
-
##
|
|
19
|
-
|
|
20
|
-
The easiest way to use this MCP server is via npx - no installation required:
|
|
19
|
+
## 📦 Installation
|
|
21
20
|
|
|
21
|
+
### Via npx (Recommended for most clients)
|
|
22
|
+
No manual installation needed. Configure your MCP client to run:
|
|
22
23
|
```bash
|
|
23
24
|
npx @vheins/local-memory-mcp
|
|
24
25
|
```
|
|
25
26
|
|
|
26
|
-
## Installation
|
|
27
|
-
|
|
28
|
-
### Local Development
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
npm install
|
|
32
|
-
npm run build
|
|
33
|
-
```
|
|
34
|
-
|
|
35
27
|
### Global Install
|
|
36
|
-
|
|
37
28
|
```bash
|
|
38
29
|
npm install -g @vheins/local-memory-mcp
|
|
39
|
-
mcp-memory-local
|
|
40
30
|
```
|
|
41
31
|
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
This server works with any MCP-compatible client. Add it to your configuration:
|
|
45
|
-
|
|
46
|
-
### OpenCode
|
|
47
|
-
|
|
48
|
-
```json
|
|
49
|
-
{
|
|
50
|
-
"mcpServers": {
|
|
51
|
-
"local-memory": {
|
|
52
|
-
"command": "npx",
|
|
53
|
-
"args": ["@vheins/local-memory-mcp"]
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Claude Desktop (claude.ai)
|
|
60
|
-
|
|
61
|
-
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
62
|
-
|
|
63
|
-
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
{
|
|
67
|
-
"mcpServers": {
|
|
68
|
-
"local-memory": {
|
|
69
|
-
"command": "npx",
|
|
70
|
-
"args": ["@vheins/local-memory-mcp"]
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
32
|
+
## 🛠 Configuration
|
|
75
33
|
|
|
76
|
-
|
|
34
|
+
Add the server to your favorite MCP-compatible client (Cursor, Claude Desktop, Gemini CLI, etc.):
|
|
77
35
|
|
|
78
|
-
|
|
36
|
+
### Claude Desktop / Cursor / OpenCode
|
|
37
|
+
Add this to your `mcpServers` configuration:
|
|
79
38
|
|
|
80
39
|
```json
|
|
81
40
|
{
|
|
82
41
|
"mcpServers": {
|
|
83
42
|
"local-memory": {
|
|
84
43
|
"command": "npx",
|
|
85
|
-
"args": ["@vheins/local-memory-mcp"]
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Kiro Antigravity
|
|
92
|
-
|
|
93
|
-
Add to your MCP configuration file:
|
|
94
|
-
|
|
95
|
-
```json
|
|
96
|
-
{
|
|
97
|
-
"servers": {
|
|
98
|
-
"local-memory": {
|
|
99
|
-
"command": "npx",
|
|
100
|
-
"args": ["@vheins/local-memory-mcp"]
|
|
44
|
+
"args": ["-y", "@vheins/local-memory-mcp"]
|
|
101
45
|
}
|
|
102
46
|
}
|
|
103
47
|
}
|
|
104
48
|
```
|
|
105
49
|
|
|
106
|
-
### Trae
|
|
107
|
-
|
|
108
|
-
Settings → Integrations → MCP → Add Server
|
|
109
|
-
|
|
110
|
-
```json
|
|
111
|
-
{
|
|
112
|
-
"command": "npx",
|
|
113
|
-
"args": ["@vheins/local-memory-mcp"]
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
50
|
### Gemini CLI
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
gemini mcp add local-memory -- npx @vheins/local-memory-mcp
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### Codex
|
|
124
|
-
|
|
125
|
-
```json
|
|
126
|
-
{
|
|
127
|
-
"mcp_servers": {
|
|
128
|
-
"local-memory": {
|
|
129
|
-
"command": "npx",
|
|
130
|
-
"args": ["@vheins/local-memory-mcp"]
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### VS Code (with MCP extension)
|
|
137
|
-
|
|
138
|
-
```json
|
|
139
|
-
{
|
|
140
|
-
"mcpServers": {
|
|
141
|
-
"local-memory": {
|
|
142
|
-
"command": "npx",
|
|
143
|
-
"args": ["@vheins/local-memory-mcp"]
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Other MCP Clients
|
|
150
|
-
|
|
151
|
-
For any other MCP-compatible client, use:
|
|
152
|
-
|
|
153
|
-
- **Command**: `npx`
|
|
154
|
-
- **Args**: `["@vheins/local-memory-mcp"]`
|
|
155
|
-
|
|
156
|
-
Or build from source:
|
|
157
|
-
|
|
158
|
-
- **Command**: `node`
|
|
159
|
-
- **Args**: `["/path/to/dist/server.js"]`
|
|
160
|
-
|
|
161
|
-
## Usage
|
|
162
|
-
|
|
163
|
-
### MCP Server
|
|
164
|
-
|
|
165
|
-
The server runs as an MCP JSON-RPC server over stdin/stdout:
|
|
166
|
-
|
|
167
51
|
```bash
|
|
168
|
-
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### Web Dashboard
|
|
172
|
-
|
|
173
|
-
Start the web dashboard for managing memories:
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
npm run dashboard
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
Then open your browser to `http://localhost:3456`
|
|
180
|
-
|
|
181
|
-
The dashboard provides:
|
|
182
|
-
- Live memory visualization by repository
|
|
183
|
-
- Summary statistics and charts
|
|
184
|
-
- Memory browsing with sorting and filtering
|
|
185
|
-
- Edit and delete operations with confirmation
|
|
186
|
-
- Real-time MCP connection status
|
|
187
|
-
|
|
188
|
-
See [DASHBOARD.md](DASHBOARD.md) for detailed dashboard documentation.
|
|
189
|
-
|
|
190
|
-
### MCP Tools
|
|
191
|
-
|
|
192
|
-
#### memory.store
|
|
193
|
-
Store a new memory entry that affects future behavior.
|
|
194
|
-
|
|
195
|
-
```json
|
|
196
|
-
{
|
|
197
|
-
"type": "decision",
|
|
198
|
-
"content": "Do not use ORM; use raw SQL only for database access",
|
|
199
|
-
"importance": 5,
|
|
200
|
-
"scope": {
|
|
201
|
-
"repo": "backend-api",
|
|
202
|
-
"language": "typescript"
|
|
203
|
-
}
|
|
204
|
-
}
|
|
52
|
+
gemini mcp add local-memory -- npx -y @vheins/local-memory-mcp
|
|
205
53
|
```
|
|
206
54
|
|
|
207
|
-
|
|
208
|
-
Search for relevant memories in the current repository.
|
|
55
|
+
## 🧠 Instructions for AI Agents (The "Rules")
|
|
209
56
|
|
|
210
|
-
|
|
211
|
-
{
|
|
212
|
-
"query": "database orm",
|
|
213
|
-
"repo": "backend-api",
|
|
214
|
-
"limit": 5
|
|
215
|
-
}
|
|
216
|
-
```
|
|
57
|
+
To make this memory effective, agents should be instructed (via System Prompt or Custom Instructions) to follow these rules:
|
|
217
58
|
|
|
218
|
-
|
|
219
|
-
|
|
59
|
+
### 1. The "Start of Session" Rule
|
|
60
|
+
At the beginning of every new session or when entering a new repository, the agent **MUST**:
|
|
61
|
+
- Call `memory-recap` to see the most recent project context.
|
|
62
|
+
- Call `memory-search` with a query like "architectural rules" or "project patterns".
|
|
220
63
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"id": "uuid",
|
|
224
|
-
"content": "Updated content",
|
|
225
|
-
"importance": 4
|
|
226
|
-
}
|
|
227
|
-
```
|
|
64
|
+
### 2. The "Decision Logging" Rule
|
|
65
|
+
Whenever a significant technical decision is made (e.g., choosing a library, defining a folder structure, or setting a coding standard), the agent **MUST** call `memory-store` with `type: "decision"`.
|
|
228
66
|
|
|
229
|
-
|
|
230
|
-
|
|
67
|
+
### 3. The "Mistake Prevention" Rule
|
|
68
|
+
If an agent makes a mistake that takes time to debug, it **MUST** log it using `memory-store` with `type: "mistake"` to ensure it (or future agents) doesn't repeat it.
|
|
231
69
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
"repo": "backend-api",
|
|
235
|
-
"signals": [
|
|
236
|
-
"Uses raw SQL (no ORM)",
|
|
237
|
-
"Explicit DTO validation required"
|
|
238
|
-
]
|
|
239
|
-
}
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
#### memory.delete
|
|
243
|
-
Delete a memory entry (soft delete - removes from active use).
|
|
244
|
-
|
|
245
|
-
```json
|
|
246
|
-
{
|
|
247
|
-
"id": "uuid"
|
|
248
|
-
}
|
|
249
|
-
```
|
|
70
|
+
### 4. The "Fact Update" Rule
|
|
71
|
+
If a fundamental fact about the codebase changes, the agent should search for the old memory and use `memory-update` or `memory-delete`.
|
|
250
72
|
|
|
251
|
-
|
|
73
|
+
## 🔧 Tools Provided
|
|
252
74
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
- `
|
|
256
|
-
|
|
257
|
-
### MCP Prompts
|
|
258
|
-
|
|
259
|
-
- `memory-agent-core` - Core behavioral contract for memory-aware agents
|
|
260
|
-
- `memory-index-policy` - Enforce strict memory discipline
|
|
261
|
-
- `tool-usage-guidelines` - Prevent tool abuse
|
|
262
|
-
|
|
263
|
-
## Testing
|
|
264
|
-
|
|
265
|
-
Run the test suite:
|
|
266
|
-
|
|
267
|
-
```bash
|
|
268
|
-
./test.sh
|
|
269
|
-
```
|
|
75
|
+
### `memory-store`
|
|
76
|
+
Stores a new memory.
|
|
77
|
+
- **Parameters**: `type` (code_fact, decision, mistake, pattern), `title`, `content`, `importance` (1-5), `scope` (object with `repo`).
|
|
270
78
|
|
|
271
|
-
|
|
79
|
+
### `memory-search`
|
|
80
|
+
Searches for memories using semantic similarity.
|
|
81
|
+
- **Parameters**: `query`, `repo`, `limit`, `includeRecap` (boolean).
|
|
272
82
|
|
|
273
|
-
|
|
83
|
+
### `memory-recap`
|
|
84
|
+
Quickly gets the latest memories for a repository.
|
|
85
|
+
- **Parameters**: `repo`, `limit`.
|
|
274
86
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
- **
|
|
278
|
-
- **Vector Search Stub**: Semantic similarity (ready for embedding integration)
|
|
279
|
-
- **Tool Validation**: Strict schema validation with Zod
|
|
87
|
+
### `memory-summarize`
|
|
88
|
+
Updates the "Antigravity Summary" (High-level project rules).
|
|
89
|
+
- **Parameters**: `repo`, `signals` (array of strings).
|
|
280
90
|
|
|
281
|
-
|
|
91
|
+
### `memory-update` / `memory-delete`
|
|
92
|
+
Manage existing memory entries by ID.
|
|
282
93
|
|
|
283
|
-
|
|
94
|
+
## 📊 Web Dashboard
|
|
284
95
|
|
|
285
|
-
-
|
|
286
|
-
- `memory_summary` table: Antigravity summaries per repo
|
|
287
|
-
- Indexes on repo, type, and importance for fast queries
|
|
96
|
+
The service includes a built-in dashboard to help you manage your memories visually.
|
|
288
97
|
|
|
289
|
-
|
|
98
|
+
1. Run the dashboard:
|
|
99
|
+
```bash
|
|
100
|
+
npx @vheins/local-memory-mcp dashboard
|
|
101
|
+
```
|
|
102
|
+
2. Open `http://localhost:3456` in your browser.
|
|
290
103
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
104
|
+
Features:
|
|
105
|
+
- Filter memories by repository.
|
|
106
|
+
- Visualize memory distribution (Types & Importance).
|
|
107
|
+
- Quick search and edit functionality.
|
|
295
108
|
|
|
296
|
-
##
|
|
109
|
+
## ⚙️ Environment Variables
|
|
297
110
|
|
|
298
|
-
-
|
|
299
|
-
-
|
|
300
|
-
- [Server Skeleton & Contract](docs/SPEC-server.md)
|
|
301
|
-
- [Implementation Skeleton (Node.js)](docs/SPEC-skeleton.md)
|
|
302
|
-
- [Git / Project Scope Resolver](docs/SPEC-git-scope.md)
|
|
303
|
-
- [MCP Tool Schema & Validation](docs/SPEC-tool-schema.md)
|
|
304
|
-
- [SQLite Schema & Migration](docs/SPEC-sqlite-schema.md)
|
|
305
|
-
- [Vector Search Stub & Similarity Layer](docs/SPEC-vector-search.md)
|
|
306
|
-
- [Test Scenarios (Behavioral Contract)](docs/TEST-scenarios.md)
|
|
307
|
-
- [Agent System Prompt](docs/PROMPT-agent.md)
|
|
111
|
+
- `MEMORY_DB_PATH`: Custom path for the SQLite database file (default: `./storage/memory.db`).
|
|
112
|
+
- `PORT`: Port for the Web Dashboard (default: `3456`).
|
|
308
113
|
|
|
309
|
-
## License
|
|
114
|
+
## 📄 License
|
|
310
115
|
|
|
311
|
-
MIT
|
|
116
|
+
MIT © Muhammad Rheza Alfin
|