@vheins/local-memory-mcp 0.1.10 → 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.
Files changed (2) hide show
  1. package/README.md +64 -259
  2. package/package.json +9 -1
package/README.md CHANGED
@@ -1,311 +1,116 @@
1
- # MCP Local Memory Service
1
+ # @vheins/local-memory-mcp
2
2
 
3
- An MCP (Model Context Protocol) service that provides long-term memory for AI coding agents, with a web-based dashboard for visualization and management.
3
+ [![npm version](https://img.shields.io/npm/v/@vheins/local-memory-mcp.svg)](https://www.npmjs.com/package/@vheins/local-memory-mcp)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
5
 
5
- ## Overview
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
- This project implements a local memory service using Node.js and SQLite with vector similarity search capabilities. It solves the context loss problem in coding assistants by storing code facts, decisions, mistakes, and patterns.
8
+ Includes a **Web Dashboard** for easy management and visualization of stored memories.
8
9
 
9
- ## Features
10
+ ## 🚀 Key Features
10
11
 
11
- - **Long-term Memory Storage**: Store decisions, code facts, mistakes, and patterns
12
- - **Semantic Search**: Vector-based similarity search (with keyword fallback)
13
- - **Git Scope Isolation**: Memories are scoped per repository to prevent cross-project contamination
14
- - **Antigravity Summaries**: High-level project summaries to guide agent behavior
15
- - **MCP Protocol**: Full implementation of MCP resources, tools, and prompts
16
- - **Web Dashboard**: Browser-based UI for visualizing and managing memories
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
- ## Quick Start (npx)
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
- ## MCP Client Configuration
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
- ### Cursor
34
+ Add the server to your favorite MCP-compatible client (Cursor, Claude Desktop, Gemini CLI, etc.):
77
35
 
78
- Settings Features Models "Edit JSON"
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
- node dist/server.js
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
- #### memory.search
208
- Search for relevant memories in the current repository.
55
+ ## 🧠 Instructions for AI Agents (The "Rules")
209
56
 
210
- ```json
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
- #### memory.update
219
- Update an existing memory entry.
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
- ```json
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
- #### memory.summarize
230
- Update the antigravity summary for a repository.
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
- ```json
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
- ### MCP Resources
73
+ ## 🔧 Tools Provided
252
74
 
253
- - `memory://index` - Recent memory entries (metadata only)
254
- - `memory://{id}` - Read individual memory entry
255
- - `memory://summary/{repo}` - Project summary
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
- ## Architecture
79
+ ### `memory-search`
80
+ Searches for memories using semantic similarity.
81
+ - **Parameters**: `query`, `repo`, `limit`, `includeRecap` (boolean).
272
82
 
273
- The implementation follows the documented specifications in the `docs/` folder:
83
+ ### `memory-recap`
84
+ Quickly gets the latest memories for a repository.
85
+ - **Parameters**: `repo`, `limit`.
274
86
 
275
- - **MCP Server Loop**: JSON-RPC protocol handler
276
- - **Git Scope Resolver**: Determines active repository
277
- - **SQLite Storage**: Primary data store with indexes
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
- ## Storage
91
+ ### `memory-update` / `memory-delete`
92
+ Manage existing memory entries by ID.
282
93
 
283
- Memory is stored in `storage/memory.db` using SQLite with the following schema:
94
+ ## 📊 Web Dashboard
284
95
 
285
- - `memories` table: All memory entries with repo scoping
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
- ## Memory Types
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
- 1. **code_fact**: Stable facts about the codebase
292
- 2. **decision**: Design or architectural decisions
293
- 3. **mistake**: Errors that should not be repeated
294
- 4. **pattern**: Recurring implementation patterns
104
+ Features:
105
+ - Filter memories by repository.
106
+ - Visualize memory distribution (Types & Importance).
107
+ - Quick search and edit functionality.
295
108
 
296
- ## Documentation
109
+ ## ⚙️ Environment Variables
297
110
 
298
- - [Product Requirements Document (PRD)](docs/PRD.md)
299
- - [Auto-Memory Heuristics & Scoping](docs/SPEC-heuristics.md)
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vheins/local-memory-mcp",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "MCP Local Memory Service for coding copilot agents",
5
5
  "mcpName": "io.github.vheins/local-memory-mcp",
6
6
  "type": "module",
@@ -14,6 +14,14 @@
14
14
  "dist",
15
15
  "storage/.gitkeep"
16
16
  ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/vheins/local-memory-mcp.git"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/vheins/local-memory-mcp/issues"
23
+ },
24
+ "homepage": "https://github.com/vheins/local-memory-mcp#readme",
17
25
  "author": "Muhammad Rheza Alfin <m.rheza.alfin@gmail.com>",
18
26
  "license": "MIT",
19
27
  "scripts": {