From 343e8b2d1e5a462a7ba7758cb28708fda1bd936b Mon Sep 17 00:00:00 2001 From: Rohit Ghumare Date: Wed, 27 May 2026 12:48:29 +0100 Subject: [PATCH 1/4] feat(connect): Warp adapter + skills surface via Claude Code plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Warp stores MCP config at ~/.warp/.mcp.json with the same mcpServers schema as Claude Code, so the shared createJsonMcpAdapter wires it in 17 lines. Adds Warp to the connect surface (12 adapters total) and the README agents grid. Native-citizen second-class win: Warp's skill discovery already scans .claude/skills/ — installing the existing agentmemory Claude Code plugin makes the 8 memory skills (remember, recall, recap, handoff, forget, commit-context, commit-history, session-history) appear in Warp's slash-command palette with zero extra wiring. Tests bumped: ADAPTERS.length 11 -> 12, knownAgents includes 'warp', new connect-new-agents Warp install case. --- README.md | 6 +++++ src/cli/connect/index.ts | 2 ++ src/cli/connect/warp.ts | 19 ++++++++++++++++ test/cli-connect.test.ts | 4 ++-- test/connect-new-agents.test.ts | 40 +++++++++++++++++++++++++++++++-- 5 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 src/cli/connect/warp.ts diff --git a/README.md b/README.md index 2c29969d94..984c5411fd 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,11 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen Roo Code
MCP server + +Warp
+Warp
+connect + MCP + skills + @@ -558,6 +563,7 @@ The agentmemory entry is the **same MCP server block** across every host that us | **Qwen Code** | `~/.qwen/settings.json` | `agentmemory connect qwen` writes the standard `mcpServers` block. Hook payload is field-compatible with Claude Code, so the existing 12-hook scripts work without modification — wire them via the `hooks` section in the same `settings.json`. | | **Antigravity** (replaces Gemini CLI) | `mcp_config.json` (in Antigravity's User dir) | `agentmemory connect antigravity` writes the standard `mcpServers` block. macOS: `~/Library/Application Support/Antigravity/User/`. Linux: `~/.config/Antigravity/User/`. Use after the 2026-06-18 Gemini CLI sunset. | | **Kiro** | `~/.kiro/settings/mcp.json` | `agentmemory connect kiro` writes the user-level config. Workspace overrides go in `.kiro/settings/mcp.json` next to your code. | +| **Warp** | `~/.warp/.mcp.json` | `agentmemory connect warp` writes the standard `mcpServers` block. Warp also auto-discovers skills from `.claude/skills/` — once the Claude Code plugin is installed the 8 agentmemory skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `commit-context`, `commit-history`, `session-history`) appear natively in Warp's slash-command palette. | | **Goose** | Goose MCP settings UI | Same `mcpServers` block. | | **Aider** | n/a | Talk to the REST API directly: `curl -X POST http://localhost:3111/agentmemory/smart-search -d '{"query": "auth"}'`. | | **Any agent (32+)** | n/a | `npx skillkit install agentmemory` auto-detects the host and merges. | diff --git a/src/cli/connect/index.ts b/src/cli/connect/index.ts index b7fa2e718b..51fbcc6089 100644 --- a/src/cli/connect/index.ts +++ b/src/cli/connect/index.ts @@ -12,6 +12,7 @@ import { adapter as openclaw } from "./openclaw.js"; import { adapter as openhuman } from "./openhuman.js"; import { adapter as pi } from "./pi.js"; import { adapter as qwen } from "./qwen.js"; +import { adapter as warp } from "./warp.js"; export const ADAPTERS: readonly ConnectAdapter[] = [ claudeCode, @@ -21,6 +22,7 @@ export const ADAPTERS: readonly ConnectAdapter[] = [ qwen, antigravity, kiro, + warp, openclaw, hermes, pi, diff --git a/src/cli/connect/warp.ts b/src/cli/connect/warp.ts new file mode 100644 index 0000000000..5ce87f5151 --- /dev/null +++ b/src/cli/connect/warp.ts @@ -0,0 +1,19 @@ +import { homedir } from "node:os"; +import { join } from "node:path"; +import { createJsonMcpAdapter } from "./json-mcp-adapter.js"; + +// Warp stores MCP server config at ~/.warp/.mcp.json with the +// canonical `mcpServers` wrapper — identical schema to Claude Code. +// Warp also auto-discovers skills from .claude/skills/ so the +// agentmemory plugin's 8 skills are surfaced natively once the +// Claude Code plugin is installed. +// Source: docs.warp.dev/agent-platform/capabilities/mcp/ +export const adapter = createJsonMcpAdapter({ + name: "warp", + displayName: "Warp", + detectDir: join(homedir(), ".warp"), + configPath: join(homedir(), ".warp", ".mcp.json"), + docs: "https://github.com/rohitg00/agentmemory#other-agents", + protocolNote: + "→ Using MCP via ~/.warp/.mcp.json. Skills auto-discover from .claude/skills/ if the Claude Code plugin is also installed.", +}); diff --git a/test/cli-connect.test.ts b/test/cli-connect.test.ts index 11b2395b18..5c380176aa 100644 --- a/test/cli-connect.test.ts +++ b/test/cli-connect.test.ts @@ -30,7 +30,6 @@ describe("agentmemory connect — dispatcher", () => { }); it("ships the supported agent list", () => { - // Bumped to 11 after adding Qwen Code + Antigravity + Kiro. expect(knownAgents().sort()).toEqual( [ "antigravity", @@ -44,9 +43,10 @@ describe("agentmemory connect — dispatcher", () => { "openhuman", "pi", "qwen", + "warp", ].sort(), ); - expect(ADAPTERS.length).toBe(11); + expect(ADAPTERS.length).toBe(12); }); it("every adapter exposes detect() and install()", () => { diff --git a/test/connect-new-agents.test.ts b/test/connect-new-agents.test.ts index d73f1c0f76..f7b332aae7 100644 --- a/test/connect-new-agents.test.ts +++ b/test/connect-new-agents.test.ts @@ -114,16 +114,52 @@ describe("connect: Kiro", () => { }); }); -describe("connect: all three agents registered in ADAPTERS", () => { +describe("connect: Warp", () => { + let home: string; + const ORIG = process.env["HOME"]; + beforeEach(() => { + home = freshHome(); + vi.resetModules(); + process.env["HOME"] = home; + }); + afterEach(() => { + process.env["HOME"] = ORIG; + rmSync(home, { recursive: true, force: true }); + }); + + it("does not detect when ~/.warp/ is absent", async () => { + const { adapter } = await import("../src/cli/connect/warp.js"); + expect(adapter.detect()).toBe(false); + }); + + it("writes mcpServers.agentmemory to ~/.warp/.mcp.json", async () => { + mkdirSync(join(home, ".warp"), { recursive: true }); + const { adapter } = await import("../src/cli/connect/warp.js"); + expect(adapter.detect()).toBe(true); + const result = await adapter.install({ dryRun: false, force: false }); + expect(result.kind).toBe("installed"); + const cfgPath = join(home, ".warp", ".mcp.json"); + expect(existsSync(cfgPath)).toBe(true); + const cfg = JSON.parse(readFileSync(cfgPath, "utf-8")); + expect(cfg.mcpServers.agentmemory.command).toBe("npx"); + expect(cfg.mcpServers.agentmemory.args).toContain("@agentmemory/mcp"); + expect(cfg.mcpServers.agentmemory.env.AGENTMEMORY_URL).toMatch( + /\$\{AGENTMEMORY_URL:-/, + ); + }); +}); + +describe("connect: all four agents registered in ADAPTERS", () => { beforeEach(() => { vi.resetModules(); }); - it("knownAgents includes qwen, antigravity, kiro", async () => { + it("knownAgents includes qwen, antigravity, kiro, warp", async () => { const { knownAgents } = await import("../src/cli/connect/index.js"); const agents = knownAgents(); expect(agents).toContain("qwen"); expect(agents).toContain("antigravity"); expect(agents).toContain("kiro"); + expect(agents).toContain("warp"); }); }); From 03ac97536fbf24c1ef34899c63a6a7942747538b Mon Sep 17 00:00:00 2001 From: Rohit Ghumare Date: Wed, 27 May 2026 13:06:31 +0100 Subject: [PATCH 2/4] feat(connect): Cline + Continue.dev + Zed + Droid adapters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ADAPTERS bumped 12 -> 16. Schemas verified via context7 (Cline, Continue, Goose) + WebFetch (Zed, Droid). - Cline: ~/.cline/mcp.json, same Claude-style mcpServers wrapper. - Droid (Factory.ai): ~/.factory/mcp.json, same mcpServers wrapper with optional type:stdio per entry. - Zed: ~/.config/zed/settings.json, uses 'context_servers' key (NOT mcpServers); createJsonMcpAdapter now accepts wrapperKey override. - Continue.dev: ~/.continue/config.json, mcpServers is an ARRAY of named entries (not object) — custom adapter writes array form. Goose deferred — its YAML config uses 'extensions:' with 'cmd' (not 'command') and adding a YAML dep for one adapter isn't worth it. README documents the manual path (goose configure → Add Extension → MCP). Tests: 8 new install + detect cases under connect-new-agents.test.ts. ADAPTERS.length 12 -> 16. All 1181 unit tests pass. --- README.md | 6 +- src/cli/connect/cline.ts | 19 ++++ src/cli/connect/continue.ts | 115 +++++++++++++++++++++ src/cli/connect/droid.ts | 19 ++++ src/cli/connect/index.ts | 8 ++ src/cli/connect/json-mcp-adapter.ts | 22 ++-- src/cli/connect/zed.ts | 25 +++++ test/cli-connect.test.ts | 6 +- test/connect-new-agents.test.ts | 153 ++++++++++++++++++++++++++-- 9 files changed, 356 insertions(+), 17 deletions(-) create mode 100644 src/cli/connect/cline.ts create mode 100644 src/cli/connect/continue.ts create mode 100644 src/cli/connect/droid.ts create mode 100644 src/cli/connect/zed.ts diff --git a/README.md b/README.md index 984c5411fd..697fead00c 100644 --- a/README.md +++ b/README.md @@ -564,7 +564,11 @@ The agentmemory entry is the **same MCP server block** across every host that us | **Antigravity** (replaces Gemini CLI) | `mcp_config.json` (in Antigravity's User dir) | `agentmemory connect antigravity` writes the standard `mcpServers` block. macOS: `~/Library/Application Support/Antigravity/User/`. Linux: `~/.config/Antigravity/User/`. Use after the 2026-06-18 Gemini CLI sunset. | | **Kiro** | `~/.kiro/settings/mcp.json` | `agentmemory connect kiro` writes the user-level config. Workspace overrides go in `.kiro/settings/mcp.json` next to your code. | | **Warp** | `~/.warp/.mcp.json` | `agentmemory connect warp` writes the standard `mcpServers` block. Warp also auto-discovers skills from `.claude/skills/` — once the Claude Code plugin is installed the 8 agentmemory skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `commit-context`, `commit-history`, `session-history`) appear natively in Warp's slash-command palette. | -| **Goose** | Goose MCP settings UI | Same `mcpServers` block. | +| **Cline (CLI)** | `~/.cline/mcp.json` | `agentmemory connect cline` writes the standard `mcpServers` block. VS Code extension users: paste the same block via Cline Settings → MCP Servers → Edit JSON. | +| **Continue.dev** | `~/.continue/config.json` | `agentmemory connect continue` writes a `mcpServers` array entry (Continue uses array form, not object). YAML config (`config.yaml`) users: add the same fields under `mcpServers:` as a list item. | +| **Zed** | `~/.config/zed/settings.json` | `agentmemory connect zed` writes under `context_servers` (Zed's key, NOT `mcpServers`). Remote MCP servers can be wired via `{"url": "..."}` instead. | +| **Droid (Factory.ai)** | `~/.factory/mcp.json` | `agentmemory connect droid` writes the standard `mcpServers` block. Project-scoped overrides go in `/.factory/mcp.json`. The `/mcp` slash command inside droid lists configured servers. | +| **Goose** | Goose MCP settings UI | Same `mcpServers` block — use `goose configure` → Add Extension → MCP. Direct YAML edit at `~/.config/goose/config.yaml` is supported but the schema uses `extensions:` + `cmd` (not `mcpServers:` + `command`). | | **Aider** | n/a | Talk to the REST API directly: `curl -X POST http://localhost:3111/agentmemory/smart-search -d '{"query": "auth"}'`. | | **Any agent (32+)** | n/a | `npx skillkit install agentmemory` auto-detects the host and merges. | diff --git a/src/cli/connect/cline.ts b/src/cli/connect/cline.ts new file mode 100644 index 0000000000..3fb44aedf2 --- /dev/null +++ b/src/cli/connect/cline.ts @@ -0,0 +1,19 @@ +import { homedir } from "node:os"; +import { join } from "node:path"; +import { createJsonMcpAdapter } from "./json-mcp-adapter.js"; + +// Cline CLI stores MCP server config at ~/.cline/mcp.json with the +// canonical `mcpServers` wrapper — same schema as Claude Code with +// optional `disabled` and `autoApprove` fields per entry. +// VS Code extension users manage MCP through Cline's Settings UI; +// this adapter targets the standalone CLI surface. +// Source: github.com/cline/cline/blob/main/docs/mcp/mcp-overview.mdx +export const adapter = createJsonMcpAdapter({ + name: "cline", + displayName: "Cline", + detectDir: join(homedir(), ".cline"), + configPath: join(homedir(), ".cline", "mcp.json"), + docs: "https://github.com/rohitg00/agentmemory#other-agents", + protocolNote: + "→ Using MCP via ~/.cline/mcp.json (CLI). VS Code users: add the same block via Cline Settings → MCP Servers → Edit JSON.", +}); diff --git a/src/cli/connect/continue.ts b/src/cli/connect/continue.ts new file mode 100644 index 0000000000..82ef32c7ac --- /dev/null +++ b/src/cli/connect/continue.ts @@ -0,0 +1,115 @@ +import { existsSync, mkdirSync } from "node:fs"; +import { homedir } from "node:os"; +import { dirname, join } from "node:path"; +import * as p from "@clack/prompts"; +import type { ConnectAdapter, ConnectOptions, ConnectResult } from "./types.js"; +import { + AGENTMEMORY_MCP_BLOCK, + backupFile, + logAlreadyWired, + logBackup, + logInstalled, + readJsonSafe, + writeJsonAtomic, +} from "./util.js"; + +// Continue.dev writes its config as ~/.continue/config.json (or .yaml). +// Schema diverges from Claude Code: `mcpServers` is an ARRAY of named +// entries, not an object keyed by name. We target the JSON form so we +// don't need a YAML dependency; users on YAML config can convert with +// `continue config migrate` or wire manually. +// Source: github.com/continuedev/continue/blob/main/docs/customize/deep-dives/mcp.mdx +const CONTINUE_DIR = join(homedir(), ".continue"); +const CONFIG_PATH = join(CONTINUE_DIR, "config.json"); + +type ContinueEntry = { + name: string; + command: string; + args: string[]; + env?: Record; +}; + +type ContinueConfig = { + mcpServers?: ContinueEntry[]; + [key: string]: unknown; +}; + +function buildEntry(): ContinueEntry { + return { + name: "agentmemory", + command: AGENTMEMORY_MCP_BLOCK.command, + args: [...AGENTMEMORY_MCP_BLOCK.args], + env: { ...AGENTMEMORY_MCP_BLOCK.env }, + }; +} + +function entryIsAgentmemory(entry: ContinueEntry | undefined): boolean { + if (!entry) return false; + return entry.name === "agentmemory" && entry.args.includes("@agentmemory/mcp"); +} + +export const adapter: ConnectAdapter = { + name: "continue", + displayName: "Continue", + docs: "https://github.com/rohitg00/agentmemory#other-agents", + protocolNote: + "→ Using MCP via ~/.continue/config.json (array form). YAML config users: add the same block under `mcpServers:` in config.yaml.", + + detect(): boolean { + return existsSync(CONTINUE_DIR); + }, + + async install(opts: ConnectOptions): Promise { + const existing = readJsonSafe(CONFIG_PATH); + const next: ContinueConfig = existing ? { ...existing } : {}; + const servers = Array.isArray(next.mcpServers) + ? [...next.mcpServers] + : []; + + const idx = servers.findIndex((s) => s?.name === "agentmemory"); + const alreadyHas = idx >= 0 && entryIsAgentmemory(servers[idx]); + if (alreadyHas && !opts.force) { + logAlreadyWired("Continue", CONFIG_PATH); + return { kind: "already-wired", mutatedPath: CONFIG_PATH }; + } + + if (opts.dryRun) { + p.log.info( + `[dry-run] Would ${alreadyHas ? "overwrite" : "add"} mcpServers[agentmemory] in ${CONFIG_PATH}`, + ); + return { kind: "installed", mutatedPath: CONFIG_PATH }; + } + + let backupPath: string | undefined; + if (existsSync(CONFIG_PATH)) { + backupPath = backupFile(CONFIG_PATH, "continue"); + logBackup(backupPath); + } else { + mkdirSync(dirname(CONFIG_PATH), { recursive: true }); + } + + const entry = buildEntry(); + if (idx >= 0) servers[idx] = entry; + else servers.push(entry); + next.mcpServers = servers; + writeJsonAtomic(CONFIG_PATH, next); + + const verify = readJsonSafe(CONFIG_PATH); + const verifyEntry = verify?.mcpServers?.find( + (s) => s?.name === "agentmemory", + ); + if (!entryIsAgentmemory(verifyEntry)) { + p.log.error( + `Verification failed: ${CONFIG_PATH} did not contain mcpServers[agentmemory] after write.`, + ); + return { kind: "skipped", reason: "verification-failed" }; + } + + logInstalled("Continue", CONFIG_PATH); + return { + kind: "installed", + mutatedPath: CONFIG_PATH, + ...(backupPath !== undefined && { backupPath }), + }; + }, +}; diff --git a/src/cli/connect/droid.ts b/src/cli/connect/droid.ts new file mode 100644 index 0000000000..a58ef40c48 --- /dev/null +++ b/src/cli/connect/droid.ts @@ -0,0 +1,19 @@ +import { homedir } from "node:os"; +import { join } from "node:path"; +import { createJsonMcpAdapter } from "./json-mcp-adapter.js"; + +// Factory.ai's Droid CLI stores MCP server config at ~/.factory/mcp.json +// with the canonical `mcpServers` wrapper. Project-scoped overrides live +// at /.factory/mcp.json. Each entry adds an optional `type` field +// ("stdio" | "http") and `disabled` boolean — agentmemory's stdio block +// works against the same shape without needing the explicit type tag. +// Source: docs.factory.ai/cli/configuration/mcp +export const adapter = createJsonMcpAdapter({ + name: "droid", + displayName: "Droid (Factory.ai)", + detectDir: join(homedir(), ".factory"), + configPath: join(homedir(), ".factory", "mcp.json"), + docs: "https://github.com/rohitg00/agentmemory#other-agents", + protocolNote: + "→ Using MCP via ~/.factory/mcp.json. The `/mcp` slash command inside droid lists configured servers.", +}); diff --git a/src/cli/connect/index.ts b/src/cli/connect/index.ts index 51fbcc6089..6fe4f54fa5 100644 --- a/src/cli/connect/index.ts +++ b/src/cli/connect/index.ts @@ -3,8 +3,11 @@ import * as p from "@clack/prompts"; import type { ConnectAdapter, ConnectOptions, ConnectResult } from "./types.js"; import { adapter as antigravity } from "./antigravity.js"; import { adapter as claudeCode } from "./claude-code.js"; +import { adapter as cline } from "./cline.js"; import { adapter as codex } from "./codex.js"; +import { adapter as continueDev } from "./continue.js"; import { adapter as cursor } from "./cursor.js"; +import { adapter as droid } from "./droid.js"; import { adapter as geminiCli } from "./gemini-cli.js"; import { adapter as hermes } from "./hermes.js"; import { adapter as kiro } from "./kiro.js"; @@ -13,6 +16,7 @@ import { adapter as openhuman } from "./openhuman.js"; import { adapter as pi } from "./pi.js"; import { adapter as qwen } from "./qwen.js"; import { adapter as warp } from "./warp.js"; +import { adapter as zed } from "./zed.js"; export const ADAPTERS: readonly ConnectAdapter[] = [ claudeCode, @@ -23,6 +27,10 @@ export const ADAPTERS: readonly ConnectAdapter[] = [ antigravity, kiro, warp, + cline, + continueDev, + zed, + droid, openclaw, hermes, pi, diff --git a/src/cli/connect/json-mcp-adapter.ts b/src/cli/connect/json-mcp-adapter.ts index d72eb45cf5..d50e8bb5e4 100644 --- a/src/cli/connect/json-mcp-adapter.ts +++ b/src/cli/connect/json-mcp-adapter.ts @@ -19,13 +19,13 @@ export type JsonMcpAdapterConfig = { configPath: string; docs?: string; protocolNote?: string; + // Wrapper key under which servers live. Default "mcpServers". + // Zed uses "context_servers"; otherwise same shape. + wrapperKey?: string; }; type McpEntry = typeof AGENTMEMORY_MCP_BLOCK; -type McpConfig = { - mcpServers?: Record; - [key: string]: unknown; -}; +type McpConfig = Record; function entryMatches(entry: unknown): boolean { if (!entry || typeof entry !== "object") return false; @@ -38,6 +38,7 @@ function entryMatches(entry: unknown): boolean { export function createJsonMcpAdapter( config: JsonMcpAdapterConfig, ): ConnectAdapter { + const wrapperKey = config.wrapperKey ?? "mcpServers"; return { name: config.name, displayName: config.displayName, @@ -54,7 +55,7 @@ export function createJsonMcpAdapter( const existing = readJsonSafe(config.configPath); const next: McpConfig = existing ? { ...existing } : {}; const servers: Record = { - ...((next.mcpServers as Record) ?? {}), + ...((next[wrapperKey] as Record) ?? {}), }; const alreadyHas = entryMatches(servers["agentmemory"]); @@ -65,7 +66,7 @@ export function createJsonMcpAdapter( if (opts.dryRun) { p.log.info( - `[dry-run] Would ${alreadyHas ? "overwrite" : "add"} mcpServers.agentmemory in ${config.configPath}`, + `[dry-run] Would ${alreadyHas ? "overwrite" : "add"} ${wrapperKey}.agentmemory in ${config.configPath}`, ); return { kind: "installed", mutatedPath: config.configPath }; } @@ -79,13 +80,16 @@ export function createJsonMcpAdapter( } servers["agentmemory"] = AGENTMEMORY_MCP_BLOCK; - next.mcpServers = servers; + next[wrapperKey] = servers; writeJsonAtomic(config.configPath, next); const verify = readJsonSafe(config.configPath); - if (!entryMatches(verify?.mcpServers?.["agentmemory"])) { + const verifyServers = verify?.[wrapperKey] as + | Record + | undefined; + if (!entryMatches(verifyServers?.["agentmemory"])) { p.log.error( - `Verification failed: ${config.configPath} did not contain mcpServers.agentmemory after write.`, + `Verification failed: ${config.configPath} did not contain ${wrapperKey}.agentmemory after write.`, ); return { kind: "skipped", reason: "verification-failed" }; } diff --git a/src/cli/connect/zed.ts b/src/cli/connect/zed.ts new file mode 100644 index 0000000000..4bc5695864 --- /dev/null +++ b/src/cli/connect/zed.ts @@ -0,0 +1,25 @@ +import { homedir, platform } from "node:os"; +import { join } from "node:path"; +import { createJsonMcpAdapter } from "./json-mcp-adapter.js"; + +// Zed stores its settings (including MCP servers) under "context_servers" +// in settings.json — NOT "mcpServers". macOS uses +// ~/.config/zed/settings.json by default; Zed also reads from +// ~/Library/Application Support/Zed/settings.json on macOS but the +// XDG path is the documented primary. Linux: ~/.config/zed/settings.json. +// Source: zed.dev/docs/ai/mcp +const isMac = platform() === "darwin"; +const zedConfigDir = isMac + ? join(homedir(), ".config", "zed") + : join(homedir(), ".config", "zed"); + +export const adapter = createJsonMcpAdapter({ + name: "zed", + displayName: "Zed", + detectDir: zedConfigDir, + configPath: join(zedConfigDir, "settings.json"), + wrapperKey: "context_servers", + docs: "https://github.com/rohitg00/agentmemory#other-agents", + protocolNote: + "→ Using MCP via ~/.config/zed/settings.json (key: context_servers).", +}); diff --git a/test/cli-connect.test.ts b/test/cli-connect.test.ts index 5c380176aa..5f4faff678 100644 --- a/test/cli-connect.test.ts +++ b/test/cli-connect.test.ts @@ -34,8 +34,11 @@ describe("agentmemory connect — dispatcher", () => { [ "antigravity", "claude-code", + "cline", "codex", + "continue", "cursor", + "droid", "gemini-cli", "hermes", "kiro", @@ -44,9 +47,10 @@ describe("agentmemory connect — dispatcher", () => { "pi", "qwen", "warp", + "zed", ].sort(), ); - expect(ADAPTERS.length).toBe(12); + expect(ADAPTERS.length).toBe(16); }); it("every adapter exposes detect() and install()", () => { diff --git a/test/connect-new-agents.test.ts b/test/connect-new-agents.test.ts index f7b332aae7..0b1da56286 100644 --- a/test/connect-new-agents.test.ts +++ b/test/connect-new-agents.test.ts @@ -149,17 +149,158 @@ describe("connect: Warp", () => { }); }); -describe("connect: all four agents registered in ADAPTERS", () => { +describe("connect: Cline", () => { + let home: string; + const ORIG = process.env["HOME"]; + beforeEach(() => { + home = freshHome(); + vi.resetModules(); + process.env["HOME"] = home; + }); + afterEach(() => { + process.env["HOME"] = ORIG; + rmSync(home, { recursive: true, force: true }); + }); + + it("does not detect when ~/.cline/ is absent", async () => { + const { adapter } = await import("../src/cli/connect/cline.js"); + expect(adapter.detect()).toBe(false); + }); + + it("writes mcpServers.agentmemory to ~/.cline/mcp.json", async () => { + mkdirSync(join(home, ".cline"), { recursive: true }); + const { adapter } = await import("../src/cli/connect/cline.js"); + expect(adapter.detect()).toBe(true); + const result = await adapter.install({ dryRun: false, force: false }); + expect(result.kind).toBe("installed"); + const cfg = JSON.parse( + readFileSync(join(home, ".cline", "mcp.json"), "utf-8"), + ); + expect(cfg.mcpServers.agentmemory.command).toBe("npx"); + expect(cfg.mcpServers.agentmemory.args).toContain("@agentmemory/mcp"); + }); +}); + +describe("connect: Droid (Factory.ai)", () => { + let home: string; + const ORIG = process.env["HOME"]; + beforeEach(() => { + home = freshHome(); + vi.resetModules(); + process.env["HOME"] = home; + }); + afterEach(() => { + process.env["HOME"] = ORIG; + rmSync(home, { recursive: true, force: true }); + }); + + it("does not detect when ~/.factory/ is absent", async () => { + const { adapter } = await import("../src/cli/connect/droid.js"); + expect(adapter.detect()).toBe(false); + }); + + it("writes mcpServers.agentmemory to ~/.factory/mcp.json", async () => { + mkdirSync(join(home, ".factory"), { recursive: true }); + const { adapter } = await import("../src/cli/connect/droid.js"); + expect(adapter.detect()).toBe(true); + const result = await adapter.install({ dryRun: false, force: false }); + expect(result.kind).toBe("installed"); + const cfg = JSON.parse( + readFileSync(join(home, ".factory", "mcp.json"), "utf-8"), + ); + expect(cfg.mcpServers.agentmemory.command).toBe("npx"); + expect(cfg.mcpServers.agentmemory.args).toContain("@agentmemory/mcp"); + }); +}); + +describe("connect: Zed", () => { + let home: string; + const ORIG = process.env["HOME"]; + beforeEach(() => { + home = freshHome(); + vi.resetModules(); + process.env["HOME"] = home; + }); + afterEach(() => { + process.env["HOME"] = ORIG; + rmSync(home, { recursive: true, force: true }); + }); + + it("does not detect when ~/.config/zed/ is absent", async () => { + const { adapter } = await import("../src/cli/connect/zed.js"); + expect(adapter.detect()).toBe(false); + }); + + it("writes context_servers.agentmemory to ~/.config/zed/settings.json", async () => { + mkdirSync(join(home, ".config", "zed"), { recursive: true }); + const { adapter } = await import("../src/cli/connect/zed.js"); + expect(adapter.detect()).toBe(true); + const result = await adapter.install({ dryRun: false, force: false }); + expect(result.kind).toBe("installed"); + const cfg = JSON.parse( + readFileSync(join(home, ".config", "zed", "settings.json"), "utf-8"), + ); + expect(cfg.context_servers.agentmemory.command).toBe("npx"); + expect(cfg.context_servers.agentmemory.args).toContain("@agentmemory/mcp"); + expect(cfg.mcpServers).toBeUndefined(); + }); +}); + +describe("connect: Continue.dev", () => { + let home: string; + const ORIG = process.env["HOME"]; + beforeEach(() => { + home = freshHome(); + vi.resetModules(); + process.env["HOME"] = home; + }); + afterEach(() => { + process.env["HOME"] = ORIG; + rmSync(home, { recursive: true, force: true }); + }); + + it("does not detect when ~/.continue/ is absent", async () => { + const { adapter } = await import("../src/cli/connect/continue.js"); + expect(adapter.detect()).toBe(false); + }); + + it("writes mcpServers array with agentmemory entry to ~/.continue/config.json", async () => { + mkdirSync(join(home, ".continue"), { recursive: true }); + const { adapter } = await import("../src/cli/connect/continue.js"); + expect(adapter.detect()).toBe(true); + const result = await adapter.install({ dryRun: false, force: false }); + expect(result.kind).toBe("installed"); + const cfg = JSON.parse( + readFileSync(join(home, ".continue", "config.json"), "utf-8"), + ); + expect(Array.isArray(cfg.mcpServers)).toBe(true); + const entry = cfg.mcpServers.find( + (s: { name: string }) => s.name === "agentmemory", + ); + expect(entry.command).toBe("npx"); + expect(entry.args).toContain("@agentmemory/mcp"); + }); +}); + +describe("connect: all eight new agents registered in ADAPTERS", () => { beforeEach(() => { vi.resetModules(); }); - it("knownAgents includes qwen, antigravity, kiro, warp", async () => { + it("knownAgents includes qwen, antigravity, kiro, warp, cline, continue, zed, droid", async () => { const { knownAgents } = await import("../src/cli/connect/index.js"); const agents = knownAgents(); - expect(agents).toContain("qwen"); - expect(agents).toContain("antigravity"); - expect(agents).toContain("kiro"); - expect(agents).toContain("warp"); + for (const name of [ + "qwen", + "antigravity", + "kiro", + "warp", + "cline", + "continue", + "zed", + "droid", + ]) { + expect(agents).toContain(name); + } }); }); From 7330909d23661993437faebd728d659c22131547 Mon Sep 17 00:00:00 2001 From: Rohit Ghumare Date: Wed, 27 May 2026 13:14:36 +0100 Subject: [PATCH 3/4] fix(connect): droid type:stdio required field + continue yaml-first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Doc verification flagged two real schema bugs in the prior commit: 1. Droid (Factory.ai): docs.factory.ai/cli/configuration/mcp specifies 'type' as REQUIRED for stdio servers ('Either stdio or http'). Previous entry was missing it — Droid would reject the agentmemory block at parse time. Extended createJsonMcpAdapter with optional extraEntryFields; droid sets type:'stdio'. 2. Continue.dev: config.yaml takes precedence over config.json per docs.continue.dev/reference/yaml-migration. config.json is deprecated and ignored when yaml is present. Prior adapter wrote to config.json blindly which would no-op on modern Continue installs. New three-branch logic: - yaml exists -> stub result with copy-pasteable block (refuses silent yaml mutation, no YAML dep in tree) - json exists (legacy only) -> modify in place - neither -> create fresh config.yaml via hand-rolled emitter (safe since no existing content to preserve) Zed (~/.config/zed/settings.json), Cline (~/.cline/mcp.json), Warp (~/.warp/.mcp.json) paths re-verified against current docs — all correct. --- README.md | 2 +- src/cli/connect/continue.ts | 149 ++++++++++++++++++---------- src/cli/connect/droid.ts | 2 + src/cli/connect/json-mcp-adapter.ts | 8 +- test/connect-new-agents.test.ts | 45 ++++++++- 5 files changed, 151 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 697fead00c..d12f6ff436 100644 --- a/README.md +++ b/README.md @@ -565,7 +565,7 @@ The agentmemory entry is the **same MCP server block** across every host that us | **Kiro** | `~/.kiro/settings/mcp.json` | `agentmemory connect kiro` writes the user-level config. Workspace overrides go in `.kiro/settings/mcp.json` next to your code. | | **Warp** | `~/.warp/.mcp.json` | `agentmemory connect warp` writes the standard `mcpServers` block. Warp also auto-discovers skills from `.claude/skills/` — once the Claude Code plugin is installed the 8 agentmemory skills (`remember`, `recall`, `recap`, `handoff`, `forget`, `commit-context`, `commit-history`, `session-history`) appear natively in Warp's slash-command palette. | | **Cline (CLI)** | `~/.cline/mcp.json` | `agentmemory connect cline` writes the standard `mcpServers` block. VS Code extension users: paste the same block via Cline Settings → MCP Servers → Edit JSON. | -| **Continue.dev** | `~/.continue/config.json` | `agentmemory connect continue` writes a `mcpServers` array entry (Continue uses array form, not object). YAML config (`config.yaml`) users: add the same fields under `mcpServers:` as a list item. | +| **Continue.dev** | `~/.continue/config.yaml` (preferred) or `config.json` (legacy) | `agentmemory connect continue` creates `config.yaml` from scratch when neither exists, or modifies existing `config.json`. **If you already have `config.yaml`** the adapter prints the exact block to paste under `mcpServers:` — it won't silently rewrite your yaml because preserving comments and anchors safely needs a YAML parser the package doesn't ship. Continue uses array form (not object) for `mcpServers`. | | **Zed** | `~/.config/zed/settings.json` | `agentmemory connect zed` writes under `context_servers` (Zed's key, NOT `mcpServers`). Remote MCP servers can be wired via `{"url": "..."}` instead. | | **Droid (Factory.ai)** | `~/.factory/mcp.json` | `agentmemory connect droid` writes the standard `mcpServers` block. Project-scoped overrides go in `/.factory/mcp.json`. The `/mcp` slash command inside droid lists configured servers. | | **Goose** | Goose MCP settings UI | Same `mcpServers` block — use `goose configure` → Add Extension → MCP. Direct YAML edit at `~/.config/goose/config.yaml` is supported but the schema uses `extensions:` + `cmd` (not `mcpServers:` + `command`). | diff --git a/src/cli/connect/continue.ts b/src/cli/connect/continue.ts index 82ef32c7ac..44f0fa8024 100644 --- a/src/cli/connect/continue.ts +++ b/src/cli/connect/continue.ts @@ -1,4 +1,4 @@ -import { existsSync, mkdirSync } from "node:fs"; +import { existsSync, mkdirSync, writeFileSync } from "node:fs"; import { homedir } from "node:os"; import { dirname, join } from "node:path"; import * as p from "@clack/prompts"; @@ -13,14 +13,16 @@ import { writeJsonAtomic, } from "./util.js"; -// Continue.dev writes its config as ~/.continue/config.json (or .yaml). -// Schema diverges from Claude Code: `mcpServers` is an ARRAY of named -// entries, not an object keyed by name. We target the JSON form so we -// don't need a YAML dependency; users on YAML config can convert with -// `continue config migrate` or wire manually. -// Source: github.com/continuedev/continue/blob/main/docs/customize/deep-dives/mcp.mdx +// Continue.dev v1+ prefers ~/.continue/config.yaml; config.json is +// deprecated and ignored when yaml is present. Three branches: +// - config.yaml exists → emit stub with manual edit instructions +// (no YAML dep in tree; preserving comments/anchors safely needs it) +// - config.json exists → modify it (legacy path still loaded when no yaml) +// - neither → create config.yaml from scratch (no merge risk) +// Source: docs.continue.dev/reference/yaml-migration const CONTINUE_DIR = join(homedir(), ".continue"); -const CONFIG_PATH = join(CONTINUE_DIR, "config.json"); +const YAML_PATH = join(CONTINUE_DIR, "config.yaml"); +const JSON_PATH = join(CONTINUE_DIR, "config.json"); type ContinueEntry = { name: string; @@ -29,7 +31,7 @@ type ContinueEntry = { env?: Record; }; -type ContinueConfig = { +type ContinueJsonConfig = { mcpServers?: ContinueEntry[]; [key: string]: unknown; }; @@ -48,68 +50,113 @@ function entryIsAgentmemory(entry: ContinueEntry | undefined): boolean { return entry.name === "agentmemory" && entry.args.includes("@agentmemory/mcp"); } +// Minimal YAML emitter for the agentmemory entry. Quotes string values +// that contain ${ ... } expansion to keep parsers happy. Only used when +// creating a fresh config.yaml — never when modifying an existing one. +function renderFreshYaml(): string { + const e = buildEntry(); + const envLines = Object.entries(e.env ?? {}) + .map(([k, v]) => ` ${k}: "${v}"`) + .join("\n"); + return [ + "mcpServers:", + ` - name: ${e.name}`, + ` command: ${e.command}`, + " args:", + ...e.args.map((a) => ` - "${a}"`), + " env:", + envLines, + "", + ].join("\n"); +} + export const adapter: ConnectAdapter = { name: "continue", displayName: "Continue", docs: "https://github.com/rohitg00/agentmemory#other-agents", protocolNote: - "→ Using MCP via ~/.continue/config.json (array form). YAML config users: add the same block under `mcpServers:` in config.yaml.", + "→ Using MCP via ~/.continue/config.yaml (preferred) or config.json (legacy, only when no yaml).", detect(): boolean { return existsSync(CONTINUE_DIR); }, async install(opts: ConnectOptions): Promise { - const existing = readJsonSafe(CONFIG_PATH); - const next: ContinueConfig = existing ? { ...existing } : {}; - const servers = Array.isArray(next.mcpServers) - ? [...next.mcpServers] - : []; - - const idx = servers.findIndex((s) => s?.name === "agentmemory"); - const alreadyHas = idx >= 0 && entryIsAgentmemory(servers[idx]); - if (alreadyHas && !opts.force) { - logAlreadyWired("Continue", CONFIG_PATH); - return { kind: "already-wired", mutatedPath: CONFIG_PATH }; - } + const yamlExists = existsSync(YAML_PATH); + const jsonExists = existsSync(JSON_PATH); - if (opts.dryRun) { + // Branch 1: yaml present — refuse to silently mutate user's yaml + // config (preserving comments/anchors needs a proper parser). + if (yamlExists) { + const manual = `\nAdd this to ~/.continue/config.yaml under mcpServers:\n\n${renderFreshYaml() + .split("\n") + .map((l) => (l ? ` ${l}` : l)) + .join("\n")}`; p.log.info( - `[dry-run] Would ${alreadyHas ? "overwrite" : "add"} mcpServers[agentmemory] in ${CONFIG_PATH}`, + `Continue: ${YAML_PATH} already exists. Manual edit needed.${manual}`, ); - return { kind: "installed", mutatedPath: CONFIG_PATH }; + return { kind: "stub", reason: "config.yaml-needs-manual-edit" }; } - let backupPath: string | undefined; - if (existsSync(CONFIG_PATH)) { - backupPath = backupFile(CONFIG_PATH, "continue"); + // Branch 2: legacy json present — modify in place. + if (jsonExists) { + const existing = readJsonSafe(JSON_PATH); + const next: ContinueJsonConfig = existing ? { ...existing } : {}; + const servers = Array.isArray(next.mcpServers) + ? [...next.mcpServers] + : []; + + const idx = servers.findIndex((s) => s?.name === "agentmemory"); + const alreadyHas = idx >= 0 && entryIsAgentmemory(servers[idx]); + if (alreadyHas && !opts.force) { + logAlreadyWired("Continue", JSON_PATH); + return { kind: "already-wired", mutatedPath: JSON_PATH }; + } + + if (opts.dryRun) { + p.log.info( + `[dry-run] Would ${alreadyHas ? "overwrite" : "add"} mcpServers[agentmemory] in ${JSON_PATH}`, + ); + return { kind: "installed", mutatedPath: JSON_PATH }; + } + + const backupPath = backupFile(JSON_PATH, "continue"); logBackup(backupPath); - } else { - mkdirSync(dirname(CONFIG_PATH), { recursive: true }); - } - const entry = buildEntry(); - if (idx >= 0) servers[idx] = entry; - else servers.push(entry); - next.mcpServers = servers; - writeJsonAtomic(CONFIG_PATH, next); - - const verify = readJsonSafe(CONFIG_PATH); - const verifyEntry = verify?.mcpServers?.find( - (s) => s?.name === "agentmemory", - ); - if (!entryIsAgentmemory(verifyEntry)) { - p.log.error( - `Verification failed: ${CONFIG_PATH} did not contain mcpServers[agentmemory] after write.`, + const entry = buildEntry(); + if (idx >= 0) servers[idx] = entry; + else servers.push(entry); + next.mcpServers = servers; + writeJsonAtomic(JSON_PATH, next); + + const verify = readJsonSafe(JSON_PATH); + const verifyEntry = verify?.mcpServers?.find( + (s) => s?.name === "agentmemory", ); - return { kind: "skipped", reason: "verification-failed" }; + if (!entryIsAgentmemory(verifyEntry)) { + p.log.error( + `Verification failed: ${JSON_PATH} did not contain mcpServers[agentmemory] after write.`, + ); + return { kind: "skipped", reason: "verification-failed" }; + } + + logInstalled("Continue (legacy config.json)", JSON_PATH); + return { + kind: "installed", + mutatedPath: JSON_PATH, + backupPath, + }; + } + + // Branch 3: neither exists — create config.yaml from scratch (modern path). + if (opts.dryRun) { + p.log.info(`[dry-run] Would create ${YAML_PATH} with agentmemory entry`); + return { kind: "installed", mutatedPath: YAML_PATH }; } - logInstalled("Continue", CONFIG_PATH); - return { - kind: "installed", - mutatedPath: CONFIG_PATH, - ...(backupPath !== undefined && { backupPath }), - }; + mkdirSync(dirname(YAML_PATH), { recursive: true }); + writeFileSync(YAML_PATH, renderFreshYaml(), "utf-8"); + logInstalled("Continue", YAML_PATH); + return { kind: "installed", mutatedPath: YAML_PATH }; }, }; diff --git a/src/cli/connect/droid.ts b/src/cli/connect/droid.ts index a58ef40c48..92ae69edd6 100644 --- a/src/cli/connect/droid.ts +++ b/src/cli/connect/droid.ts @@ -16,4 +16,6 @@ export const adapter = createJsonMcpAdapter({ docs: "https://github.com/rohitg00/agentmemory#other-agents", protocolNote: "→ Using MCP via ~/.factory/mcp.json. The `/mcp` slash command inside droid lists configured servers.", + // Droid requires `type` per the documented schema. stdio for npx-spawned shim. + extraEntryFields: { type: "stdio" }, }); diff --git a/src/cli/connect/json-mcp-adapter.ts b/src/cli/connect/json-mcp-adapter.ts index d50e8bb5e4..14ba41b6f7 100644 --- a/src/cli/connect/json-mcp-adapter.ts +++ b/src/cli/connect/json-mcp-adapter.ts @@ -22,6 +22,9 @@ export type JsonMcpAdapterConfig = { // Wrapper key under which servers live. Default "mcpServers". // Zed uses "context_servers"; otherwise same shape. wrapperKey?: string; + // Extra fields merged into the agentmemory entry. Droid requires + // type: "stdio"; other hosts ignore unknown fields. + extraEntryFields?: Record; }; type McpEntry = typeof AGENTMEMORY_MCP_BLOCK; @@ -79,7 +82,10 @@ export function createJsonMcpAdapter( mkdirSync(dirname(config.configPath), { recursive: true }); } - servers["agentmemory"] = AGENTMEMORY_MCP_BLOCK; + servers["agentmemory"] = { + ...AGENTMEMORY_MCP_BLOCK, + ...(config.extraEntryFields ?? {}), + }; next[wrapperKey] = servers; writeJsonAtomic(config.configPath, next); diff --git a/test/connect-new-agents.test.ts b/test/connect-new-agents.test.ts index 0b1da56286..9ac4485ab5 100644 --- a/test/connect-new-agents.test.ts +++ b/test/connect-new-agents.test.ts @@ -199,7 +199,7 @@ describe("connect: Droid (Factory.ai)", () => { expect(adapter.detect()).toBe(false); }); - it("writes mcpServers.agentmemory to ~/.factory/mcp.json", async () => { + it("writes mcpServers.agentmemory to ~/.factory/mcp.json with type:stdio", async () => { mkdirSync(join(home, ".factory"), { recursive: true }); const { adapter } = await import("../src/cli/connect/droid.js"); expect(adapter.detect()).toBe(true); @@ -210,6 +210,8 @@ describe("connect: Droid (Factory.ai)", () => { ); expect(cfg.mcpServers.agentmemory.command).toBe("npx"); expect(cfg.mcpServers.agentmemory.args).toContain("@agentmemory/mcp"); + // Droid requires `type` per its documented schema + expect(cfg.mcpServers.agentmemory.type).toBe("stdio"); }); }); @@ -264,12 +266,32 @@ describe("connect: Continue.dev", () => { expect(adapter.detect()).toBe(false); }); - it("writes mcpServers array with agentmemory entry to ~/.continue/config.json", async () => { + it("creates config.yaml from scratch when neither yaml nor json exists", async () => { mkdirSync(join(home, ".continue"), { recursive: true }); const { adapter } = await import("../src/cli/connect/continue.js"); expect(adapter.detect()).toBe(true); const result = await adapter.install({ dryRun: false, force: false }); expect(result.kind).toBe("installed"); + const yamlPath = join(home, ".continue", "config.yaml"); + expect(existsSync(yamlPath)).toBe(true); + expect(existsSync(join(home, ".continue", "config.json"))).toBe(false); + const yaml = readFileSync(yamlPath, "utf-8"); + expect(yaml).toContain("mcpServers:"); + expect(yaml).toContain("name: agentmemory"); + expect(yaml).toContain("@agentmemory/mcp"); + expect(yaml).toContain("AGENTMEMORY_URL"); + }); + + it("modifies existing legacy config.json", async () => { + mkdirSync(join(home, ".continue"), { recursive: true }); + const { writeFileSync } = await import("node:fs"); + writeFileSync( + join(home, ".continue", "config.json"), + JSON.stringify({ models: [], mcpServers: [] }), + ); + const { adapter } = await import("../src/cli/connect/continue.js"); + const result = await adapter.install({ dryRun: false, force: false }); + expect(result.kind).toBe("installed"); const cfg = JSON.parse( readFileSync(join(home, ".continue", "config.json"), "utf-8"), ); @@ -280,6 +302,25 @@ describe("connect: Continue.dev", () => { expect(entry.command).toBe("npx"); expect(entry.args).toContain("@agentmemory/mcp"); }); + + it("returns stub when config.yaml already exists (refuses silent yaml mutation)", async () => { + mkdirSync(join(home, ".continue"), { recursive: true }); + const { writeFileSync } = await import("node:fs"); + writeFileSync( + join(home, ".continue", "config.yaml"), + "models: []\nmcpServers:\n - name: existing\n command: noop\n", + ); + const { adapter } = await import("../src/cli/connect/continue.js"); + const result = await adapter.install({ dryRun: false, force: false }); + expect(result.kind).toBe("stub"); + // user's yaml must be untouched + const yaml = readFileSync( + join(home, ".continue", "config.yaml"), + "utf-8", + ); + expect(yaml).toContain("existing"); + expect(yaml).not.toContain("agentmemory"); + }); }); describe("connect: all eight new agents registered in ADAPTERS", () => { From ee80f951a57ff63d269975a5b892a8bdfb0a3774 Mon Sep 17 00:00:00 2001 From: Rohit Ghumare Date: Wed, 27 May 2026 13:42:28 +0100 Subject: [PATCH 4/4] =?UTF-8?q?fix(connect):=20coderabbit=20feedback=20?= =?UTF-8?q?=E2=80=94=20grid,=20dead=20ternary,=20yaml=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three of four CodeRabbit findings on PR #677 verified valid + fixed: - README agents grid was 9 cells x 12.5% = 112.5% on row 2 — overflow. Moved Warp to a fresh row 3. - src/cli/connect/zed.ts had an isMac ternary returning the same path on both branches (dead code). Collapsed to one constant. - src/cli/connect/continue.ts yaml-stub message said 'under mcpServers:' but the printed snippet already includes the top-level mcpServers: key. Reworded to 'merge this block' and explicitly noted the snippet's own top-level key, so users with an existing mcpServers list append rather than duplicate. Skipped (one): test harness mutates HOME but not USERPROFILE. Adapter detect uses node:os homedir() which reads USERPROFILE on Windows. Connect command explicitly refuses to run on Windows (platform()==='win32' early-exit), so the Windows path isn't exercised. Pre-existing pattern across all connect tests. --- README.md | 2 ++ src/cli/connect/continue.ts | 5 +++-- src/cli/connect/zed.ts | 17 +++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d12f6ff436..a0673a3083 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,8 @@ agentmemory works with any agent that supports hooks, MCP, or REST API. All agen Roo Code
MCP server + + Warp
Warp
diff --git a/src/cli/connect/continue.ts b/src/cli/connect/continue.ts index 44f0fa8024..4a2cb820ba 100644 --- a/src/cli/connect/continue.ts +++ b/src/cli/connect/continue.ts @@ -88,10 +88,11 @@ export const adapter: ConnectAdapter = { // Branch 1: yaml present — refuse to silently mutate user's yaml // config (preserving comments/anchors needs a proper parser). if (yamlExists) { - const manual = `\nAdd this to ~/.continue/config.yaml under mcpServers:\n\n${renderFreshYaml() + const indented = renderFreshYaml() .split("\n") .map((l) => (l ? ` ${l}` : l)) - .join("\n")}`; + .join("\n"); + const manual = `\nMerge this block into ~/.continue/config.yaml (the snippet already includes the top-level mcpServers key — if your config already has a mcpServers list, append the agentmemory entry to it instead of duplicating the key):\n\n${indented}`; p.log.info( `Continue: ${YAML_PATH} already exists. Manual edit needed.${manual}`, ); diff --git a/src/cli/connect/zed.ts b/src/cli/connect/zed.ts index 4bc5695864..bad7730d85 100644 --- a/src/cli/connect/zed.ts +++ b/src/cli/connect/zed.ts @@ -1,17 +1,14 @@ -import { homedir, platform } from "node:os"; +import { homedir } from "node:os"; import { join } from "node:path"; import { createJsonMcpAdapter } from "./json-mcp-adapter.js"; // Zed stores its settings (including MCP servers) under "context_servers" -// in settings.json — NOT "mcpServers". macOS uses -// ~/.config/zed/settings.json by default; Zed also reads from -// ~/Library/Application Support/Zed/settings.json on macOS but the -// XDG path is the documented primary. Linux: ~/.config/zed/settings.json. -// Source: zed.dev/docs/ai/mcp -const isMac = platform() === "darwin"; -const zedConfigDir = isMac - ? join(homedir(), ".config", "zed") - : join(homedir(), ".config", "zed"); +// in settings.json — NOT "mcpServers". User config lives at +// ~/.config/zed/settings.json on all platforms (Zed uses the XDG path +// even on macOS; ~/Library/Application Support/Zed/ holds runtime data +// like the database + cached language servers, not the config). +// Source: zed.dev/docs/ai/mcp + zed.dev/docs/configuring-zed +const zedConfigDir = join(homedir(), ".config", "zed"); export const adapter = createJsonMcpAdapter({ name: "zed",