@skedulo/memory-hub-mcp 0.2.9 → 0.2.11

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
@@ -85,12 +85,6 @@ Developer tools → API tokens. It never mints a token you didn't ask for.
85
85
 
86
86
  Then restart Claude Code, or quit Claude Desktop completely and reopen it.
87
87
 
88
- If your npm skips install scripts it hasn't been told to allow (npm 12 does by default), the
89
- embedding model's `sharp` dependency isn't built. The server still runs, but saves and recalls match
90
- on text only, and tool results say why. To fix it, add `allow-scripts=sharp` to `~/.npmrc`, rerun
91
- `npm install -g @skedulo/memory-hub-mcp`, delete `~/.npm/_npx` (npx keeps its own copy there), and
92
- restart.
93
-
94
88
  Installing the package is not the same as having access: every call is authorised by your personal
95
89
  Skedulo API token, and the package is useless without one.
96
90
 
@@ -106,7 +100,7 @@ once, and `setup --no-auto-update` pins the installed binary instead (update it
106
100
  `npm i -g @skedulo/memory-hub-mcp`, then re-run `setup`).
107
101
 
108
102
  The first start after a release fetches the new version, about 1 to 5 seconds with the dependencies
109
- already in npm's cache. `setup` warms that cache, so nobody's first start pays the ~430 MB cold
103
+ already in npm's cache. `setup` warms that cache, so nobody's first start pays the ~400 MB cold
110
104
  download (about 16 seconds).
111
105
 
112
106
  ### Releasing
package/assets/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: se-ai-memory-hub
3
- description: Use when working in a repo where the memory-hub MCP tools (memory_recall, memory_save, memory_upsertPersona, memory_setVisibility, memory_bulkPromoteRepoScoped, memory_grantAccess, memory_checkRepoStatus, memory_linkRepoTeam, memory_moveResourceRepo, memory_listRepos, memory_getSkillGuide) are available, to recall prior context mid-session, save durable facts/skills/scenarios, update your persona, and share items with your team on explicit request
3
+ description: Use when working in a repo where the memory-hub MCP tools (memory_recall, memory_list, memory_save, memory_saveBatch, memory_upsertPersona, memory_setVisibility, memory_bulkPromoteRepoScoped, memory_grantAccess, memory_checkRepoStatus, memory_linkRepoTeam, memory_moveResourceRepo, memory_listRepos, memory_getSkillGuide) are available, to recall prior context mid-session, save durable facts/skills/scenarios, update your persona, and share items with your team on explicit request
4
4
  ---
5
5
 
6
6
  # SE AI Memory Hub
@@ -345,7 +345,7 @@ FACTS_TEAM_N=0
345
345
  SKILLS_SELF_N=$(leg_total "$TMP_DIR/skills_self.json" "$(count_items "$SKILLS_SELF")")
346
346
  SKILLS_TEAM_N=$(leg_total "$TMP_DIR/skills_team.json" "$(count_items "$SKILLS_TEAM")")
347
347
 
348
- # The team-scope query matches DevAgentId == self OR Visibility == "Team", so
348
+ # The team-scope query matches DevAgentId == self OR Visibility == "Team" or "Org", so
349
349
  # self-owned items also come back in the team results. Drop anything already
350
350
  # shown under "Your ..." so it isn't rendered twice.
351
351
  FACTS_TEAM=$(comm -23 <(echo "$FACTS_TEAM" | sort) <(echo "$FACTS_SELF" | sort) 2>/dev/null || true)
package/dist/bulk.js ADDED
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.performLinkRepoTeam = exports.performMoveResourceRepo = exports.performSaveBatch = exports.performSaveItem = exports.MAX_LINK_BATCH = exports.MAX_MOVE_BATCH = exports.MAX_SAVE_BATCH = void 0;
4
+ const capture_1 = require("./capture");
5
+ const save_1 = require("./save");
6
+ exports.MAX_SAVE_BATCH = 25;
7
+ exports.MAX_MOVE_BATCH = 100;
8
+ exports.MAX_LINK_BATCH = 50;
9
+ function message(err) {
10
+ return err instanceof Error ? err.message : String(err);
11
+ }
12
+ async function performSaveItem(deps, input) {
13
+ const refused = await (0, capture_1.captureUpsert)(deps, input);
14
+ if (refused) {
15
+ return { refused: refused.message };
16
+ }
17
+ const result = await (0, save_1.performSave)(deps, input);
18
+ (0, capture_1.logCapture)({ action: 'saved', type: input.type, uid: result.uid, externalRef: input.externalRef });
19
+ return { result };
20
+ }
21
+ exports.performSaveItem = performSaveItem;
22
+ function describeMatch(match) {
23
+ const owner = match.mine === undefined ? '' : match.mine ? ', yours' : ", a teammate's";
24
+ return `${match.uid} (${match.similarity.toFixed(2)}${owner})`;
25
+ }
26
+ async function performSaveBatch(deps, items) {
27
+ if (items.length === 0) {
28
+ throw new Error('items must not be empty.');
29
+ }
30
+ if (items.length > exports.MAX_SAVE_BATCH) {
31
+ throw new Error(`items must contain at most ${exports.MAX_SAVE_BATCH} items, got: ${items.length}`);
32
+ }
33
+ const results = [];
34
+ const similarNotices = [];
35
+ for (const [index, input] of items.entries()) {
36
+ try {
37
+ const outcome = await performSaveItem(deps, input);
38
+ if ('refused' in outcome) {
39
+ results.push({ index, error: outcome.refused });
40
+ continue;
41
+ }
42
+ const { possibleDuplicate, similar, ...saved } = outcome.result;
43
+ const matches = similar?.length ? similar : possibleDuplicate ? [possibleDuplicate] : [];
44
+ const similarTo = matches.map(describeMatch);
45
+ results.push({ index, ...saved, ...(similarTo.length ? { similarTo } : {}) });
46
+ if (similarTo.length) {
47
+ similarNotices.push(`- item ${index} (${saved.uid}) resembles ${similarTo.join(', ')}`);
48
+ }
49
+ }
50
+ catch (err) {
51
+ results.push({ index, error: message(err) });
52
+ }
53
+ }
54
+ return { results, similarNotices };
55
+ }
56
+ exports.performSaveBatch = performSaveBatch;
57
+ function performMoveResourceRepo(deps, input) {
58
+ const hasOne = input.resourceId !== undefined;
59
+ const hasMany = input.resourceIds !== undefined;
60
+ if (hasOne === hasMany) {
61
+ throw new Error('Pass exactly one of resourceId or resourceIds.');
62
+ }
63
+ if (hasMany) {
64
+ const ids = input.resourceIds;
65
+ if (ids.length === 0) {
66
+ throw new Error('resourceIds must not be empty.');
67
+ }
68
+ if (ids.length > exports.MAX_MOVE_BATCH) {
69
+ throw new Error(`resourceIds must contain at most ${exports.MAX_MOVE_BATCH} ids, got: ${ids.length}`);
70
+ }
71
+ }
72
+ return deps.client.moveResourceRepo(input);
73
+ }
74
+ exports.performMoveResourceRepo = performMoveResourceRepo;
75
+ async function performLinkRepoTeam(deps, input) {
76
+ if (input.repoName !== undefined && input.repoNames !== undefined) {
77
+ throw new Error('Pass at most one of repoName or repoNames.');
78
+ }
79
+ if (input.repoNames === undefined) {
80
+ const repoName = input.repoName ?? deps.detectRepoName();
81
+ if (!repoName) {
82
+ return { error: 'No repo detected in this session. Pass repoName to say which repo to link.' };
83
+ }
84
+ return deps.client.linkRepoTeam({ repoName, teamName: input.teamName });
85
+ }
86
+ if (input.repoNames.length === 0) {
87
+ throw new Error('repoNames must not be empty.');
88
+ }
89
+ if (input.repoNames.length > exports.MAX_LINK_BATCH) {
90
+ throw new Error(`repoNames must contain at most ${exports.MAX_LINK_BATCH} names, got: ${input.repoNames.length}`);
91
+ }
92
+ const results = [];
93
+ for (const repoName of input.repoNames) {
94
+ try {
95
+ const request = { repoName, teamName: input.teamName };
96
+ const resolved = await deps.client.linkRepoTeam(request);
97
+ results.push({ repoName, uid: resolved.uid, devTeamId: resolved.devTeamId });
98
+ }
99
+ catch (err) {
100
+ results.push({ repoName, error: message(err) });
101
+ }
102
+ }
103
+ return { results };
104
+ }
105
+ exports.performLinkRepoTeam = performLinkRepoTeam;
package/dist/capture.js CHANGED
@@ -26,6 +26,12 @@ async function findOwnFactUid(deps, content, externalRef) {
26
26
  return similar.sort((a, b) => (b.similarity ?? 0) - (a.similarity ?? 0))[0]?.uid;
27
27
  }
28
28
  async function captureUpsert(deps, input, env = process.env) {
29
+ if (isCaptureMode(env) && input.visibility !== undefined) {
30
+ return {
31
+ message: `Not saved: capture mode never sets visibility, so the requested ${input.visibility} visibility was not applied. ` +
32
+ 'Save again without visibility; a human can share the item afterwards.',
33
+ };
34
+ }
29
35
  if (!isCaptureMode(env) || input.type !== 'Fact' || !input.content) {
30
36
  return undefined;
31
37
  }
package/dist/cli.js CHANGED
@@ -15,7 +15,15 @@ if (command === 'setup') {
15
15
  else if (command === 'embed') {
16
16
  // eslint-disable-next-line @typescript-eslint/no-var-requires
17
17
  const { runEmbed, readProcessStdin } = require('./embed-cli');
18
- runEmbed(process.argv.slice(3), { readStdin: readProcessStdin, write: (line) => console.log(line) }).then((code) => process.exit(code));
18
+ runEmbed(process.argv.slice(3), { readStdin: readProcessStdin, write: (line) => console.log(line) }).then((code) => {
19
+ // onnxruntime aborts the process if process.exit() runs while its model session is open, so a success ends on its own.
20
+ if (code === 0) {
21
+ process.exitCode = 0;
22
+ }
23
+ else {
24
+ process.exit(code);
25
+ }
26
+ });
19
27
  }
20
28
  else if (command === '--help' || command === '-h') {
21
29
  console.log(`memory-hub-mcp — MCP server for the SE AI Memory Hub
package/dist/client.js CHANGED
@@ -101,6 +101,9 @@ class MemoryHubClient {
101
101
  moveResourceRepo(input) {
102
102
  return this.post('/memory/move-resource-repo', input);
103
103
  }
104
+ listResources(input) {
105
+ return this.post('/memory/list-resources', input);
106
+ }
104
107
  resolveRepo(input) {
105
108
  return this.post('/memory/resolve-repo', input);
106
109
  }
@@ -37,11 +37,12 @@ exports.MODEL_CACHE_DIR = process.env.MEMORY_HUB_MODEL_CACHE || (0, path_1.join)
37
37
  let extractorPromise;
38
38
  let loadFailure;
39
39
  const EXTRACTOR_LOAD_TIMEOUT_MS = 15_000;
40
- // Imported here, not at module top: the library needs sharp's native build, which npm 12 skips by default, and a top-level import would stop the whole server from starting.
40
+ // Imported here, not at module top: the library loads native modules, and one that fails must not stop the whole server from starting.
41
41
  async function loadPipeline() {
42
- const { env, pipeline } = await Promise.resolve().then(() => __importStar(require('@xenova/transformers')));
42
+ const { env, pipeline } = await Promise.resolve().then(() => __importStar(require('@huggingface/transformers')));
43
43
  env.cacheDir = exports.MODEL_CACHE_DIR;
44
- return pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2');
44
+ // q8 is the quantized model every stored vector was made with; the library's default would change them all.
45
+ return pipeline('feature-extraction', 'Xenova/all-MiniLM-L6-v2', { dtype: 'q8' });
45
46
  }
46
47
  function loadExtractor() {
47
48
  let timer;
@@ -72,15 +73,11 @@ function getExtractor() {
72
73
  }
73
74
  return extractorPromise;
74
75
  }
75
- // Shown on tool results so the agent can tell the user why semantic matching is off.
76
76
  function embeddingNotice() {
77
77
  if (!loadFailure) {
78
78
  return undefined;
79
79
  }
80
- const fix = loadFailure.includes('sharp')
81
- ? ' npm blocked the install script of sharp, which the model needs: add allow-scripts=sharp to ~/.npmrc, then reinstall (rerun npm install -g @skedulo/memory-hub-mcp, or delete ~/.npm/_npx when the server runs through npx) and restart.'
82
- : '';
83
- return `Note: semantic matching is off because the embedding model could not load (${loadFailure}). Saves and recalls still work but match on text only, and new saves are stored without an embedding.${fix}`;
80
+ return `Note: semantic matching is off because the embedding model could not load (${loadFailure}). Saves and recalls still work but match on text only, and new saves are stored without an embedding.`;
84
81
  }
85
82
  exports.embeddingNotice = embeddingNotice;
86
83
  // 384-dimension vector (all-MiniLM-L6-v2's fixed output size), mean-pooled and
package/dist/index.js CHANGED
@@ -11,7 +11,8 @@ const repo_context_1 = require("./repo-context");
11
11
  const task_context_1 = require("./task-context");
12
12
  const git_remote_1 = require("./git-remote");
13
13
  const embeddings_1 = require("./embeddings");
14
- const save_1 = require("./save");
14
+ const bulk_1 = require("./bulk");
15
+ const set_visibility_1 = require("./set-visibility");
15
16
  const capture_1 = require("./capture");
16
17
  const recall_1 = require("./recall");
17
18
  const guide_check_1 = require("./guide-check");
@@ -133,7 +134,7 @@ server.tool('memory_get', "Fetch one Fact/Skill/Scenario/Wiki page in full by it
133
134
  : await client.getWikiPage({ uid: input.uid });
134
135
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
135
136
  });
136
- server.tool('memory_save', 'Save a Fact, Skill, Scenario, or Wiki page to the SE AI Memory Hub. Written Team visibility automatically if the attached repo is already linked to a team, otherwise Private. See memory_getSkillGuide for which type to use and which fields it needs. The current repo is detected automatically unless you pass an explicit repo (from memory_listRepos) to target a different one.', {
137
+ const saveShape = {
137
138
  type: zod_1.z.enum(['Fact', 'Skill', 'Scenario', 'Wiki']),
138
139
  content: zod_1.z.string().optional().describe('Required for Fact, Skill, Wiki.'),
139
140
  title: zod_1.z.string().optional().describe('Required for Skill, Wiki.'),
@@ -142,28 +143,62 @@ server.tool('memory_save', 'Save a Fact, Skill, Scenario, or Wiki page to the SE
142
143
  links: zod_1.z.array(zod_1.z.string()).optional().describe('Wiki only — UIDs of other wiki pages this one depends on.'),
143
144
  tags: zod_1.z.array(zod_1.z.enum(TAG_VALUES)).optional().describe('Fact, Skill, Wiki only.'),
144
145
  externalRef: zod_1.z.string().optional().describe("Fact, Scenario, Wiki only — the Linear/Jira ticket this relates to, e.g. 'SOL-1234' — pass it when the user mentions a ticket."),
145
- repo: zod_1.z.string().min(1).optional().describe('An explicit DevRepos uid from memory_listRepos, overriding the current-directory auto-detected repo.'),
146
- }, async (input) => {
147
- const refused = await (0, capture_1.captureUpsert)({ client, embed: embeddings_1.embed }, input);
148
- if (refused) {
149
- return { content: [{ type: 'text', text: refused.message }] };
146
+ repo: zod_1.z.string().min(1).optional().describe('A DevRepos uid from memory_listRepos, or an owner/name that is already linked to a team, overriding the current-directory auto-detected repo.'),
147
+ visibility: zod_1.z.enum(['Private', 'Team', 'Org']).optional().describe('Only when the human approved sharing this item or batch in this conversation. Org is readable by everyone in the tenant. Omit it to get the default.'),
148
+ };
149
+ const saveDeps = {
150
+ client,
151
+ embed: embeddings_1.embed,
152
+ currentRepoUid: () => repoContext.currentRepoUid(),
153
+ resolveTaskUid: (ref, repoUid) => taskContext.resolveTaskUid(ref, repoUid),
154
+ };
155
+ server.tool('memory_save', 'Save a Fact, Skill, Scenario, or Wiki page to the SE AI Memory Hub. Written Team visibility automatically if the attached repo is already linked to a team, otherwise Private, unless visibility is passed. The result reports the saved visibility, repoId, repoName and teamName. See memory_getSkillGuide for which type to use and which fields it needs. The current repo is detected automatically unless you pass an explicit repo (from memory_listRepos) to target a different one.', saveShape, async (input) => {
156
+ const outcome = await (0, bulk_1.performSaveItem)(saveDeps, input);
157
+ if ('refused' in outcome) {
158
+ return { content: [{ type: 'text', text: outcome.refused }] };
150
159
  }
151
- const result = await (0, save_1.performSave)({
152
- client,
153
- embed: embeddings_1.embed,
154
- currentRepoUid: () => repoContext.currentRepoUid(),
155
- resolveTaskUid: (ref, repoUid) => taskContext.resolveTaskUid(ref, repoUid),
156
- }, input);
157
- (0, capture_1.logCapture)({ action: 'saved', type: input.type, uid: result.uid, externalRef: input.externalRef });
158
160
  return {
159
161
  content: [
160
162
  ...(await joinNoticeBlocks()),
161
- ...similarNoticeBlocks(input.type, result),
163
+ ...similarNoticeBlocks(input.type, outcome.result),
164
+ ...embeddingNoticeBlocks(),
165
+ { type: 'text', text: JSON.stringify(outcome.result) },
166
+ ],
167
+ };
168
+ });
169
+ server.tool('memory_saveBatch', 'Save up to 25 Facts/Skills/Scenarios/Wiki pages in one call, each item shaped exactly like a memory_save call (same required fields, repo and visibility rules). Items are saved in order; each reports its own result or error, so one bad item does not stop the rest. Possible duplicates are listed compactly per item. Pass visibility only when the human approved sharing this batch in this conversation.', { items: zod_1.z.array(zod_1.z.object(saveShape)).min(1).max(25) }, async (input) => {
170
+ const { results, similarNotices } = await (0, bulk_1.performSaveBatch)(saveDeps, input.items);
171
+ const similarBlock = similarNotices.length
172
+ ? [
173
+ {
174
+ type: 'text',
175
+ text: `Saved, but these look like memories already saved:\n${similarNotices.join('\n')}\nWhere one of yours already covers it, memory_update that uid with the merged text and memory_delete the new copy.`,
176
+ },
177
+ ]
178
+ : [];
179
+ return {
180
+ content: [
181
+ ...(await joinNoticeBlocks()),
182
+ ...similarBlock,
162
183
  ...embeddingNoticeBlocks(),
163
- { type: 'text', text: JSON.stringify(result) },
184
+ { type: 'text', text: JSON.stringify({ results }) },
164
185
  ],
165
186
  };
166
187
  });
188
+ server.tool('memory_list', "List memory items of one type that you can see, newest first, with a title, visibility, repo and whether each is yours — an inventory for choosing which items to share, move or review. Feed the uids to memory_setVisibility or memory_moveResourceRepo as resourceIds. Returns total (all matches) and one page of items; page with offset. Not a search: use memory_recall to find content by meaning.", {
189
+ type: zod_1.z.enum(['Fact', 'Scenario', 'Skill', 'Wiki']),
190
+ repo: zod_1.z.string().min(1).nullable().optional().describe('A DevRepos uid from memory_listRepos. null lists only items with no repo; omit for any repo.'),
191
+ visibility: zod_1.z.enum(['Private', 'Team', 'Restricted', 'Org']).optional(),
192
+ titlePrefix: zod_1.z.string().min(1).optional().describe('Case-insensitive start of the title (Fact: content, Scenario: summary).'),
193
+ tags: zod_1.z.array(zod_1.z.enum(TAG_VALUES)).optional().describe('Items carrying any of these tags. Not supported for Scenario.'),
194
+ mine: zod_1.z.boolean().optional().describe('true: only items you saved.'),
195
+ createdAfter: zod_1.z.string().min(1).optional().describe('ISO date or datetime. Skills filter on last modified instead of created.'),
196
+ offset: zod_1.z.number().int().min(0).optional(),
197
+ limit: zod_1.z.number().int().min(1).max(200).optional().describe('Default 50, max 200.'),
198
+ }, async (input) => {
199
+ const result = await client.listResources(input);
200
+ return { content: [{ type: 'text', text: JSON.stringify(result) }] };
201
+ });
167
202
  server.tool('memory_upsertPersona', "Update this developer's durable persona profile (preferences/decisions/patterns) — each provided field replaces its prior value, not appends.", {
168
203
  preferences: zod_1.z.string().optional(),
169
204
  decisions: zod_1.z.string().optional(),
@@ -172,12 +207,13 @@ server.tool('memory_upsertPersona', "Update this developer's durable persona pro
172
207
  const result = await client.upsertPersona(input);
173
208
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
174
209
  });
175
- server.tool('memory_setVisibility', "Change who can see a Fact/Scenario/Skill/Wiki page — promote to Team or Restricted, or demote back to Private. Only call this when a human in the conversation explicitly asks to share, promote, or un-share something — never autonomously.", {
210
+ server.tool('memory_setVisibility', "Change who can see a Fact/Scenario/Skill/Wiki page — promote to Team, Org (everyone in the tenant) or Restricted, or demote back to Private. Pass resourceId for one item, or resourceIds (1-100 uids of one resourceType) for a batch; each item reports its own result. Only call this when a human in the conversation explicitly asks to share, promote, or un-share something — never autonomously.", {
176
211
  resourceType: zod_1.z.enum(['Fact', 'Scenario', 'Skill', 'Wiki']),
177
- resourceId: zod_1.z.string(),
178
- newVisibility: zod_1.z.enum(['Private', 'Team', 'Restricted']),
212
+ resourceId: zod_1.z.string().min(1).optional().describe('One item. Give exactly one of resourceId or resourceIds.'),
213
+ resourceIds: zod_1.z.array(zod_1.z.string().min(1)).min(1).max(100).optional().describe('A batch of up to 100 items of the same resourceType.'),
214
+ newVisibility: zod_1.z.enum(['Private', 'Team', 'Org', 'Restricted']),
179
215
  }, async (input) => {
180
- const result = await client.promoteVisibility(input);
216
+ const result = await (0, set_visibility_1.performSetVisibility)({ client }, input);
181
217
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
182
218
  });
183
219
  server.tool('memory_bulkPromoteRepoScoped', "Bulk catch-up: promotes all of this developer's existing Private Facts/Scenarios/Skills/Wiki pages whose repo is already linked to a team, to Team visibility — for content saved before repo-scoped saves started defaulting to Team automatically. Only touches your own items. Only call this when a human in the conversation explicitly asks for it — never autonomously. Re-running it will also re-promote any item you've since deliberately demoted with memory_setVisibility, so don't call it more than once without the human asking again.", {}, async () => {
@@ -192,12 +228,13 @@ server.tool('memory_grantAccess', 'Grant a specific teammate access to one of yo
192
228
  const result = await client.grantAccess(input);
193
229
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
194
230
  });
195
- server.tool('memory_moveResourceRepo', "Reassign an already-saved Fact/Scenario/Skill/Wiki page to a different repo, or clear its repo association with repo: null. Look up the target repo's uid with memory_listRepos first.", {
231
+ server.tool('memory_moveResourceRepo', "Reassign an already-saved Fact/Scenario/Skill/Wiki page to a different repo, or clear its repo association with repo: null. Pass resourceId for one item, or resourceIds (1-100 uids of one resourceType) for a batch; each item reports its own result. Look up the target repo's uid with memory_listRepos first.", {
196
232
  resourceType: zod_1.z.enum(['Fact', 'Scenario', 'Skill', 'Wiki']),
197
- resourceId: zod_1.z.string(),
233
+ resourceId: zod_1.z.string().min(1).optional().describe('One item. Give exactly one of resourceId or resourceIds.'),
234
+ resourceIds: zod_1.z.array(zod_1.z.string().min(1)).min(1).max(100).optional().describe('A batch of up to 100 items of the same resourceType.'),
198
235
  repo: zod_1.z.string().nullable(),
199
236
  }, async (input) => {
200
- const result = await client.moveResourceRepo(input);
237
+ const result = await (0, bulk_1.performMoveResourceRepo)({ client }, input);
201
238
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
202
239
  });
203
240
  server.tool('memory_checkRepoStatus', "Check whether the current repo is linked to a memory team yet, reporting the linked team and whether you are a member. See memory_getSkillGuide for what to do if it isn't.", {}, async () => {
@@ -241,28 +278,16 @@ server.tool('memory_listRepos', "List repos across this developer's teams, with
241
278
  const repos = await (0, list_repos_1.listReposForTools)(client, input.query);
242
279
  return { content: [{ type: 'text', text: JSON.stringify({ repos }) }] };
243
280
  });
244
- server.tool('memory_linkRepoTeam', "Link a repo to a team by name (existing or new) after the user has confirmed which team it belongs to. Defaults to the repo of the current directory; pass repoName to link a different one, or from a host with no repo at all (Claude Desktop). Use memory_listTeams to see the team names to choose from.", {
281
+ server.tool('memory_linkRepoTeam', "Link a repo to a team by name (existing or new) after the user has confirmed which team it belongs to. Defaults to the repo of the current directory; pass repoName to link a different one, or from a host with no repo at all (Claude Desktop). Pass repoNames (1-50) to link several repos to the same team in one call; each reports its own result. Use memory_listTeams to see the team names to choose from.", {
245
282
  teamName: zod_1.z.string(),
246
283
  repoName: zod_1.z
247
284
  .string()
248
285
  .min(1)
249
286
  .optional()
250
- .describe('Repo to link. Defaults to the current directory\'s repo; required when there is none.'),
287
+ .describe('Repo to link. Defaults to the current directory\'s repo; required when there is none. Not with repoNames.'),
288
+ repoNames: zod_1.z.array(zod_1.z.string().min(1)).min(1).max(50).optional().describe('A batch of up to 50 repos to link to teamName.'),
251
289
  }, async (input) => {
252
- const repoName = input.repoName ?? (0, git_remote_1.detectRepoName)();
253
- if (!repoName) {
254
- return {
255
- content: [
256
- {
257
- type: 'text',
258
- text: JSON.stringify({
259
- error: 'No repo detected in this session. Pass repoName to say which repo to link.',
260
- }),
261
- },
262
- ],
263
- };
264
- }
265
- const result = await client.linkRepoTeam({ repoName, teamName: input.teamName });
290
+ const result = await (0, bulk_1.performLinkRepoTeam)({ client, detectRepoName: git_remote_1.detectRepoName }, input);
266
291
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
267
292
  });
268
293
  server.tool('memory_sessionContext', "Load this developer's saved memory-hub context: their persona profile, facts, skills, and — when the session has a repo — its wiki pages. Call once at the start of a conversation. If the result has persona.configured false, offer once to set up their persona with memory_upsertPersona, then drop it for the rest of the conversation. On Claude Code the SessionStart hook already covers facts and skills; call this there for the persona, or if that context is missing.", {}, async () => {
package/dist/save.js CHANGED
@@ -38,7 +38,7 @@ async function performSave(deps, input) {
38
38
  const repo = (await explicitRepo()) ?? (await currentRepoUid());
39
39
  const devTaskId = input.externalRef ? await resolveTaskUid(input.externalRef, repo ?? null) : undefined;
40
40
  const embedding = await embed(input.content).catch(() => undefined);
41
- return client.saveFact({ content: input.content, tags: input.tags, devTaskId, repo, embedding });
41
+ return client.saveFact({ content: input.content, tags: input.tags, devTaskId, repo, embedding, visibility: input.visibility });
42
42
  }
43
43
  case 'Skill': {
44
44
  if (!input.title || !input.content) {
@@ -46,7 +46,7 @@ async function performSave(deps, input) {
46
46
  }
47
47
  const repo = (await explicitRepo()) ?? (await currentRepoUid());
48
48
  const embedding = await embed(`${input.title}\n\n${input.content}`).catch(() => undefined);
49
- return client.saveSkill({ title: input.title, content: input.content, tags: input.tags, repo, embedding });
49
+ return client.saveSkill({ title: input.title, content: input.content, tags: input.tags, repo, embedding, visibility: input.visibility });
50
50
  }
51
51
  case 'Scenario': {
52
52
  if (!input.summary) {
@@ -55,7 +55,7 @@ async function performSave(deps, input) {
55
55
  const repo = (await explicitRepo()) ?? (await currentRepoUid());
56
56
  const devTaskId = input.externalRef ? await resolveTaskUid(input.externalRef, repo ?? null) : undefined;
57
57
  const embedding = await embed(input.summary).catch(() => undefined);
58
- return client.saveScenario({ summary: input.summary, factIds: input.factIds, devTaskId, repo, embedding });
58
+ return client.saveScenario({ summary: input.summary, factIds: input.factIds, devTaskId, repo, embedding, visibility: input.visibility });
59
59
  }
60
60
  case 'Wiki': {
61
61
  if (!input.title || !input.content) {
@@ -72,6 +72,7 @@ async function performSave(deps, input) {
72
72
  devTaskId,
73
73
  repo,
74
74
  embedding,
75
+ visibility: input.visibility,
75
76
  });
76
77
  }
77
78
  }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.performSetVisibility = void 0;
4
+ function performSetVisibility(deps, input) {
5
+ const hasOne = input.resourceId !== undefined;
6
+ const hasMany = input.resourceIds !== undefined;
7
+ if (hasOne === hasMany) {
8
+ throw new Error('Pass exactly one of resourceId or resourceIds.');
9
+ }
10
+ if (hasMany && input.resourceIds.length === 0) {
11
+ throw new Error('resourceIds must not be empty.');
12
+ }
13
+ return deps.client.promoteVisibility(input);
14
+ }
15
+ exports.performSetVisibility = performSetVisibility;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skedulo/memory-hub-mcp",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "MCP server for the SE AI Memory Hub: recall and save developer memory from Claude Code and Claude Desktop.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -31,8 +31,8 @@
31
31
  "prepack": "./scripts/copy-assets.sh"
32
32
  },
33
33
  "dependencies": {
34
+ "@huggingface/transformers": "3.8.1",
34
35
  "@modelcontextprotocol/sdk": "^1.30.0",
35
- "@xenova/transformers": "^2.17.2",
36
36
  "axios": "^1.7.0",
37
37
  "zod": "^3.25.0"
38
38
  },
package/skill-guide.md CHANGED
@@ -98,6 +98,14 @@ list is prose, kept in sync by hand.
98
98
  Reach for this instead of `type: 'Fact'` when what you learned will
99
99
  still be true next month, not just relevant to the task at hand.
100
100
 
101
+ `memory_save`, `memory_update` and `memory_moveResourceRepo` report where the
102
+ item ended up — `visibility`, `repoId`, `repoName` and `teamName` — read from
103
+ the saved record. Check them instead of assuming the default applied. `repo`
104
+ on a save takes a uid from `memory_listRepos` or an `owner/name` of a repo
105
+ already linked to a team. `visibility` (`Private`, `Team` or `Org`) overrides
106
+ the default, but only pass it when the human approved sharing that item or
107
+ batch in this conversation — see "Sharing" below.
108
+
101
109
  **Wiki pages can depend on each other** — pass `links` (an array of other
102
110
  wiki page UIDs) on a `type: 'Wiki'` save to connect a page to the ones it
103
111
  depends on, e.g. a TDD linking to the SOW it was scoped against, or an
@@ -106,11 +114,10 @@ a graph in the panel's Wiki tab. There's no separate "dependency" concept —
106
114
  a link *is* the dependency edge, just without a label on it (plain
107
115
  "linked," not "depends on" vs. "supersedes"). The link is directional (the page you're saving is the source, each UID in
108
116
  `links` is a target) and computes backlinks automatically for the reverse
109
- direction — but only the panel's Wiki tab currently shows either
110
- direction. Neither `memory_recall` nor any other MCP tool returns a
111
- page's links or backlinks today, so you can pass `links` when saving, but
112
- can't currently query them back mid-session — check the panel, or the
113
- page you already have the UID for, if you need to see them.
117
+ direction. `memory_get type=Wiki` returns `links` (the targets this page
118
+ points at) and `backlinks` (pages that link to it). Both come only from link
119
+ rows you created yourself, so a teammate's links to your page don't appear.
120
+ The panel's Wiki tab shows the same graph.
114
121
 
115
122
  **If the user hands you a document (PDF, Word, PowerPoint, etc.) to turn
116
123
  into a wiki page**, and a `convert_to_markdown` tool is available (from the
@@ -307,20 +314,76 @@ Two consequences worth knowing:
307
314
  ## Sharing — only on explicit human request
308
315
 
309
316
  - **`memory_setVisibility`** — changes a Fact/Scenario/Skill/Wiki page's
310
- visibility in either direction: promote to `Team` or `Restricted`, or
311
- demote back to `Private` (e.g. to undo an automatic Team default, or to
312
- walk back an earlier promote/grant).
317
+ visibility in either direction: promote to `Team`, `Org` or `Restricted`,
318
+ or demote back to `Private` (e.g. to undo an automatic Team default, or to
319
+ walk back an earlier promote/grant). Pass `resourceId` for one item, or
320
+ `resourceIds` (1-100 uids, all one `resourceType`) for a batch; a batch
321
+ reports a result or an error per item, so a bad uid doesn't sink the rest.
313
322
  - **`memory_grantAccess`** — shares a specific item with one named teammate
314
323
  (automatically promotes it to `Restricted` if needed).
315
324
 
316
- **Call these two tools only when a human explicitly asks, in the current
325
+ Visibility levels: `Private` is you only. `Team` is the team that owns the
326
+ item's repo (or, for a repo-less item, every team you're in). `Org` is every
327
+ agent in the tenant, whatever their team. Use `Team` for work notes that
328
+ belong with one engagement; use `Org` only for knowledge that is useful
329
+ across teams and safe for everyone in the tenant to read — a reusable skill, a
330
+ platform gotcha, a standing reference. When in doubt, `Team`. `Restricted`
331
+ needs a named person, so only `memory_grantAccess` sets it, never a save.
332
+
333
+ **Never put secrets, credentials, customer personal data, or details of an
334
+ unfixed vulnerability in a `Team` or `Org` item.** Visibility is enforced only
335
+ by the memory-hub function, not by the platform: the underlying records are
336
+ not locked down by a platform access policy, so anyone with data access to the
337
+ tenant can read them. Keep anything that sensitive out of memory entirely.
338
+
339
+ **Call these tools only when a human explicitly asks, in the current
317
340
  conversation, to share, promote, un-share, or demote something** — e.g.
318
- "share that fact with the team," "give Alice access to this skill," or
319
- "actually make that one private again." Never call them autonomously based
320
- on your own judgment that something seems worth sharing (or un-sharing);
321
- that judgment belongs to the person who owns the item, not to you. This
322
- rule applies the same way in both directions — a demote is not a safer
323
- default action just because it narrows visibility.
341
+ "share that fact with the team," "make these Org-visible," "give Alice access
342
+ to this skill," or "actually make that one private again." Never call them
343
+ autonomously based on your own judgment that something seems worth sharing
344
+ (or un-sharing); that judgment belongs to the person who owns the item, not to
345
+ you. This rule applies the same way in both directions — a demote is not a
346
+ safer default action just because it narrows visibility.
347
+
348
+ **Bulk tools.** Each batch reports a result or error per item and never stops
349
+ on one bad item.
350
+
351
+ - **`memory_list`** — inventory of one `type` you can see, newest first
352
+ (`uid`, title, `visibility`, repo, `mine`), with `total` and a page of items
353
+ (`offset`, `limit` up to 200, default 50). Filters: `repo` (a uid; `null`
354
+ means no repo), `visibility`, `titlePrefix`, `tags` (not for Scenario),
355
+ `mine`, `createdAfter` (ISO date). It is not a search; use `memory_recall`
356
+ for that. It changes nothing.
357
+ - **`memory_saveBatch`** — `items` (1-25), each exactly a `memory_save` input.
358
+ Results come back by `index`; duplicates appear as a short `similarTo` list.
359
+ - **`memory_moveResourceRepo`** — `resourceId` or `resourceIds` (1-100, one
360
+ `resourceType`), exactly one.
361
+ - **`memory_linkRepoTeam`** — `repoName`, or `repoNames` (1-50) for one
362
+ `teamName`; with neither it uses the current repo.
363
+
364
+ **Bulk-sharing recipe.** Call `memory_list` (e.g. `mine: true`, a `repo`,
365
+ `visibility: 'Team'`) and collect the uids from every page first, until
366
+ `offset` reaches `total`. Changing an item can drop it out of the filter and
367
+ shift later pages, so don't change anything while paging. Show the human the
368
+ whole set and wait for them to approve exactly that set. Then call
369
+ `memory_setVisibility` with `resourceIds` in chunks of 100 (or re-list from
370
+ offset 0 after each change). Listing never authorises sharing; the
371
+ explicit-request rule above still applies.
372
+
373
+ **Sharing a batch.** When the human approves sharing a named batch once ("save
374
+ these and make them Org-visible", "share everything from this session with the
375
+ team"), that one approval covers the whole batch, so don't ask again per item.
376
+ Either pass `visibility` on each `memory_save` (or `memory_saveBatch` item),
377
+ or save first and then call `memory_setVisibility` with `resourceIds`. A subagent may do this only for the
378
+ batch the human approved in this conversation, and never for anything it saved
379
+ on its own initiative. Capture mode refuses any save that carries `visibility`,
380
+ so a batch share must be done in the live conversation. The allow rules are
381
+ `mcp__plugin_memory-hub_memory-hub__memory_setVisibility` and
382
+ `mcp__plugin_memory-hub_memory-hub__memory_moveResourceRepo` (plugin), or
383
+ `mcp__memory-hub__memory_setVisibility` and
384
+ `mcp__memory-hub__memory_moveResourceRepo` (standalone server). A rule is a
385
+ per-user opt-in that removes the last interactive check before an item goes
386
+ Team or Org, so add it only while doing an approved bulk share.
324
387
 
325
388
  ## Targeting a different repo explicitly
326
389
 
@@ -339,7 +402,12 @@ If you get the repo wrong after the fact — or want to clear a save back to
339
402
  repo-less — call `memory_moveResourceRepo` with `resourceType` (`Fact`,
340
403
  `Skill`, `Scenario`, or `Wiki`), the item's `resourceId`, and the corrected
341
404
  `repo` uid from `memory_listRepos`. Pass `repo: null` instead of a uid to
342
- clear it back to unscoped rather than reassign it.
405
+ clear it back to unscoped rather than reassign it. To move many at once, pass
406
+ `resourceIds` (up to 100 of one `resourceType`) instead of `resourceId`. List
407
+ the set with `memory_list` and collect every page's uids before moving
408
+ anything, since a move drops items out of a `repo` filter and shifts later
409
+ pages. Moving Team-visible items into another team's repo changes who can read
410
+ them.
343
411
 
344
412
  ## Linking a repo to a team
345
413
 
@@ -361,7 +429,8 @@ result looks unscoped when you expected repo context).
361
429
  - With no repo detected at all (Claude Desktop starts the server with no
362
430
  project directory), `memory_linkRepoTeam` still works, but you have to
363
431
  name the repo: pass `repoName` alongside `teamName`. `memory_listTeams`
364
- lists the teams to choose from. Never guess the repo name — ask.
432
+ lists the teams to choose from. Never guess the repo name — ask. To link
433
+ several repos to one team, pass `repoNames` (up to 50) instead.
365
434
 
366
435
  This only needs to happen once per repo per agent. Do this on explicit
367
436
  user confirmation, not a guess of your own — an SE works several client