a-mem-mcp — Claude Code MCP server: features and setup
This server stores project knowledge as linked notes and helps an agent retrieve it later. Use it when coding sessions need to build on earlier decisions and context.
claude mcp add --env LLM_BACKEND=<LLM_BACKEND> --env LLM_MODEL=<LLM_MODEL> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env EMBEDDING_MODEL=<EMBEDDING_MODEL> --env CHROMA_DB_PATH=<CHROMA_DB_PATH> --transport stdio a-mem-mcp -- uvx a-memWhat a-mem-mcp does
A-MEM turns project notes into connected records. When a note is added, it derives keywords, context, and tags, looks for related entries, then can adjust links and nearby notes. Retrieval uses semantic matching together with graph traversal.
An agent can search notes, follow their connections, read full entries, edit them, or remove them. Time-based search is available too. Adding a note runs asynchronously, so a separate tool checks whether that task has finished. A lightweight lookup can come before opening selected notes in full.
The default store, ./chroma_db, is isolated per project. Configuration includes an LLM backend and model; OpenAI requires OPENAI_API_KEY, while Ollama is listed as a local option. Automatic session-start hook setup is described for Claude Code, and the README reports testing on that platform.
What it helps with
- carry project decisions across coding sessions
- find saved notes by meaning or time range
- follow links between related project notes
- edit or remove outdated entries
Example prompts for the agent
- Remember that this project creates database sessions through dependency injection.
- Find saved notes about the authentication flow.
- Search security notes, follow their links, and open the relevant entry.
How to install a-mem-mcp
Platform CLI
claude mcp add --env LLM_BACKEND=<LLM_BACKEND> --env LLM_MODEL=<LLM_MODEL> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env EMBEDDING_MODEL=<EMBEDDING_MODEL> --env CHROMA_DB_PATH=<CHROMA_DB_PATH> --transport stdio a-mem-mcp -- uvx a-memReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from a-mem <command>
Platform CLI
codex mcp add a-mem-mcp --env LLM_BACKEND=<LLM_BACKEND> --env LLM_MODEL=<LLM_MODEL> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env EMBEDDING_MODEL=<EMBEDDING_MODEL> --env CHROMA_DB_PATH=<CHROMA_DB_PATH> -- uvx a-memReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from a-mem <command>
Config file
{
"mcpServers": {
"a-mem-mcp": {
"command": "uvx",
"args": [
"a-mem"
],
"env": {
"LLM_BACKEND": "<LLM_BACKEND>",
"LLM_MODEL": "<LLM_MODEL>",
"OPENAI_API_KEY": "<OPENAI_API_KEY>",
"EMBEDDING_MODEL": "<EMBEDDING_MODEL>",
"CHROMA_DB_PATH": "<CHROMA_DB_PATH>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from a-mem <command>
Config file
{
"servers": {
"a-mem-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"a-mem"
],
"env": {
"LLM_BACKEND": "<LLM_BACKEND>",
"LLM_MODEL": "<LLM_MODEL>",
"OPENAI_API_KEY": "<OPENAI_API_KEY>",
"EMBEDDING_MODEL": "<EMBEDDING_MODEL>",
"CHROMA_DB_PATH": "<CHROMA_DB_PATH>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from a-mem <command>
Platform CLI
gemini mcp add -e LLM_BACKEND=<LLM_BACKEND> -e LLM_MODEL=<LLM_MODEL> -e OPENAI_API_KEY=<OPENAI_API_KEY> -e EMBEDDING_MODEL=<EMBEDDING_MODEL> -e CHROMA_DB_PATH=<CHROMA_DB_PATH> a-mem-mcp uvx a-memReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from a-mem <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about a-mem-mcp
How do I install a-mem-mcp in Claude Code?
Run claude mcp add a-mem-mcp -e OPENAI_API_KEY=<OPENAI_API_KEY> -- uvx a-mem. Replace the placeholder with your OpenAI key.
What does a-mem-mcp do?
It stores project knowledge as notes, finds related entries, and builds connections between them. The agent can also read, change, and delete saved notes.
Where does a-mem-mcp store its notes?
By default, each project uses its own ./chroma_db directory. To share memory across projects, set CHROMA_DB_PATH=~/.local/share/a-mem/chroma_db.