mcp-memory-bucket 0.12.0 → 0.12.2
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/bin/mcp-memory-bucket.js +13 -1
- package/dist/src/remote/remote-sync.js +10 -1
- package/dist/src/server.js +7 -0
- package/package.json +2 -1
package/bin/mcp-memory-bucket.js
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
if (process.argv[2] === 'stop') {
|
|
3
|
+
const { execSync } = await import('node:child_process');
|
|
4
|
+
const port = process.env.PORT || 8767;
|
|
5
|
+
try {
|
|
6
|
+
execSync(`kill -9 $(lsof -ti :${port})`, { stdio: 'ignore' });
|
|
7
|
+
console.error(`[mcp-memory-bucket] stopped server on port ${port}`);
|
|
8
|
+
} catch {
|
|
9
|
+
console.error(`[mcp-memory-bucket] no server running on port ${port}`);
|
|
10
|
+
}
|
|
11
|
+
process.exit(0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
await import('../dist/src/server.js');
|
|
@@ -196,7 +196,16 @@ async function pullFile(db, spec, folder, credentialsBaseDir, changedFile) {
|
|
|
196
196
|
// converted to mirror-relative before joining onto folder.mirrorDir.
|
|
197
197
|
const content = await readFile(folder.server, credentialsBaseDir, folder.tenantId, changedFile.folderPath, changedFile.name, folder.owner);
|
|
198
198
|
const mirrorRelativeDir = toMirrorRelativeDir(folder.folderPath, changedFile.folderPath);
|
|
199
|
-
|
|
199
|
+
// spec.remoteFilename.toLocal exists to translate a DOC's own remote name (a skill's fixed
|
|
200
|
+
// "SKILL" -> "SKILL.md", or a memory doc's legacy extensionless remote name -> "<name>.md") - it
|
|
201
|
+
// must never touch an attachment (or skill sibling) file, which is pushed/pulled under its own
|
|
202
|
+
// literal name with no translation (see attachments/storage.ts's isUnderAttachmentsDir doc
|
|
203
|
+
// comment). Applying it unconditionally used to append ".md" to every non-.md attachment (e.g.
|
|
204
|
+
// "style.css" -> "style.css.md"), which reconcileDeletions' own untranslated remote-listing
|
|
205
|
+
// comparison then saw as absent remotely and deleted on the very same poll - so a directory/file
|
|
206
|
+
// attachment synced down to a second machine, then vanished before its resync even finished.
|
|
207
|
+
const isAttachment = isUnderAttachmentsDir(mirrorRelativeDir);
|
|
208
|
+
const localFilename = isAttachment ? changedFile.name : spec.remoteFilename.toLocal(changedFile.name);
|
|
200
209
|
const relPath = mirrorRelativeDir ? path.join(mirrorRelativeDir, localFilename) : localFilename;
|
|
201
210
|
const mirrorPath = path.join(folder.mirrorDir, relPath);
|
|
202
211
|
fs.mkdirSync(path.dirname(mirrorPath), { recursive: true });
|
package/dist/src/server.js
CHANGED
|
@@ -2,6 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import express from 'express';
|
|
5
|
+
import open from 'open';
|
|
5
6
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
7
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
7
8
|
import { loadConfig } from './config.js';
|
|
@@ -222,6 +223,12 @@ app.listen(PORT, () => {
|
|
|
222
223
|
console.error(`[memory-bucket] remote (folderfoo) skill folders${suffix}: ${config.remoteSkillFolders.map((f) => `${f.name}@${f.server}`).join(', ') || '(none)'}`);
|
|
223
224
|
console.error(`[memory-bucket] remote (folderfoo) memory folders${suffix}: ${config.remoteMemoryFolders.map((f) => `${f.name}@${f.server}`).join(', ') || '(none)'}`);
|
|
224
225
|
}
|
|
226
|
+
if (!process.env.MCP_MEMORY_BUCKET_NO_OPEN) {
|
|
227
|
+
const url = `http://localhost:${PORT}`;
|
|
228
|
+
open(url).catch(() => {
|
|
229
|
+
console.error(`[memory-bucket] could not auto-open browser — open ${url} manually`);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
225
232
|
});
|
|
226
233
|
process.on('SIGINT', () => {
|
|
227
234
|
remoteSkillPoller?.stop();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-memory-bucket",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP server exposing skill_* (reusable coding patterns) and memory_* (point-in-time working context) tools over a markdown+frontmatter source, cached into SQLite at runtime.",
|
|
6
6
|
"repository": {
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"gray-matter": "^4.0.3",
|
|
45
45
|
"lit": "^3.3.3",
|
|
46
46
|
"marked": "^18.0.10",
|
|
47
|
+
"open": "^10.2.0",
|
|
47
48
|
"zod": "^3.23.8"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|