mcp-memory-bucket 0.2.1 → 0.3.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 +86 -13
- package/dist/client/assets/{index-CU-hoVvq.js → index-DIO48C0V.js} +214 -115
- package/dist/client/index.html +1 -1
- package/dist/src/memory/repository.js +117 -0
- package/dist/src/memory/tools.js +52 -0
- package/dist/src/server.js +3 -1
- package/dist/src/shared/relocate-tool.js +32 -18
- package/dist/src/shared/relocate.js +9 -0
- package/dist/src/shared/search-tool.js +18 -0
- package/dist/src/skills/builtin/memory-bucket-authoring/SKILL.md +423 -7
- package/dist/src/skills/repository.js +129 -0
- package/dist/src/skills/tools.js +71 -0
- package/dist/src/store/db.js +21 -8
- package/dist/src/store/search.js +60 -0
- package/dist/src/store/sync.js +6 -2
- package/dist/src/web/routes.js +98 -4
- package/dist/src/web/ui-tool.js +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -16,8 +16,52 @@ this server. See
|
|
|
16
16
|
[skill-bucket-v0-plan.md](../../skill-bucket-v0-plan.md) at the workspace
|
|
17
17
|
root for the full design plan.
|
|
18
18
|
|
|
19
|
+
## Example uses
|
|
20
|
+
|
|
21
|
+
A few illustrative scenarios (not transcripts of real sessions):
|
|
22
|
+
|
|
23
|
+
**Saving a reusable pattern as a skill.** After pairing on a Lit dropdown
|
|
24
|
+
component with keyboard navigation and ARIA roles, you tell the agent
|
|
25
|
+
"save this as a skill for next time." It calls `skill_create` with a
|
|
26
|
+
description covering both what the pattern does and when to use it, so
|
|
27
|
+
future sessions can discover it by keyword.
|
|
28
|
+
|
|
29
|
+
**Capturing a plan before a big refactor.** Before starting a multi-day
|
|
30
|
+
migration, you ask the agent to write out its plan and save it under the
|
|
31
|
+
ticket key: `memory_create(key: "RMXS-142", doc_type: "plan", ...)`. Later
|
|
32
|
+
sessions on the same ticket call `memory_get("RMXS-142")` to pick up
|
|
33
|
+
exactly where the last one left off, without you re-explaining context.
|
|
34
|
+
|
|
35
|
+
**Triaging a year-old bucket.** A memory bucket that's accumulated docs
|
|
36
|
+
for a year has a lot of dead weight. Sorting the web UI by "Oldest first"
|
|
37
|
+
surfaces the stalest entries; selecting a batch and clicking "Mark
|
|
38
|
+
deprecated" flags them without losing their original `status`, and a
|
|
39
|
+
follow-up "Delete" (after a confirm dialog) clears out the ones nobody
|
|
40
|
+
needs. The same triage works from an agent via `memory_bulk_update(ids,
|
|
41
|
+
{ deprecated: true })` followed by `memory_bulk_delete`.
|
|
42
|
+
|
|
43
|
+
**Bulk-tagging after a search.** "Find every skill about deploys and mark
|
|
44
|
+
the outdated ones deprecated" becomes `skill_search("deploy")` to find
|
|
45
|
+
candidates, then `skill_bulk_update(names, { deprecated: true })` to flag
|
|
46
|
+
the stale ones in one call — no need to touch each file individually.
|
|
47
|
+
|
|
19
48
|
## Run
|
|
20
49
|
|
|
50
|
+
### Via npx
|
|
51
|
+
|
|
52
|
+
No install needed — runs the published package directly:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npx mcp-memory-bucket
|
|
56
|
+
# or, with the flags described below:
|
|
57
|
+
npx mcp-memory-bucket --memory-dir /path/to/dir
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This is the simplest way to point an MCP client at a memory bucket
|
|
61
|
+
without cloning this repo.
|
|
62
|
+
|
|
63
|
+
### From source
|
|
64
|
+
|
|
21
65
|
```sh
|
|
22
66
|
npm install
|
|
23
67
|
npm run build
|
|
@@ -29,21 +73,50 @@ Starts a stateless StreamableHTTP MCP server at `http://localhost:8767/mcp`
|
|
|
29
73
|
the SQLite cache is kept current by a file watcher for as long as the
|
|
30
74
|
server runs.
|
|
31
75
|
|
|
76
|
+
### How the cache stays fresh
|
|
77
|
+
|
|
78
|
+
The cache is a single SQLite file, `.memory-bucket-cache.sqlite`, written
|
|
79
|
+
next to `memory-bucket.config.json` in the base directory (cwd by default,
|
|
80
|
+
or `MEMORY_BUCKET_DIR`/`--memory-dir` — see Configuration below). It's a
|
|
81
|
+
scan cache, not the source of truth — the markdown files on disk always
|
|
82
|
+
are, and the cache can be safely deleted; it's rebuilt on next startup.
|
|
83
|
+
|
|
84
|
+
- **On startup**, every configured root is fully walked and each file is
|
|
85
|
+
upserted into the cache, keyed by mtime — a file whose mtime hasn't
|
|
86
|
+
changed since it was last cached is skipped, so restarting is cheap
|
|
87
|
+
even with a large root.
|
|
88
|
+
- **While running**, each root is watched (via `chokidar`) for `add`,
|
|
89
|
+
`change`, and `unlink` events on matching files, and the cache is
|
|
90
|
+
updated incrementally as they happen — no polling, no manual reindex.
|
|
91
|
+
Only `SKILL.md` files count for skill roots; any `.md` file counts for
|
|
92
|
+
memory roots. The watcher only looks 10 directories deep. A rename
|
|
93
|
+
arrives as a delete-then-add, not a single rename event.
|
|
94
|
+
- **Adding a root** (via the web UI, or a `skill_sources`/`memory_sources`
|
|
95
|
+
entry present at startup) triggers a scan of just that root, not a
|
|
96
|
+
full rescan of every root already cached.
|
|
97
|
+
- **Removing a root** (via the web UI) drops its rows from the cache and
|
|
98
|
+
search index immediately — it never touches files on disk.
|
|
99
|
+
|
|
32
100
|
The same process also serves a browser UI at `http://localhost:8767/` for
|
|
33
101
|
searching/filtering skills and memory docs by tag, root, status, owner,
|
|
34
|
-
and fulltext (SQLite FTS5)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
102
|
+
deprecated flag, and fulltext (SQLite FTS5), and sorting by creation date
|
|
103
|
+
or last-touched — a way to review and clean up what's in the index
|
|
104
|
+
without going through an agent. It also manages **roots**: add a skill or
|
|
105
|
+
memory root by browsing the filesystem, or remove one (unregisters it and
|
|
106
|
+
drops its cached rows — never deletes files on disk). Beyond browsing,
|
|
107
|
+
the UI supports marking entries **deprecated** (independent of `status`,
|
|
108
|
+
so you don't lose "shipped"/"active" context when flagging something
|
|
109
|
+
stale) and **deleting** entries — both single-item and multi-select bulk,
|
|
110
|
+
with a confirm dialog before any delete. Deeper edits (renaming, editing
|
|
111
|
+
body content, changing tags) still go through the `skill_*`/`memory_*`
|
|
112
|
+
tools or the files directly. From an MCP session connected to this
|
|
113
|
+
server, call `bucket_open_ui` to get the URL. If no roots are configured
|
|
114
|
+
yet, the UI opens straight into a first-run "add your first root" screen.
|
|
115
|
+
The UI is a Lit + `avosignals` app built with Vite (`src/client/`,
|
|
116
|
+
bundled to `dist/client/`) — `npm run build` builds it (along with the
|
|
117
|
+
server); `npm start` does **not** rebuild it, so run `npm run build`
|
|
118
|
+
again after changing anything under `src/client/`. `npm run dev` rebuilds
|
|
119
|
+
the client on change alongside the server, for active UI development.
|
|
47
120
|
|
|
48
121
|
### Configuration
|
|
49
122
|
|