Setup
1
Start agentmemory
2
Wire MCP and hooks
~/.factory/, backs up mcp.json, merges the entry, verifies it, and merges the hook manifest into ~/.factory/hooks.json.3
Restart droid
Start a new droid session and run
/mcp to list configured servers.4
Verify
Run one prompt, then check the Sessions tab at
http://localhost:3113; with hooks installed the session and its tool calls appear without any tool invocation by the agent.What connect writes
Droid’s schema requires an explicittype per entry; the adapter adds "type": "stdio" to the standard block:
~/.factory/mcp.json
<repo>/.factory/mcp.json.
What --with-hooks writes
--with-hooks merges the bundled hooks.droid.json manifest into ~/.factory/hooks.json. Five events fire: SessionStart, UserPromptSubmit, PreToolUse (matcher Edit|Create|Read|Glob|Grep), PostToolUse, and SessionEnd. The merge is idempotent: re-installs replace only entries whose command points under the bundled scripts/ directory, preserving your own hooks. The hooks installer runs even when MCP is already wired.
connect also upserts a memory-usage guideline block into the global ~/.factory/AGENTS.md. Skip with --no-guidelines.
Troubleshooting
Droid hooks skipped: could not locate bundled plugin/ directory
Droid hooks skipped: could not locate bundled plugin/ directory
The installer resolves the bundled
plugin/ directory of the installed @agentmemory/agentmemory package and skips hook install when it is missing. Reinstall the package and re-run; MCP wiring is applied regardless.Server missing from /mcp after connect
Server missing from /mcp after connect
Droid reads
~/.factory/mcp.json at session start. Open a new session. If a project-level .factory/mcp.json exists in the repo, it overrides the user-level file; add the entry there too.src/cli/connect/droid.ts. Hook manifest: plugin/hooks/hooks.droid.json.