@sharkdyt/omni-memory-mcp 1.0.5 → 1.0.6

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,348 +1,349 @@
1
- # Omni Memory MCP
2
-
3
- Universal memory MCP server for multi-agent workflows.
4
- 100% local with SQLite + FTS5.
5
-
6
- ## npm Package
7
-
8
- - Package: `@sharkdyt/omni-memory-mcp`
9
- - npm: `https://www.npmjs.com/package/@sharkdyt/omni-memory-mcp`
10
- - Current `latest`: `1.0.5`
11
-
12
- ## Project Memory
13
-
14
- This project does not keep local `memory-bank/` files.
15
- Operational context is stored through Omni Memory itself.
16
-
17
- ## Why this exists
18
-
19
- - Keep AI memory local (no cloud dependency)
20
- - Reuse the same memory across tools/agents
21
- - Search fast with SQLite FTS5
22
-
23
- ## Features
24
-
1
+ # Omni Memory MCP
2
+
3
+ Universal memory MCP server for multi-agent workflows.
4
+ 100% local with SQLite + FTS5.
5
+
6
+ ## npm Package
7
+
8
+ - Package: `@sharkdyt/omni-memory-mcp`
9
+ - npm: `https://www.npmjs.com/package/@sharkdyt/omni-memory-mcp`
10
+ - Current `latest`: `1.0.6`
11
+
12
+ ## Project Memory
13
+
14
+ This project does not keep local `memory-bank/` files.
15
+ Operational context is stored through Omni Memory itself.
16
+
17
+ ## Why this exists
18
+
19
+ - Keep AI memory local (no cloud dependency)
20
+ - Reuse the same memory across tools/agents
21
+ - Search fast with SQLite FTS5
22
+
23
+ ## Features
24
+
25
25
  - Local-first storage (SQLite)
26
26
  - Full-text search with FTS5
27
27
  - MCP-native tools
28
- - **Progressive Disclosure:** Searches return metadata and summaries instead of full text to prevent LLM context overflow.
29
- - **Active Forgetting Tracking:** Read actions (`memory_get`) increment `access_count` and update `accessed_at`.
30
28
  - CRUD operations (`memory_add`, `memory_get`, `memory_update`, `memory_delete`, `memory_list`, `memory_search`)
31
- - Context optimization tools (`memory_prune`)
29
+ - Canonical memory writes with `memory_upsert`
32
30
  - Diagnostic tools (`memory_stats`)
33
31
  - Organization by `area`, `project`, and `tags`
34
- - Shared long-term memory across multiple projects and multiple coding agents/clients
35
- - Canonical MCP config + client adapters (OpenCode, Codex, Cursor)
36
-
37
- ## Cross-Client MCP Standard
38
-
39
- This project keeps one canonical MCP config and generates client-specific files.
40
-
41
- Canonical source:
42
-
43
- - `config/mcp/servers.json`
44
-
45
- Generate adapters:
46
-
47
- ```bash
48
- npm run mcp:generate
49
- ```
50
-
51
- Validate adapters:
52
-
53
- ```bash
54
- npm run mcp:validate
55
- ```
56
-
57
- Generated files:
58
-
59
- - `config/mcp/generated/opencode.windows.json`
60
- - `config/mcp/generated/opencode.posix.json`
61
- - `config/mcp/generated/opencode.windows.array.npx.json`
62
- - `config/mcp/generated/opencode.windows.string-args.npx.json`
63
- - `config/mcp/generated/opencode.windows.array.fallback-dist.json`
64
- - `config/mcp/generated/opencode.posix.array.npx.json`
65
- - `config/mcp/generated/opencode.posix.string-args.npx.json`
66
- - `config/mcp/generated/opencode.posix.array.fallback-dist.json`
67
- - `config/mcp/generated/codex.windows.json`
68
- - `config/mcp/generated/codex.posix.json`
69
- - `config/mcp/generated/cursor.windows.json`
70
- - `config/mcp/generated/cursor.posix.json`
71
-
72
- Compatibility matrix:
73
-
74
- - `docs/mcp-compatibility-matrix.md`
75
-
76
- ## Quick Start (Most Newbie Friendly)
77
-
78
- If your MCP client supports `command` + `args` + `env`, use:
79
-
80
- ```json
81
- {
82
- "mcpServers": {
83
- "omni-memory": {
84
- "command": "npx",
85
- "args": ["-y", "@sharkdyt/omni-memory-mcp"],
86
- "env": {
87
- "OMNI_MEMORY_DIR": "~/.omni-memory"
88
- }
89
- }
90
- }
91
- }
92
- ```
93
-
94
- This is the easiest setup because:
95
- - No manual clone path
96
- - No manual build path
97
- - Works after npm registry publish
98
-
99
- ### OpenCode compatibility profiles
100
-
101
- OpenCode support can vary by client version and environment.
102
- This repository now generates three OpenCode profiles for each platform:
103
-
104
- - `array.npx`: `command` as array (`["npx","-y","@sharkdyt/omni-memory-mcp"]`)
105
- - `string-args.npx`: `command` as string + `args`
106
- - `array.fallback-dist`: shell command that tries `npx` and falls back to local `dist/index.js`
107
-
108
- Recommended default for OpenCode:
109
-
110
- - `config/mcp/generated/opencode.<platform>.json` (this points to `array.fallback-dist`)
111
-
112
- If you prefer explicit profile selection, copy one of:
113
-
114
- - `config/mcp/generated/opencode.<platform>.array.npx.json`
115
- - `config/mcp/generated/opencode.<platform>.string-args.npx.json`
116
- - `config/mcp/generated/opencode.<platform>.array.fallback-dist.json`
117
-
118
- ## Path Guide (Relative vs Absolute)
119
-
120
- If you prefer running from local source (`dist/index.js`), use an **absolute path**.
121
-
122
- - Relative path example (can break): `./dist/index.js`
123
- - Absolute path example (recommended): full path to file on disk
124
-
125
- Why relative paths break:
126
- - Many MCP clients resolve paths from their own process working directory, not from your config file directory.
127
-
128
- ### Absolute path examples
129
-
130
- Linux:
131
-
132
- ```json
133
- {
134
- "command": "node",
135
- "args": ["/home/your-user/.local/mcp/omni-memory-mcp/dist/index.js"]
136
- }
137
- ```
138
-
139
- macOS:
140
-
141
- ```json
142
- {
143
- "command": "node",
144
- "args": ["/Users/your-user/.local/mcp/omni-memory-mcp/dist/index.js"]
145
- }
146
- ```
147
-
148
- Windows:
149
-
150
- ```json
151
- {
152
- "command": "node",
153
- "args": ["C:\\Users\\your-user\\.local\\mcp\\omni-memory-mcp\\dist\\index.js"]
154
- }
155
- ```
156
-
157
- Note:
158
- - `~` is convenient, but not every client expands it consistently on Windows. Absolute paths are safer.
159
-
160
- ## Install from Source (Local Dev)
161
-
162
- ```bash
163
- git clone https://github.com/allanschramm/omni-memory-mcp.git
164
- cd omni-memory-mcp
165
- npm install
166
- npm run build
167
- ```
168
-
169
- Then configure your MCP client with `node` + absolute path to `dist/index.js`.
170
-
171
- ## OpenCode / Codex / Cursor
172
-
173
- Instead of writing each config by hand, generate client-specific adapters:
174
-
175
- ```bash
176
- npm run mcp:generate
177
- ```
178
-
179
- Then copy the generated file for your client/platform from `config/mcp/generated/`.
180
-
181
- ### OpenCode troubleshooting priority
182
-
183
- 1. Use `opencode.<platform>.json` first (default fallback profile).
184
- 2. If your OpenCode build prefers native `npx` only, try `opencode.<platform>.array.npx.json`.
185
- 3. If your OpenCode build requires `command` string + `args`, use `opencode.<platform>.string-args.npx.json`.
186
-
187
- ## Tools
188
-
32
+ - Shared long-term memory across multiple projects and multiple coding agents/clients
33
+ - Canonical MCP config + client adapters (OpenCode, Codex, Cursor)
34
+
35
+ ## Cross-Client MCP Standard
36
+
37
+ This project keeps one canonical MCP config and generates client-specific files.
38
+
39
+ Canonical source:
40
+
41
+ - `config/mcp/servers.json`
42
+
43
+ Generate adapters:
44
+
45
+ ```bash
46
+ npm run mcp:generate
47
+ ```
48
+
49
+ Validate adapters:
50
+
51
+ ```bash
52
+ npm run mcp:validate
53
+ ```
54
+
55
+ Generated files:
56
+
57
+ - `config/mcp/generated/opencode.windows.json`
58
+ - `config/mcp/generated/opencode.posix.json`
59
+ - `config/mcp/generated/opencode.windows.array.npx.json`
60
+ - `config/mcp/generated/opencode.windows.string-args.npx.json`
61
+ - `config/mcp/generated/opencode.windows.array.fallback-dist.json`
62
+ - `config/mcp/generated/opencode.posix.array.npx.json`
63
+ - `config/mcp/generated/opencode.posix.string-args.npx.json`
64
+ - `config/mcp/generated/opencode.posix.array.fallback-dist.json`
65
+ - `config/mcp/generated/codex.windows.json`
66
+ - `config/mcp/generated/codex.posix.json`
67
+ - `config/mcp/generated/cursor.windows.json`
68
+ - `config/mcp/generated/cursor.posix.json`
69
+
70
+ Compatibility matrix:
71
+
72
+ - `docs/mcp-compatibility-matrix.md`
73
+
74
+ ## Quick Start (Most Newbie Friendly)
75
+
76
+ If your MCP client supports `command` + `args` + `env`, use:
77
+
78
+ ```json
79
+ {
80
+ "mcpServers": {
81
+ "omni-memory": {
82
+ "command": "npx",
83
+ "args": ["-y", "@sharkdyt/omni-memory-mcp"],
84
+ "env": {
85
+ "OMNI_MEMORY_DIR": "~/.omni-memory"
86
+ }
87
+ }
88
+ }
89
+ }
90
+ ```
91
+
92
+ This is the easiest setup because:
93
+ - No manual clone path
94
+ - No manual build path
95
+ - Works after npm registry publish
96
+
97
+ ### OpenCode compatibility profiles
98
+
99
+ OpenCode support can vary by client version and environment.
100
+ This repository now generates three OpenCode profiles for each platform:
101
+
102
+ - `array.npx`: `command` as array (`["npx","-y","@sharkdyt/omni-memory-mcp"]`)
103
+ - `string-args.npx`: `command` as string + `args`
104
+ - `array.fallback-dist`: shell command that tries `npx` and falls back to local `dist/index.js`
105
+
106
+ Recommended default for OpenCode:
107
+
108
+ - `config/mcp/generated/opencode.<platform>.json` (this points to `array.fallback-dist`)
109
+
110
+ If you prefer explicit profile selection, copy one of:
111
+
112
+ - `config/mcp/generated/opencode.<platform>.array.npx.json`
113
+ - `config/mcp/generated/opencode.<platform>.string-args.npx.json`
114
+ - `config/mcp/generated/opencode.<platform>.array.fallback-dist.json`
115
+
116
+ ## Path Guide (Relative vs Absolute)
117
+
118
+ If you prefer running from local source (`dist/index.js`), use an **absolute path**.
119
+
120
+ - Relative path example (can break): `./dist/index.js`
121
+ - Absolute path example (recommended): full path to file on disk
122
+
123
+ Why relative paths break:
124
+ - Many MCP clients resolve paths from their own process working directory, not from your config file directory.
125
+
126
+ ### Absolute path examples
127
+
128
+ Linux:
129
+
130
+ ```json
131
+ {
132
+ "command": "node",
133
+ "args": ["/home/your-user/.local/mcp/omni-memory-mcp/dist/index.js"]
134
+ }
135
+ ```
136
+
137
+ macOS:
138
+
139
+ ```json
140
+ {
141
+ "command": "node",
142
+ "args": ["/Users/your-user/.local/mcp/omni-memory-mcp/dist/index.js"]
143
+ }
144
+ ```
145
+
146
+ Windows:
147
+
148
+ ```json
149
+ {
150
+ "command": "node",
151
+ "args": ["C:\\Users\\your-user\\.local\\mcp\\omni-memory-mcp\\dist\\index.js"]
152
+ }
153
+ ```
154
+
155
+ Note:
156
+ - `~` is convenient, but not every client expands it consistently on Windows. Absolute paths are safer.
157
+
158
+ ## Install from Source (Local Dev)
159
+
160
+ ```bash
161
+ git clone https://github.com/allanschramm/omni-memory-mcp.git
162
+ cd omni-memory-mcp
163
+ npm install
164
+ npm run build
165
+ ```
166
+
167
+ Then configure your MCP client with `node` + absolute path to `dist/index.js`.
168
+
169
+ ## OpenCode / Codex / Cursor
170
+
171
+ Instead of writing each config by hand, generate client-specific adapters:
172
+
173
+ ```bash
174
+ npm run mcp:generate
175
+ ```
176
+
177
+ Then copy the generated file for your client/platform from `config/mcp/generated/`.
178
+
179
+ ### OpenCode troubleshooting priority
180
+
181
+ 1. Use `opencode.<platform>.json` first (default fallback profile).
182
+ 2. If your OpenCode build prefers native `npx` only, try `opencode.<platform>.array.npx.json`.
183
+ 3. If your OpenCode build requires `command` string + `args`, use `opencode.<platform>.string-args.npx.json`.
184
+
185
+ ## Tools
186
+
189
187
  ### `memory_add`
190
188
 
191
- ```json
192
- {
193
- "name": "User typescript preferences",
194
- "content": "User prefers TypeScript with strict mode",
195
- "area": "preferences",
196
- "project": "my-project",
197
- "tags": ["typescript", "coding-style"],
198
- "metadata": {
199
- "source": "conversation setup"
200
- }
201
- }
202
- ```
203
-
204
- ### `memory_get`
205
-
206
- *Note: Fetching a memory via `memory_get` registers an access (increments `access_count` and updates `accessed_at`), indicating the memory is actively used.*
207
-
208
- ```json
209
- {
210
- "id": "abc123"
211
- }
212
- ```
213
-
214
- ### `memory_update`
215
-
216
- ```json
217
- {
218
- "id": "abc123",
219
- "name": "Updated typescript preferences",
220
- "content": "Updated content",
221
- "tags": ["new-tag"]
222
- }
223
- ```
224
-
225
- ### `memory_delete`
189
+ Use `memory_add` for append-only notes that should always create a new record.
226
190
 
227
191
  ```json
228
192
  {
229
- "id": "abc123"
193
+ "content": "User prefers TypeScript with strict mode",
194
+ "area": "preferences",
195
+ "project": "my-project",
196
+ "tags": ["typescript", "coding-style"]
230
197
  }
231
198
  ```
232
199
 
233
- ### `memory_list`
200
+ ### `memory_upsert`
234
201
 
235
- *Note: Enforces Progressive Disclosure. It returns only IDs, Names, and metadata. You must call `memory_get` with the specific ID to read the full content.*
202
+ Use `memory_upsert` when agents should converge on one canonical memory instead of creating duplicates.
236
203
 
237
204
  ```json
238
205
  {
239
- "area": "snippets",
240
- "project": "my-project",
241
- "tag": "important",
242
- "limit": 20
206
+ "content": "Repository standard: prefer exact Zod schemas for MCP tools",
207
+ "name": "repo-tooling-standard",
208
+ "project": "omni-memory-mcp",
209
+ "area": "preferences",
210
+ "tags": ["mcp", "zod"]
243
211
  }
244
212
  ```
245
213
 
246
- ### `memory_search`
247
-
248
- *Note: Enforces Progressive Disclosure. It returns only IDs, Names, and metadata. You must call `memory_get` with the specific ID to read the full content.*
214
+ Follow-up updates can reuse the same canonical slot:
249
215
 
250
216
  ```json
251
217
  {
252
- "query": "typescript configuration",
253
- "project": "my-project",
254
- "limit": 10,
255
- "enableAdvancedSyntax": false
218
+ "content": "Repository standard: prefer exact Zod schemas and concise tool text responses",
219
+ "match_name": "repo-tooling-standard",
220
+ "project": "omni-memory-mcp"
256
221
  }
257
222
  ```
258
-
259
- *Note: `enableAdvancedSyntax` allows FTS5 boolean logic (e.g. `"typescript" AND "react" NOT "vue"`) but requires a strictly valid FTS5 query or it will throw an error.*
260
-
223
+
224
+ ### `memory_get`
225
+
226
+ ```json
227
+ {
228
+ "id": "abc123"
229
+ }
230
+ ```
231
+
232
+ ### `memory_update`
233
+
234
+ ```json
235
+ {
236
+ "id": "abc123",
237
+ "content": "Updated content",
238
+ "tags": ["new-tag"]
239
+ }
240
+ ```
241
+
242
+ ### `memory_delete`
243
+
244
+ ```json
245
+ {
246
+ "id": "abc123"
247
+ }
248
+ ```
249
+
250
+ ### `memory_list`
251
+
252
+ ```json
253
+ {
254
+ "area": "snippets",
255
+ "project": "my-project",
256
+ "tag": "important",
257
+ "limit": 20
258
+ }
259
+ ```
260
+
261
+ ### `memory_search`
262
+
263
+ ```json
264
+ {
265
+ "query": "typescript configuration",
266
+ "project": "my-project",
267
+ "limit": 10,
268
+ "enableAdvancedSyntax": false
269
+ }
270
+ ```
271
+
272
+ *Note: `enableAdvancedSyntax` allows FTS5 boolean logic (e.g. `"typescript" AND "react" NOT "vue"`) but requires a strictly valid FTS5 query or it will throw an error.*
273
+
261
274
  ### `memory_stats`
262
275
 
263
276
  ```json
264
277
  {}
265
278
  ```
266
- *Returns total memories, size on disk, and breakdown by project and area.*
267
-
268
- ### `memory_prune`
269
-
270
- *Note: Cleans up memories that have decayed below a specific score dynamically calculated based on `created_at`, `accessed_at`, and `access_count`.*
271
-
272
- ```json
273
- {
274
- "threshold_score": 0,
275
- "dry_run": true
276
- }
277
- ```
278
- *Always use `dry_run: true` first to see how many and which memories would be pruned before running the destructible cleanup.*
279
-
280
- ## Memory Areas
281
-
282
- | Area | Description |
283
- | --- | --- |
284
- | `general` | General notes |
285
- | `snippets` | Code snippets and patterns |
286
- | `solutions` | Problem-solution pairs |
287
- | `preferences` | User/team preferences |
288
-
289
- ## Data Storage
290
-
291
- Default directory:
292
-
293
- ```text
294
- ~/.omni-memory/
295
- |- omni-memory.db
296
- |- omni-memory.db-wal
297
- `- omni-memory.db-shm
298
- ```
299
-
300
- Environment variables:
301
-
302
- | Variable | Default | Description |
303
- | --- | --- | --- |
304
- | `OMNI_MEMORY_DIR` | `~/.omni-memory` | Data storage directory |
305
- | `OMNI_MEMORY_DB` | `{OMNI_MEMORY_DIR}/omni-memory.db` | SQLite DB file path |
306
-
307
- ## Development
308
-
309
- ```bash
310
- npm install
311
- npm run check
312
- npm run build
313
- npm test
314
- ```
315
-
316
- Extra commands:
317
-
318
- ```bash
319
- npm run dev # watch mode
320
- npm run start # run server from dist/
321
- ```
322
-
323
- ## Documentation and Memory Hygiene
324
-
325
- For every meaningful project change, keep both sources of truth updated:
326
-
327
- 1. Repository docs (`README.md`, `docs/*`, compatibility/config docs) must reflect current behavior.
328
- 2. Omni Memory must receive a concise project memory entry with:
329
- - what changed,
330
- - why it changed,
331
- - constraints/assumptions,
332
- - next steps (if any).
333
-
334
- Minimum release/update gate:
335
-
336
- 1. `npm run mcp:generate`
337
- 2. `npm run mcp:validate`
338
- 3. `npm run check`
339
- 4. Update docs for any behavior/config change
340
- 5. Add/update important project memory in Omni Memory
341
-
342
- Operational checklist:
343
-
344
- - `docs/release-checklist.md`
345
-
346
- ## License
347
-
348
- Apache 2.0. See `LICENSE`.
279
+ *Returns total memories, size on disk, breakdown by project and area, plus local upsert metrics such as `memory_upsert_created` and `memory_upsert_updated`.*
280
+
281
+ ## Memory Areas
282
+
283
+ | Area | Description |
284
+ | --- | --- |
285
+ | `general` | General notes |
286
+ | `snippets` | Code snippets and patterns |
287
+ | `solutions` | Problem-solution pairs |
288
+ | `preferences` | User/team preferences |
289
+
290
+ ## Data Storage
291
+
292
+ Default directory:
293
+
294
+ ```text
295
+ ~/.omni-memory/
296
+ |- omni-memory.db
297
+ |- omni-memory.db-wal
298
+ `- omni-memory.db-shm
299
+ ```
300
+
301
+ Environment variables:
302
+
303
+ | Variable | Default | Description |
304
+ | --- | --- | --- |
305
+ | `OMNI_MEMORY_DIR` | `~/.omni-memory` | Data storage directory |
306
+ | `OMNI_MEMORY_DB` | `{OMNI_MEMORY_DIR}/omni-memory.db` | SQLite DB file path |
307
+
308
+ ## Development
309
+
310
+ ```bash
311
+ npm install
312
+ npm run check
313
+ npm run build
314
+ npm test
315
+ ```
316
+
317
+ Extra commands:
318
+
319
+ ```bash
320
+ npm run dev # watch mode
321
+ npm run start # run server from dist/
322
+ ```
323
+
324
+ ## Documentation and Memory Hygiene
325
+
326
+ For every meaningful project change, keep both sources of truth updated:
327
+
328
+ 1. Repository docs (`README.md`, `docs/*`, compatibility/config docs) must reflect current behavior.
329
+ 2. Omni Memory must receive a concise project memory entry with:
330
+ - what changed,
331
+ - why it changed,
332
+ - constraints/assumptions,
333
+ - next steps (if any).
334
+
335
+ Minimum release/update gate:
336
+
337
+ 1. `npm run mcp:generate`
338
+ 2. `npm run mcp:validate`
339
+ 3. `npm run check`
340
+ 4. Update docs for any behavior/config change
341
+ 5. Add/update important project memory in Omni Memory
342
+
343
+ Operational checklist:
344
+
345
+ - `docs/release-checklist.md`
346
+
347
+ ## License
348
+
349
+ Apache 2.0. See `LICENSE`.