Documentation
The current guide to connecting AnchorMind from Codex, Claude Code, Cursor, Gemini CLI, and VS Code—and operating the memory lifecycle.
1. Getting Started
- Sign up with GitHub and get admin approval.
- Issue an API access key in the console.
- Register the MCP server in your agent (Codex, Claude Code, Cursor, Gemini CLI, or VS Code).
- Verify the integration with a first
remember→recallround trip.
2. Connection
The endpoint speaks Streamable HTTP (JSON-RPC); authentication uses a Bearer header.
Endpoint: https://memento.anchormind.net/mcp Auth: Authorization: Bearer <ACCESS_KEY>
3. Codex Setup
Codex CLI, the IDE extension, and ChatGPT desktop share ~/.codex/config.toml. Keep the token out of the file and pass it through the ANCHORMIND_ACCESS_KEY environment variable.
[mcp_servers.anchormind] url = "https://memento.anchormind.net/mcp" bearer_token_env_var = "ANCHORMIND_ACCESS_KEY" required = true
After adding the environment variable, restart Codex or the desktop app and verify with codex mcp list or /mcp.
Codex does not show MCP tools to the model directly, so a plain connection never uses memory. Put the Codex memory instructions from Downloads into ~/.codex/AGENTS.md so that Codex loads memory at the start of a task and saves decisions and fixes.
4. Claude Code Setup
Register the remote server over HTTP, the recommended transport. Use project-root .mcp.json for a shared project setup or the CLI's --scope user for all projects. Templates are available in Downloads.
export ANCHORMIND_ACCESS_KEY="YOUR_ACCESS_KEY" claude mcp add --transport http --scope user anchormind https://memento.anchormind.net/mcp \ --header "Authorization: Bearer $ANCHORMIND_ACCESS_KEY" claude mcp list
5. Cursor Setup
Use .cursor/mcp.json for a project or ~/.cursor/mcp.json globally. Restart Cursor after configuring and confirm the AnchorMind tools under Available Tools.
{
"mcpServers": {
"anchormind": {
"url": "https://memento.anchormind.net/mcp",
"headers": {
"Authorization": "Bearer YOUR_ACCESS_KEY"
}
}
}
}6. Gemini CLI Setup
Register the Streamable HTTP server and Authorization header from the CLI. Project settings live in .gemini/settings.json; user settings live in ~/.gemini/settings.json.
export ANCHORMIND_ACCESS_KEY="YOUR_ACCESS_KEY" gemini mcp add --transport http anchormind https://memento.anchormind.net/mcp \ --header "Authorization: Bearer $ANCHORMIND_ACCESS_KEY"
7. VS Code and GitHub Copilot Setup
For new setups, use portable .mcp.json at the project root. Request the secret through an input variable instead of storing it in the file.
{
"mcpServers": {
"anchormind": {
"type": "http",
"url": "https://memento.anchormind.net/mcp",
"headers": {
"Authorization": "Bearer ${input:anchormind-access-key}"
}
}
}
}8. Agent Skill and Memory Lifecycle
The MCP connection exposes tools; the Skill defines when to use them. The compact Agent Skill is the per-session operating contract, while the canonical Skill is the full tool and recovery reference.
Install the compact Skill in a Codex project
mkdir -p .agents/skills/anchormind curl -fsSL https://anchormind.net/docs/anchormind-agent-skill.md \ -o .agents/skills/anchormind/SKILL.md
- Start: load core memory with context, then recall the current topic.
- During work: remember confirmed facts, decisions, and resolved procedures; send tool_feedback for search results.
- End: use reflect to persist summaries, decisions, and resolved errors as atomic fragments.
For current details, read only the needed section from the server with get_skill_guide(section=...).
9. Memory Tool Reference
contextLoad Core/Working Memory at session start.recallSearch fragments. Keyword/semantic/hybrid auto-routing.rememberStore one self-contained fact (1-3 sentences, 300 chars recommended).batch_rememberBulk store up to 200 fragments in one transaction.batch_statusCheck a batch_remember(async) job. Read-only.reflectPersist session learnings as atomic fragments.amendUpdate an existing fragment. Send only changed fields.forgetDelete resolved errors and unneeded fragments.linkCreate causal/relational links between fragments.graph_exploreTrace error causality (RCA).fragment_historyView a fragment change history.reconstruct_historyReconstruct case work history in time order.search_tracesLightweight grep-style fragment scan.tool_feedbackReport search usefulness (link-weight learning).memory_statsMemory statistics and quota.memory_consolidateManual GC trigger (master key only).check_updateCheck whether a newer server release is available (master key only).apply_updateRun one update stage after check_update (master key only).session_rotateEnd the current session and issue a new sessionId.get_skill_guideReturn the SKILL.md usage guide.10. Verifying the Integration
After connecting, confirm the round trip with this checklist.
- Call
context→ check the ANCHOR/CORE MEMORY response (an empty list is normal for a new account). - Store one fragment with
remember→ check success and the fragment id in the response. - Search that keyword with
recall→ the fragment you just stored should return. - Call
reflectat session end → confirm summary fragments are created.
11. curl Fallback
If the MCP session expires, call the JSON-RPC endpoint directly: issue a session via initialize, then pass it in the MCP-Session-Id header.
1. Initialize a session — keep the MCP-Session-Id response header
SESSION_ID=$(curl -s -X POST https://memento.anchormind.net/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_KEY" \
-D - \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}' \
2>/dev/null | grep -i "^mcp-session-id" | tr -d '\r' | awk '{print $2}')2. Call a tool — remember example
curl -s -X POST https://memento.anchormind.net/mcp \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_KEY" \
-H "MCP-Session-Id: $SESSION_ID" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{
"name":"remember",
"arguments":{"content":"connection test","topic":"setup","type":"fact"}
}}'3. Validate the response
- HTTP 200 with a result field means success; an error.code field means failure.
- If error.code is -32001 or -32002 (session related), start over from initialize.