@membank/mcp 0.7.0 → 0.8.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/dist/index.mjs +60 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
2
|
-
import { DatabaseManager, EmbeddingService, MEMORY_TYPE_VALUES, MemoryRepository, ProjectRepository, QueryEngine, listMemoryTypes, resolveProject } from "@membank/core";
|
|
2
|
+
import { DatabaseManager, EmbeddingService, MEMORY_TYPE_VALUES, MIGRATIONS, MemoryRepository, ProjectRepository, QueryEngine, listMemoryTypes, resolveProject, runScopeToProjectsMigration } from "@membank/core";
|
|
3
3
|
import { Server } from "@modelcontextprotocol/sdk/server";
|
|
4
4
|
import { CallToolRequestSchema, ErrorCode, ListToolsRequestSchema, McpError } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
//#region src/server.ts
|
|
@@ -35,7 +35,7 @@ function createServer(core) {
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
name: "save_memory",
|
|
38
|
-
description: "Save a new memory. Handles deduplication automatically — near-identical memories (cosine similarity >0.92, same type and
|
|
38
|
+
description: "Save a new memory. Handles deduplication automatically — near-identical memories (cosine similarity >0.92, same type and project) overwrite the existing record.",
|
|
39
39
|
inputSchema: {
|
|
40
40
|
type: "object",
|
|
41
41
|
properties: {
|
|
@@ -53,9 +53,9 @@ function createServer(core) {
|
|
|
53
53
|
items: { type: "string" },
|
|
54
54
|
description: "Optional tags"
|
|
55
55
|
},
|
|
56
|
-
|
|
57
|
-
type: "
|
|
58
|
-
description: "
|
|
56
|
+
global: {
|
|
57
|
+
type: "boolean",
|
|
58
|
+
description: "Save as a global memory, not tied to any project"
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
required: ["content", "type"]
|
|
@@ -111,10 +111,6 @@ function createServer(core) {
|
|
|
111
111
|
enum: [...MEMORY_TYPE_VALUES],
|
|
112
112
|
description: "Filter by memory type"
|
|
113
113
|
},
|
|
114
|
-
scope: {
|
|
115
|
-
type: "string",
|
|
116
|
-
description: "Filter by scope"
|
|
117
|
-
},
|
|
118
114
|
limit: {
|
|
119
115
|
type: "number",
|
|
120
116
|
description: "Maximum results to return (default 10)"
|
|
@@ -123,6 +119,25 @@ function createServer(core) {
|
|
|
123
119
|
required: ["query"]
|
|
124
120
|
}
|
|
125
121
|
},
|
|
122
|
+
{
|
|
123
|
+
name: "migrate",
|
|
124
|
+
description: "List or run named data migrations. Use mode \"list\" to see available migrations; mode \"run\" with a migration name to execute one.",
|
|
125
|
+
inputSchema: {
|
|
126
|
+
type: "object",
|
|
127
|
+
properties: {
|
|
128
|
+
mode: {
|
|
129
|
+
type: "string",
|
|
130
|
+
enum: ["list", "run"],
|
|
131
|
+
description: "Mode: \"list\" to see available migrations, \"run\" to execute one"
|
|
132
|
+
},
|
|
133
|
+
name: {
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "Migration name (required when mode is \"run\")"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
required: ["mode"]
|
|
139
|
+
}
|
|
140
|
+
},
|
|
126
141
|
{
|
|
127
142
|
name: "pin_memory",
|
|
128
143
|
description: "Pin a memory by id. Pinned memories are always injected into the session context.",
|
|
@@ -170,21 +185,13 @@ function createServer(core) {
|
|
|
170
185
|
if (typeof content !== "string" || content.trim() === "") throw new McpError(ErrorCode.InvalidParams, "content is required and must be a non-empty string");
|
|
171
186
|
if (typeof type !== "string" || !MEMORY_TYPE_VALUES.includes(type)) throw new McpError(ErrorCode.InvalidParams, "type is required and must be one of: correction, preference, decision, learning, fact");
|
|
172
187
|
const tags = Array.isArray(args?.tags) ? args.tags : void 0;
|
|
173
|
-
|
|
174
|
-
if (typeof args?.scope === "string") {
|
|
175
|
-
projectHash = args.scope;
|
|
176
|
-
core.projects.upsertByHash(args.scope, `project-${args.scope.slice(0, 8)}`);
|
|
177
|
-
} else {
|
|
178
|
-
const project = await resolveProject();
|
|
179
|
-
core.projects.upsertByHash(project.hash, project.name);
|
|
180
|
-
projectHash = project.hash;
|
|
181
|
-
}
|
|
188
|
+
const projectScope = args?.global === true ? void 0 : await resolveProject();
|
|
182
189
|
try {
|
|
183
190
|
const memory = await core.repo.save({
|
|
184
191
|
content,
|
|
185
192
|
type,
|
|
186
193
|
tags,
|
|
187
|
-
|
|
194
|
+
projectScope
|
|
188
195
|
});
|
|
189
196
|
return { content: [{
|
|
190
197
|
type: "text",
|
|
@@ -260,13 +267,11 @@ function createServer(core) {
|
|
|
260
267
|
const queryText = args?.query;
|
|
261
268
|
if (typeof queryText !== "string" || queryText.trim() === "") throw new McpError(ErrorCode.InvalidParams, "query is required and must be a non-empty string");
|
|
262
269
|
const type = args?.type;
|
|
263
|
-
const projectHash = args?.scope;
|
|
264
270
|
const limit = typeof args?.limit === "number" ? args.limit : 10;
|
|
265
271
|
try {
|
|
266
272
|
const serialised = (await core.query.query({
|
|
267
273
|
query: queryText,
|
|
268
274
|
type,
|
|
269
|
-
projectHash,
|
|
270
275
|
limit
|
|
271
276
|
})).map((r) => ({
|
|
272
277
|
id: r.id,
|
|
@@ -291,6 +296,40 @@ function createServer(core) {
|
|
|
291
296
|
};
|
|
292
297
|
}
|
|
293
298
|
}
|
|
299
|
+
if (request.params.name === "migrate") {
|
|
300
|
+
const args = request.params.arguments;
|
|
301
|
+
const mode = args?.mode;
|
|
302
|
+
if (mode !== "list" && mode !== "run") throw new McpError(ErrorCode.InvalidParams, "mode must be \"list\" or \"run\"");
|
|
303
|
+
if (mode === "list") return { content: [{
|
|
304
|
+
type: "text",
|
|
305
|
+
text: JSON.stringify(MIGRATIONS)
|
|
306
|
+
}] };
|
|
307
|
+
const migrationName = args?.name;
|
|
308
|
+
if (typeof migrationName !== "string" || migrationName.trim() === "") throw new McpError(ErrorCode.InvalidParams, "name is required for run mode");
|
|
309
|
+
if (migrationName === "scope-to-projects") try {
|
|
310
|
+
const result = await runScopeToProjectsMigration(core.projects);
|
|
311
|
+
if (result === null) return {
|
|
312
|
+
content: [{
|
|
313
|
+
type: "text",
|
|
314
|
+
text: JSON.stringify({ error: "No project found for current directory." })
|
|
315
|
+
}],
|
|
316
|
+
isError: true
|
|
317
|
+
};
|
|
318
|
+
return { content: [{
|
|
319
|
+
type: "text",
|
|
320
|
+
text: JSON.stringify(result)
|
|
321
|
+
}] };
|
|
322
|
+
} catch (err) {
|
|
323
|
+
return {
|
|
324
|
+
content: [{
|
|
325
|
+
type: "text",
|
|
326
|
+
text: err instanceof Error ? err.message : String(err)
|
|
327
|
+
}],
|
|
328
|
+
isError: true
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
throw new McpError(ErrorCode.InvalidParams, `Unknown migration: "${migrationName}". Available: ${MIGRATIONS.map((m) => m.name).join(", ")}`);
|
|
332
|
+
}
|
|
294
333
|
if (request.params.name === "pin_memory" || request.params.name === "unpin_memory") {
|
|
295
334
|
const id = request.params.arguments?.id;
|
|
296
335
|
if (typeof id !== "string" || id.trim() === "") throw new McpError(ErrorCode.InvalidParams, "id is required and must be a non-empty string");
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/server.ts","../src/index.ts"],"sourcesContent":["import type { MemoryType } from \"@membank/core\";\nimport {\n DatabaseManager,\n EmbeddingService,\n listMemoryTypes,\n MEMORY_TYPE_VALUES,\n MemoryRepository,\n ProjectRepository,\n QueryEngine,\n resolveProject,\n} from \"@membank/core\";\nimport { Server } from \"@modelcontextprotocol/sdk/server\";\nimport {\n CallToolRequestSchema,\n ErrorCode,\n ListToolsRequestSchema,\n McpError,\n} from \"@modelcontextprotocol/sdk/types.js\";\n\nconst SERVER_NAME = \"membank\";\nconst SERVER_VERSION = \"0.1.0\";\n\nexport interface CoreServices {\n db: DatabaseManager;\n embedding: EmbeddingService;\n repo: MemoryRepository;\n query: QueryEngine;\n projects: ProjectRepository;\n}\n\nexport interface ServerOptions {\n dbPath?: string;\n useInMemoryDb?: boolean;\n}\n\nexport function initCore(options: ServerOptions = {}): CoreServices {\n const db = options.useInMemoryDb\n ? DatabaseManager.openInMemory()\n : DatabaseManager.open(options.dbPath);\n const embedding = new EmbeddingService();\n const projects = new ProjectRepository(db);\n const repo = new MemoryRepository(db, embedding, projects);\n const query = new QueryEngine(db, embedding, repo);\n return { db, embedding, repo, query, projects };\n}\n\nexport function createServer(core: CoreServices): Server {\n const server = new Server(\n { name: SERVER_NAME, version: SERVER_VERSION },\n { capabilities: { tools: {} } }\n );\n\n server.setRequestHandler(ListToolsRequestSchema, () => ({\n tools: [\n {\n name: \"list_memory_types\",\n description: \"Returns the ordered list of memory type values supported by membank.\",\n inputSchema: { type: \"object\", properties: {}, required: [] },\n },\n {\n name: \"save_memory\",\n description:\n \"Save a new memory. Handles deduplication automatically — near-identical memories (cosine similarity >0.92, same type and scope) overwrite the existing record.\",\n inputSchema: {\n type: \"object\",\n properties: {\n content: { type: \"string\", description: \"Memory content to save\" },\n type: {\n type: \"string\",\n enum: [...MEMORY_TYPE_VALUES],\n description: \"Memory type\",\n },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional tags\",\n },\n scope: { type: \"string\", description: \"Scope (defaults to resolved project scope)\" },\n },\n required: [\"content\", \"type\"],\n },\n },\n {\n name: \"update_memory\",\n description: \"Update the content and/or tags of an existing memory by id.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Memory id to update\" },\n content: { type: \"string\", description: \"New content for the memory\" },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Replacement tags (optional)\",\n },\n },\n required: [\"id\", \"content\"],\n },\n },\n {\n name: \"delete_memory\",\n description: \"Delete a memory by id.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Memory id to delete\" },\n },\n required: [\"id\"],\n },\n },\n {\n name: \"query_memory\",\n description:\n \"Search memories by semantic similarity. Returns results ranked by confidence score.\",\n inputSchema: {\n type: \"object\",\n properties: {\n query: { type: \"string\", description: \"Search text\" },\n type: {\n type: \"string\",\n enum: [...MEMORY_TYPE_VALUES],\n description: \"Filter by memory type\",\n },\n scope: { type: \"string\", description: \"Filter by scope\" },\n limit: { type: \"number\", description: \"Maximum results to return (default 10)\" },\n },\n required: [\"query\"],\n },\n },\n {\n name: \"pin_memory\",\n description:\n \"Pin a memory by id. Pinned memories are always injected into the session context.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Memory id to pin\" },\n },\n required: [\"id\"],\n },\n },\n {\n name: \"unpin_memory\",\n description: \"Unpin a memory by id. Removes the memory from guaranteed session injection.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Memory id to unpin\" },\n },\n required: [\"id\"],\n },\n },\n ],\n }));\n\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n if (request.params.name === \"list_memory_types\") {\n try {\n return {\n content: [{ type: \"text\", text: JSON.stringify(listMemoryTypes()) }],\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n if (request.params.name === \"save_memory\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const content = args?.content;\n const type = args?.type;\n\n if (typeof content !== \"string\" || content.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"content is required and must be a non-empty string\"\n );\n }\n\n if (typeof type !== \"string\" || !(MEMORY_TYPE_VALUES as readonly string[]).includes(type)) {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"type is required and must be one of: correction, preference, decision, learning, fact\"\n );\n }\n\n const tags = Array.isArray(args?.tags) ? (args.tags as string[]) : undefined;\n\n let projectHash: string | undefined;\n if (typeof args?.scope === \"string\") {\n projectHash = args.scope;\n core.projects.upsertByHash(args.scope, `project-${args.scope.slice(0, 8)}`);\n } else {\n const project = await resolveProject();\n core.projects.upsertByHash(project.hash, project.name);\n projectHash = project.hash;\n }\n\n try {\n const memory = await core.repo.save({\n content,\n type: type as MemoryType,\n tags,\n projectHash,\n });\n\n return {\n content: [{ type: \"text\", text: JSON.stringify(memory) }],\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n if (request.params.name === \"update_memory\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const id = args?.id;\n const content = args?.content;\n\n if (typeof id !== \"string\" || id.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"id is required and must be a non-empty string\"\n );\n }\n\n if (typeof content !== \"string\" || content.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"content is required and must be a non-empty string\"\n );\n }\n\n const tags = Array.isArray(args?.tags) ? (args.tags as string[]) : undefined;\n\n try {\n const memory = await core.repo.update(id, { content, tags });\n return { content: [{ type: \"text\", text: JSON.stringify(memory) }] };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n if (request.params.name === \"delete_memory\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const id = args?.id;\n\n if (typeof id !== \"string\" || id.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"id is required and must be a non-empty string\"\n );\n }\n\n try {\n const exists =\n core.db.db\n .prepare<[string], { id: string }>(`SELECT id FROM memories WHERE id = ?`)\n .get(id) !== undefined;\n\n if (!exists) {\n return {\n content: [{ type: \"text\", text: `Memory not found: ${id}` }],\n isError: true,\n };\n }\n\n await core.repo.delete(id);\n return { content: [{ type: \"text\", text: JSON.stringify({ success: true, id }) }] };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n if (request.params.name === \"query_memory\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const queryText = args?.query;\n\n if (typeof queryText !== \"string\" || queryText.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"query is required and must be a non-empty string\"\n );\n }\n\n const type = args?.type as MemoryType | undefined;\n const projectHash = args?.scope as string | undefined;\n const limit = typeof args?.limit === \"number\" ? args.limit : 10;\n\n try {\n const results = await core.query.query({ query: queryText, type, projectHash, limit });\n\n const serialised = results.map((r) => ({\n id: r.id,\n content: r.content,\n type: r.type,\n tags: r.tags,\n projects: r.projects,\n pinned: r.pinned,\n score: r.score,\n }));\n\n return {\n content: [{ type: \"text\", text: JSON.stringify(serialised) }],\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n if (request.params.name === \"pin_memory\" || request.params.name === \"unpin_memory\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const id = args?.id;\n\n if (typeof id !== \"string\" || id.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"id is required and must be a non-empty string\"\n );\n }\n\n const pinned = request.params.name === \"pin_memory\";\n\n try {\n const memory = core.repo.setPin(id, pinned);\n return { content: [{ type: \"text\", text: JSON.stringify(memory) }] };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n throw new Error(`Unknown tool: ${request.params.name}`);\n });\n\n return server;\n}\n","import { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport type { CoreServices } from \"./server.js\";\nimport { createServer, initCore } from \"./server.js\";\n\nexport async function startServer(): Promise<void> {\n let core: CoreServices;\n try {\n core = initCore();\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n process.stderr.write(`membank: failed to initialise core: ${message}\\n`);\n process.exit(1);\n }\n\n const server = createServer(core);\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n"],"mappings":";;;;;AAmBA,MAAM,cAAc;AACpB,MAAM,iBAAiB;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sB;AAC5C,OAAM,OAAO,QAAQ,UAAU"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/server.ts","../src/index.ts"],"sourcesContent":["import type { MemoryType } from \"@membank/core\";\nimport {\n DatabaseManager,\n EmbeddingService,\n listMemoryTypes,\n MEMORY_TYPE_VALUES,\n MemoryRepository,\n MIGRATIONS,\n ProjectRepository,\n QueryEngine,\n resolveProject,\n runScopeToProjectsMigration,\n} from \"@membank/core\";\nimport { Server } from \"@modelcontextprotocol/sdk/server\";\nimport {\n CallToolRequestSchema,\n ErrorCode,\n ListToolsRequestSchema,\n McpError,\n} from \"@modelcontextprotocol/sdk/types.js\";\n\nconst SERVER_NAME = \"membank\";\nconst SERVER_VERSION = \"0.1.0\";\n\nexport interface CoreServices {\n db: DatabaseManager;\n embedding: EmbeddingService;\n repo: MemoryRepository;\n query: QueryEngine;\n projects: ProjectRepository;\n}\n\nexport interface ServerOptions {\n dbPath?: string;\n useInMemoryDb?: boolean;\n}\n\nexport function initCore(options: ServerOptions = {}): CoreServices {\n const db = options.useInMemoryDb\n ? DatabaseManager.openInMemory()\n : DatabaseManager.open(options.dbPath);\n const embedding = new EmbeddingService();\n const projects = new ProjectRepository(db);\n const repo = new MemoryRepository(db, embedding, projects);\n const query = new QueryEngine(db, embedding, repo);\n return { db, embedding, repo, query, projects };\n}\n\nexport function createServer(core: CoreServices): Server {\n const server = new Server(\n { name: SERVER_NAME, version: SERVER_VERSION },\n { capabilities: { tools: {} } }\n );\n\n server.setRequestHandler(ListToolsRequestSchema, () => ({\n tools: [\n {\n name: \"list_memory_types\",\n description: \"Returns the ordered list of memory type values supported by membank.\",\n inputSchema: { type: \"object\", properties: {}, required: [] },\n },\n {\n name: \"save_memory\",\n description:\n \"Save a new memory. Handles deduplication automatically — near-identical memories (cosine similarity >0.92, same type and project) overwrite the existing record.\",\n inputSchema: {\n type: \"object\",\n properties: {\n content: { type: \"string\", description: \"Memory content to save\" },\n type: {\n type: \"string\",\n enum: [...MEMORY_TYPE_VALUES],\n description: \"Memory type\",\n },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional tags\",\n },\n global: {\n type: \"boolean\",\n description: \"Save as a global memory, not tied to any project\",\n },\n },\n required: [\"content\", \"type\"],\n },\n },\n {\n name: \"update_memory\",\n description: \"Update the content and/or tags of an existing memory by id.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Memory id to update\" },\n content: { type: \"string\", description: \"New content for the memory\" },\n tags: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Replacement tags (optional)\",\n },\n },\n required: [\"id\", \"content\"],\n },\n },\n {\n name: \"delete_memory\",\n description: \"Delete a memory by id.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Memory id to delete\" },\n },\n required: [\"id\"],\n },\n },\n {\n name: \"query_memory\",\n description:\n \"Search memories by semantic similarity. Returns results ranked by confidence score.\",\n inputSchema: {\n type: \"object\",\n properties: {\n query: { type: \"string\", description: \"Search text\" },\n type: {\n type: \"string\",\n enum: [...MEMORY_TYPE_VALUES],\n description: \"Filter by memory type\",\n },\n limit: { type: \"number\", description: \"Maximum results to return (default 10)\" },\n },\n required: [\"query\"],\n },\n },\n {\n name: \"migrate\",\n description:\n 'List or run named data migrations. Use mode \"list\" to see available migrations; mode \"run\" with a migration name to execute one.',\n inputSchema: {\n type: \"object\",\n properties: {\n mode: {\n type: \"string\",\n enum: [\"list\", \"run\"],\n description: 'Mode: \"list\" to see available migrations, \"run\" to execute one',\n },\n name: {\n type: \"string\",\n description: 'Migration name (required when mode is \"run\")',\n },\n },\n required: [\"mode\"],\n },\n },\n {\n name: \"pin_memory\",\n description:\n \"Pin a memory by id. Pinned memories are always injected into the session context.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Memory id to pin\" },\n },\n required: [\"id\"],\n },\n },\n {\n name: \"unpin_memory\",\n description: \"Unpin a memory by id. Removes the memory from guaranteed session injection.\",\n inputSchema: {\n type: \"object\",\n properties: {\n id: { type: \"string\", description: \"Memory id to unpin\" },\n },\n required: [\"id\"],\n },\n },\n ],\n }));\n\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n if (request.params.name === \"list_memory_types\") {\n try {\n return {\n content: [{ type: \"text\", text: JSON.stringify(listMemoryTypes()) }],\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n if (request.params.name === \"save_memory\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const content = args?.content;\n const type = args?.type;\n\n if (typeof content !== \"string\" || content.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"content is required and must be a non-empty string\"\n );\n }\n\n if (typeof type !== \"string\" || !(MEMORY_TYPE_VALUES as readonly string[]).includes(type)) {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"type is required and must be one of: correction, preference, decision, learning, fact\"\n );\n }\n\n const tags = Array.isArray(args?.tags) ? (args.tags as string[]) : undefined;\n\n const projectScope = args?.global === true ? undefined : await resolveProject();\n\n try {\n const memory = await core.repo.save({\n content,\n type: type as MemoryType,\n tags,\n projectScope,\n });\n\n return {\n content: [{ type: \"text\", text: JSON.stringify(memory) }],\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n if (request.params.name === \"update_memory\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const id = args?.id;\n const content = args?.content;\n\n if (typeof id !== \"string\" || id.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"id is required and must be a non-empty string\"\n );\n }\n\n if (typeof content !== \"string\" || content.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"content is required and must be a non-empty string\"\n );\n }\n\n const tags = Array.isArray(args?.tags) ? (args.tags as string[]) : undefined;\n\n try {\n const memory = await core.repo.update(id, { content, tags });\n return { content: [{ type: \"text\", text: JSON.stringify(memory) }] };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n if (request.params.name === \"delete_memory\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const id = args?.id;\n\n if (typeof id !== \"string\" || id.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"id is required and must be a non-empty string\"\n );\n }\n\n try {\n const exists =\n core.db.db\n .prepare<[string], { id: string }>(`SELECT id FROM memories WHERE id = ?`)\n .get(id) !== undefined;\n\n if (!exists) {\n return {\n content: [{ type: \"text\", text: `Memory not found: ${id}` }],\n isError: true,\n };\n }\n\n await core.repo.delete(id);\n return { content: [{ type: \"text\", text: JSON.stringify({ success: true, id }) }] };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n if (request.params.name === \"query_memory\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const queryText = args?.query;\n\n if (typeof queryText !== \"string\" || queryText.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"query is required and must be a non-empty string\"\n );\n }\n\n const type = args?.type as MemoryType | undefined;\n const limit = typeof args?.limit === \"number\" ? args.limit : 10;\n\n try {\n const results = await core.query.query({ query: queryText, type, limit });\n\n const serialised = results.map((r) => ({\n id: r.id,\n content: r.content,\n type: r.type,\n tags: r.tags,\n projects: r.projects,\n pinned: r.pinned,\n score: r.score,\n }));\n\n return {\n content: [{ type: \"text\", text: JSON.stringify(serialised) }],\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n if (request.params.name === \"migrate\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const mode = args?.mode;\n\n if (mode !== \"list\" && mode !== \"run\") {\n throw new McpError(ErrorCode.InvalidParams, 'mode must be \"list\" or \"run\"');\n }\n\n if (mode === \"list\") {\n return {\n content: [{ type: \"text\", text: JSON.stringify(MIGRATIONS) }],\n };\n }\n\n const migrationName = args?.name;\n if (typeof migrationName !== \"string\" || migrationName.trim() === \"\") {\n throw new McpError(ErrorCode.InvalidParams, \"name is required for run mode\");\n }\n\n if (migrationName === \"scope-to-projects\") {\n try {\n const result = await runScopeToProjectsMigration(core.projects);\n if (result === null) {\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify({ error: \"No project found for current directory.\" }),\n },\n ],\n isError: true,\n };\n }\n return {\n content: [{ type: \"text\", text: JSON.stringify(result) }],\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n throw new McpError(\n ErrorCode.InvalidParams,\n `Unknown migration: \"${migrationName}\". Available: ${MIGRATIONS.map((m) => m.name).join(\", \")}`\n );\n }\n\n if (request.params.name === \"pin_memory\" || request.params.name === \"unpin_memory\") {\n const args = request.params.arguments as Record<string, unknown> | undefined;\n const id = args?.id;\n\n if (typeof id !== \"string\" || id.trim() === \"\") {\n throw new McpError(\n ErrorCode.InvalidParams,\n \"id is required and must be a non-empty string\"\n );\n }\n\n const pinned = request.params.name === \"pin_memory\";\n\n try {\n const memory = core.repo.setPin(id, pinned);\n return { content: [{ type: \"text\", text: JSON.stringify(memory) }] };\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n return { content: [{ type: \"text\", text: message }], isError: true };\n }\n }\n\n throw new Error(`Unknown tool: ${request.params.name}`);\n });\n\n return server;\n}\n","import { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport type { CoreServices } from \"./server.js\";\nimport { createServer, initCore } from \"./server.js\";\n\nexport async function startServer(): Promise<void> {\n let core: CoreServices;\n try {\n core = initCore();\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n process.stderr.write(`membank: failed to initialise core: ${message}\\n`);\n process.exit(1);\n }\n\n const server = createServer(core);\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n"],"mappings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20
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
21
|
-
"@membank/core": "0.6.
|
|
21
|
+
"@membank/core": "0.6.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^25.6.0",
|