Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugin/.mcp.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"mcpServers": {
"agentmemory": {
"cwd": ".",
"type": "stdio",
"command": "node",
"args": ["./dist/standalone.mjs"],
"args": ["${CLAUDE_PLUGIN_ROOT}/dist/standalone.mjs"],
"env": {
"AGENTMEMORY_URL": "${AGENTMEMORY_URL:-http://localhost:3111}",
"AGENTMEMORY_SECRET": "${AGENTMEMORY_SECRET:-}",
Expand Down
43 changes: 29 additions & 14 deletions plugin/dist/standalone.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ const CORE_TOOLS = [
project: {
type: "string",
description: "Stable canonical project identifier this memory belongs to (e.g. a slug, UUID, or registry key). Must match the value used when the session was started. Do not use filesystem paths or ad-hoc display names — those change across machines and will silently break project scoping."
},
agentId: {
type: "string",
description: "Agent identity to scope this memory to. When set, agent-scoped recall and search only surface it for the same agentId. Omit for shared memory."
}
},
required: ["content"]
Expand Down Expand Up @@ -1331,9 +1335,8 @@ function loadEnvFile() {
envFileCache = {};
return envFileCache;
}
const content = readFileSync(ENV_FILE, "utf-8");
const vars = {};
for (const line of content.split("\n")) {
for (const line of readFileSync(ENV_FILE, "utf-8").split("\n")) {
const trimmed = line.trim();
if (!trimmed || trimmed.startsWith("#")) continue;
const eqIdx = trimmed.indexOf("=");
Expand All @@ -1360,12 +1363,14 @@ function getMergedEnv(overrides) {
...overrides
};
}
//#endregion
//#region src/config.ts
function getStandalonePersistPath() {
return getMergedEnv()["STANDALONE_PERSIST_PATH"] || join(homedir(), ".agentmemory", "standalone.json");
}
//#endregion
//#region src/version.ts
const VERSION = "0.9.28-codex.2";
const VERSION = "0.9.29-codex.1";
createRequire(import.meta.url);
//#endregion
//#region src/state/schema.ts
Expand Down Expand Up @@ -1514,10 +1519,15 @@ const IMPLEMENTED_TOOLS = new Set([
"memory_audit",
"memory_governance_delete"
]);
const SUPPORTED_PROTOCOL_VERSIONS = [
"2025-11-25",
"2025-06-18",
"2025-03-26",
"2024-11-05"
];
const SERVER_INFO = {
name: "agentmemory",
version: VERSION,
protocolVersion: "2024-11-05"
version: VERSION
};
let kv;
let modeAnnounced = false;
Expand Down Expand Up @@ -1566,6 +1576,7 @@ function validate(toolName, args) {
v.concepts = normalizeList(args["concepts"]);
v.files = normalizeList(args["files"]);
if (typeof args["project"] === "string" && args["project"].trim()) v.project = args["project"].trim();
if (typeof args["agentId"] === "string" && args["agentId"].trim()) v.agentId = args["agentId"].trim();
return v;
}
case "memory_recall":
Expand Down Expand Up @@ -1612,7 +1623,8 @@ async function handleProxy(v, handle) {
type: v.type,
concepts: v.concepts,
files: v.files,
...v.project !== void 0 && { project: v.project }
...v.project !== void 0 && { project: v.project },
...v.agentId !== void 0 && { agentId: v.agentId }
})
}));
case "memory_recall": {
Expand Down Expand Up @@ -1789,14 +1801,17 @@ async function handleToolsList() {
}
const transport = createStdioTransport(async (method, params) => {
switch (method) {
case "initialize": return {
protocolVersion: SERVER_INFO.protocolVersion,
capabilities: { tools: { listChanged: false } },
serverInfo: {
name: SERVER_INFO.name,
version: SERVER_INFO.version
}
};
case "initialize": {
const requested = params?.protocolVersion;
return {
protocolVersion: typeof requested === "string" && SUPPORTED_PROTOCOL_VERSIONS.includes(requested) ? requested : SUPPORTED_PROTOCOL_VERSIONS[0],
capabilities: { tools: { listChanged: false } },
serverInfo: {
name: SERVER_INFO.name,
version: SERVER_INFO.version
}
};
}
case "notifications/initialized": return {};
case "tools/list": return handleToolsList();
case "tools/call": {
Expand Down
Loading