From ebe7ebf17a663145f404873d3ed6b06b993bf624 Mon Sep 17 00:00:00 2001 From: Apunkt Date: Mon, 25 May 2026 15:40:53 +0200 Subject: [PATCH] feat(mcp): add memory_session_context tool for opencode session recall --- mcp-wrapper/src/tools.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mcp-wrapper/src/tools.ts b/mcp-wrapper/src/tools.ts index a43ed71..6201e74 100644 --- a/mcp-wrapper/src/tools.ts +++ b/mcp-wrapper/src/tools.ts @@ -24,6 +24,7 @@ export const TOOL_NAMES = [ "memory_contradict", "memory_capture", "memory_consolidate", + "memory_session_context", "profile_get_set", "curiosity_pending", "schema_list", @@ -185,6 +186,18 @@ export const toolSchemas: Record = { }, }, }, + memory_session_context: { + name: "memory_session_context", + description: + "Retrieve the current session context payload (identity, session handle, " + + "topic cluster, rich club). Call at session start to load relevant " + + "background memory. Returns JSON with l0, l1, l2, rich_club, and " + + "compact_handle fields.", + inputSchema: { + type: "object", + properties: {}, + }, + }, profile_get_set: { name: "profile_get_set", description: @@ -348,6 +361,8 @@ export async function invokeTool( return bridge.call("memory_capture", args); case "memory_consolidate": return bridge.call("memory_consolidate", args); + case "memory_session_context": + return bridge.call("session_start_payload", {}); case "profile_get_set": { const op = args.operation as string; if (op === "get") {