diff --git a/apps/mcp/.dev.vars.example b/apps/mcp/.dev.vars.example index dfc969e5..2e18c643 100644 --- a/apps/mcp/.dev.vars.example +++ b/apps/mcp/.dev.vars.example @@ -3,6 +3,8 @@ API_URL= MCP_URL= +# OAuth metadata is advertised from this, so set it to your local MCP URL + /mcp (defaults to prod). +MCP_RESOURCE= #(optional) POSTHOG_API_KEY= \ No newline at end of file diff --git a/apps/mcp/src/server/client/index.ts b/apps/mcp/src/server/client/index.ts index 0835ca32..3052d898 100644 --- a/apps/mcp/src/server/client/index.ts +++ b/apps/mcp/src/server/client/index.ts @@ -196,7 +196,7 @@ export class SupermemoryClient { async createMemory( content: string, - metadata?: Record, + metadata?: Record, ): Promise<{ id: string; status: string; namespace: string }> { try { const result = await this.client.add(this.namespace, { diff --git a/apps/mcp/src/server/format.test.ts b/apps/mcp/src/server/format.test.ts index 42d0ec3a..a4b9ff36 100644 --- a/apps/mcp/src/server/format.test.ts +++ b/apps/mcp/src/server/format.test.ts @@ -65,7 +65,7 @@ describe("formatMemoryEntriesList", () => { ) expect(firstPage).toBe( - "No active memories on page 1 (2 pages total).\n\nMore available - call listMemories with page: 2.", + "No active memories on page 1 (2 pages total).\n\nMore available - call list_memories with page: 2.", ) expect(secondPage).toContain("[still-active] Current fact") }) diff --git a/apps/mcp/src/server/format.ts b/apps/mcp/src/server/format.ts index 387f887c..963f1ccf 100644 --- a/apps/mcp/src/server/format.ts +++ b/apps/mcp/src/server/format.ts @@ -91,7 +91,7 @@ export function formatMemoryEntriesList( if (pagination.currentPage < pagination.totalPages) { parts.push( "", - `More available - call listMemories with page: ${pagination.currentPage + 1}.`, + `More available - call list_memories with page: ${pagination.currentPage + 1}.`, ) } return parts.join("\n") diff --git a/apps/mcp/src/server/tools/add-memory.ts b/apps/mcp/src/server/tools/add-memory.ts index e2dd70a4..6cad7416 100644 --- a/apps/mcp/src/server/tools/add-memory.ts +++ b/apps/mcp/src/server/tools/add-memory.ts @@ -25,7 +25,14 @@ export function register(deps: ToolDeps) { ), namespace: optionalNamespaceSchema, ...legacyNamespaceInput, - metadata: z.record(z.string(), z.unknown()).optional().describe("Optional metadata to attach to the saved memory"), + // v5 metadata values are flat: string, number, boolean or string list. + metadata: z + .record( + z.string(), + z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]), + ) + .optional() + .describe("Optional metadata to attach to the saved memory"), }) deps.server.registerTool(