Skip to main content
Any agent that supports the Model Context Protocol (MCP) can connect to Agent Memory using the @agentmemory/mcp shim package. All agents share the same memory store on your machine — what Cline learns in one session, Cursor can recall in the next.

Universal MCP Config

Add this block to your agent’s MCP server configuration file. The exact file path varies by agent (see the agent-specific sections below), but the config structure is the same for all of them:
{
  "mcpServers": {
    "agentmemory": {
      "command": "npx",
      "args": ["-y", "@agentmemory/mcp"],
      "env": {
        "AGENTMEMORY_URL": "${AGENTMEMORY_URL:-http://localhost:3111}",
        "AGENTMEMORY_SECRET": "${AGENTMEMORY_SECRET:-}",
        "AGENTMEMORY_TOOLS": "${AGENTMEMORY_TOOLS:-all}"
      }
    }
  }
}
The ${VAR:-default} syntax means the config works without any environment variables set (falling back to localhost:3111, no auth, all 53 tools) but also picks up your shell exports automatically when they are set.
Start agentmemory before opening any agent. The shim connects to the server at startup — if the server is not running, the shim falls back to the 8-tool core set instead of exposing all 53 tools.

Agent-Specific Instructions

Quick connect:
agentmemory connect cline
This writes the mcpServers.agentmemory block to ~/.cline/mcp.json.VS Code extension users: paste the same JSON block via Cline Settings → MCP Servers → Edit JSON inside VS Code. The config file is managed through the UI rather than the filesystem in that case.Cline uses the standard mcpServers schema, identical to Claude Code.
Quick connect:
agentmemory connect continue
Continue v1+ prefers ~/.continue/config.yaml. The connect command handles three cases automatically:
  • If config.yaml does not exist, it creates one with the Agent Memory entry.
  • If config.json exists (legacy path), it adds the entry to mcpServers.
  • If config.yaml already exists, it prints the block to add manually (to avoid clobbering your existing YAML comments and anchors).
Manual entry for ~/.continue/config.yaml:
mcpServers:
  - name: agentmemory
    command: npx
    args:
      - "-y"
      - "@agentmemory/mcp"
    env:
      AGENTMEMORY_URL: "${AGENTMEMORY_URL:-http://localhost:3111}"
      AGENTMEMORY_SECRET: "${AGENTMEMORY_SECRET:-}"
      AGENTMEMORY_TOOLS: "${AGENTMEMORY_TOOLS:-all}"
Quick connect:
agentmemory connect zed
This writes the config to ~/.config/zed/settings.json.Important: Zed uses context_servers as the config key, not mcpServers. The connect command handles this automatically. If you configure it manually, the block goes under "context_servers" in your Zed settings:
{
  "context_servers": {
    "agentmemory": {
      "command": "npx",
      "args": ["-y", "@agentmemory/mcp"],
      "env": {
        "AGENTMEMORY_URL": "${AGENTMEMORY_URL:-http://localhost:3111}",
        "AGENTMEMORY_SECRET": "${AGENTMEMORY_SECRET:-}",
        "AGENTMEMORY_TOOLS": "${AGENTMEMORY_TOOLS:-all}"
      }
    }
  }
}
Quick connect:
agentmemory connect warp
This writes the standard mcpServers block to ~/.warp/.mcp.json.Bonus: Warp auto-discovers skills from .claude/skills/. If you have the Claude Code plugin installed, Warp automatically surfaces Agent Memory’s 8 action skills (/recall, /remember, /recap, /handoff, /forget, /commit-context, /commit-history, /session-history) in its slash-command palette.
Quick connect:
agentmemory connect gemini-cli
This writes the mcpServers.agentmemory block to ~/.gemini/settings.json. MCP is the only protocol Gemini CLI speaks for external tool integrations.
Quick connect:
agentmemory connect kiro
This writes the user-level config to ~/.kiro/settings/mcp.json. For workspace-scoped overrides, add the same block to .kiro/settings/mcp.json in your project directory.
Quick connect:
agentmemory connect droid
This writes the config to ~/.factory/mcp.json. Droid requires an explicit "type": "stdio" field on each MCP entry, which the connect command adds automatically.For workspace-scoped overrides, add the same block to .factory/mcp.json in your project directory. You can verify the registered servers with the /mcp slash command inside a Droid session.
Quick connect:
agentmemory connect opencode
This writes the config to ~/.config/opencode/opencode.json.Important: OpenCode does not use the standard mcpServers schema. Its config uses a top-level mcp key, with command as an array and explicit type and enabled fields. The connect command writes the correct shape automatically and preserves any other MCP servers you have configured. If you configure it manually, the block looks like this:
{
  "mcp": {
    "agentmemory": {
      "type": "local",
      "command": ["npx", "-y", "@agentmemory/mcp"],
      "enabled": true
    }
  }
}
OpenCode does not expand shell-style ${VAR:-default} placeholders in its config, so the entry omits an environment block. The stdio child process inherits your shell environment instead — export AGENTMEMORY_URL or AGENTMEMORY_SECRET in your shell if you need non-default values.
Quick connect:
agentmemory connect qwen
This writes the mcpServers.agentmemory block to ~/.qwen/settings.json. Qwen Code uses the same MCP schema as Claude Code, so the standard config block works without modification.
Quick connect:
agentmemory connect antigravity
This writes the config to the platform-appropriate path:
  • macOS: ~/Library/Application Support/Antigravity/User/mcp_config.json
  • Linux: ~/.config/Antigravity/User/mcp_config.json
Antigravity uses the standard mcpServers schema. Note that Antigravity replaces Gemini CLI as of 2026-06-18 — if you were previously using agentmemory connect gemini-cli, switch to agentmemory connect antigravity.
Quick connect:
agentmemory connect openclaw
This writes the config to ~/.openclaw/openclaw.json.For deeper integration with OpenClaw’s memory slot system, copy integrations/openclaw from the Agent Memory repository to ~/.openclaw/extensions/agentmemory and enable plugins.slots.memory = "agentmemory" in ~/.openclaw/openclaw.json. This gives OpenClaw native memory slot access rather than just MCP tool access.
Quick connect:
agentmemory connect codex
Codex CLI uses a TOML config at ~/.codex/config.toml. The connect command appends the MCP block in the correct TOML format.Full plugin install (recommended for hooks and skills):
codex plugin marketplace add rohitg00/agentmemory
codex plugin add agentmemory@agentmemory
The Codex plugin registers 6 lifecycle hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PreCompact, Stop) and 8 invocable skills on top of the MCP tools.Codex Desktop workaround: Codex Desktop builds currently do not dispatch plugin-local hooks.json. MCP tools still work; only lifecycle hooks are affected. Until this is fixed upstream, run:
agentmemory connect codex --with-hooks
This mirrors the hook commands into ~/.codex/hooks.json with absolute paths.

Standalone MCP Mode

You can run Agent Memory’s MCP server without the full engine if you only need MCP tool access without the persistence layer:
agentmemory mcp
Or via npx without installing anything globally:
npx @agentmemory/mcp
In standalone MCP mode (no server running at AGENTMEMORY_URL), the shim exposes 8 core tools with local-only storage. For the full 53-tool set with hybrid search, confidence scoring, and knowledge graphs, run the full agentmemory server alongside it.

Available MCP Tools

When your agent connects and the Agent Memory server is reachable, it has access to the following tools. The core set is always available; the extended set requires a running server.

Core Tools

ToolDescription
memory_recallFull-text and semantic search across all past observations
memory_saveSave an insight, decision, or pattern to long-term memory
memory_smart_searchHybrid BM25 + embedding search with RRF fusion and reranking
memory_file_historyPast observations about a specific file
memory_patternsSurface recurring patterns across sessions
memory_sessionsList recent sessions with summaries
memory_timelineChronological view of observations
memory_profileFull project profile: concepts, files, and patterns

Extended Tools

Set AGENTMEMORY_TOOLS=all when starting the server to expose all 53 tools. Extended tools include multi-agent coordination (memory_lease, memory_signal_send, memory_signal_read), knowledge graph traversal (memory_relations, memory_graph_query), governance (memory_governance_delete, memory_audit), and more.
Use AGENTMEMORY_TOOLS=core when starting the server to limit to the 8 most essential tools if your agent has a small context window. This keeps the MCP tool list lean without losing the tools you use most.

MCP Resources

In addition to tools, agents can read Agent Memory’s resources directly using the agentmemory:// scheme:
ResourceDescription
agentmemory://statusServer health, session count, and total memory count
agentmemory://memories/latestThe 10 most recently created active memories
agentmemory://project/{name}/profilePer-project intelligence profile for the named project
agentmemory://graph/statsKnowledge graph statistics

All Agents Share One Memory Store

A key benefit of Agent Memory’s architecture: every connected agent reads from and writes to the same memory store on your machine. You can use Claude Code in the morning, switch to Cursor in the afternoon, and both agents have access to the same observations, decisions, and project context. There is no per-agent silo.