# a-mem-mcp

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 35
- Author: DiaaAj
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/DiaaAj/a-mem-mcp
- Updated: 2026-01-17
- HTML: https://affpapa.org/en/nevibecode/mcp/a-mem-mcp

## What it 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.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `LLM_BACKEND`, `LLM_MODEL`, `OPENAI_API_KEY`, `EMBEDDING_MODEL`, `CHROMA_DB_PATH` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
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-mem
```
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>

### Codex

**Platform CLI**
```bash
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-mem
```
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>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "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>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "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>

### Gemini CLI

**Platform CLI**
```bash
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-mem
```
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>

## When to use it
- 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
- 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.

## Similar
- [mem-search](https://affpapa.org/en/nevibecode/skills/mem-search.md) — skill · 8900 installs
- [langchain-rag](https://affpapa.org/en/nevibecode/skills/langchain-rag.md) — skill · 17500 installs
- [jetson-inference-mem-tune](https://affpapa.org/en/nevibecode/skills/jetson-inference-mem-tune.md) — skill · 1200 installs
- [mem](https://affpapa.org/en/nevibecode/skills/mem.md) — skill · 2400 installs
- [myc](https://affpapa.org/en/nevibecode/mcp/myc.md) — MCP server · ★ 14
- [context-mem](https://affpapa.org/en/nevibecode/mcp/context-mem.md) — MCP server · ★ 19

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
