Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MCP clients overview

llm-mem is an MCP server. It speaks the Model Context Protocol over stdio (standard input/output) and registers 32 tools that the AI assistant calls.

Any MCP client can connect to it. The configuration is a JSON object that tells the client how to launch the server process.

General shape

Every MCP client config has the same essential fields:

{
  "<mcp-key>": {
    "type": "local",
    "command": "/absolute/path/to/llm-mem-mcp",
    "args": [],
    "env": {}
  }
}
FieldMeaning
type: "local"The server runs as a local subprocess (the only kind llm-mem supports)
commandAbsolute path to the llm-mem-mcp binary (or AppImage)
argsCommand-line arguments (optional — see CLI flags)
envEnvironment variables to set when launching (optional)

The command must be absolute. The client launches it as a child process and pipes JSON-RPC over its stdin/stdout.

Confirmed clients

ClientStatusConfig keyDocs
opencodeRecommendedmcp.<name> in opencode.jsonopencode docs
VS Code CopilotSupportedservers.<name> in .vscode/mcp.jsonVS Code MCP docs
Claude CodeCompatiblemcpServers in .mcp.jsonAnthropic docs
CursorCompatiblemcpServers in ~/.cursor/mcp.jsonCursor docs
ZedCompatiblecontext_servers in ~/.config/zed/settings.jsonZed docs

The configuration format varies by client. The command and behavior are the same.

Choosing between AppImage and direct binary

AppImage (llm-mem-mcp-x86_64.AppImage):

  • One file, works on any glibc ≥ 2.28 distro
  • Bundled OpenSSL + C++ runtime
  • Larger download (~150 MB) but zero install
  • Best for: portable, no-system-deps deployment

Native binary (llm-mem-mcp):

  • Smaller, depends on system libc/libstdc++
  • Released per platform (Linux x86_64, macOS aarch64, etc.)
  • Best for: when you control the runtime environment

From-source build (target/release/llm-mem-mcp):

  • After cargo build --release
  • Best for: development, custom feature combinations

Pick the binary that matches how you installed llm-mem, and use the absolute path in your MCP config.

Environment variables to set

The env map in the MCP config can set any of the environment variables llm-mem reads. Common ones:

{
  "env": {
    "LLM_MEM_MODELS_DIR": "/home/you/.cache/llm-mem/models",
    "LLM_MEM_LLM_API_KEY": "sk-...",
    "HTTPS_PROXY": "http://proxy.corp:8080",
    "RUST_LOG": "info"
  }
}

Tip

Don’t put secrets in version control —

MCP config files are often committed to source repos. Use environment variables or a secret manager for API keys, not literal values in the config.

Verifying the connection

After updating your MCP config:

  1. Restart the client (opencode, VS Code, etc.) — it spawns the server as a subprocess
  2. Look in the client’s MCP/tool panel — you should see 32 llm-mem-* tools
  3. Ask the AI to call system_status — the response confirms the server is reachable and the models are loaded

If the tools don’t appear, see Troubleshooting MCP.

Next