LLMSlim memory — Claude Code MCP server: memory and setup
This MCP server keeps agent and user messages in local SQLite, then selects relevant context under a token budget.
claude mcp add --env LLMSLIM_MEMORY_DB=<LLMSLIM_MEMORY_DB> --env LLMSLIM_USER_ID=<LLMSLIM_USER_ID> --env LLMSLIM_AGENT_ID=<LLMSLIM_AGENT_ID> --transport stdio llmslim-memory -- uvx llmslimWhat LLMSlim memory does
LLMSlim memory gives coding agents persistent local memory without sending storage or retrieval through an LLM. It exposes five MCP tools: remember, recall, list_memories, forget, and fit_context. Retrieval selects stored messages that match a question within the budget you set; fit_context can reduce a long log or document to that limit.
The server receives LLMSLIM_USER_ID and LLMSLIM_AGENT_ID at startup, so the model cannot switch memory scopes through injected text. Data is kept in a local SQLite file, and the MCP process runs through uvx. Python 3.10 or newer is required for the MCP server.
What it helps with
- store agent messages in a local database
- retrieve relevant records within a token limit
- reduce a long log to a context budget
- keep user and agent memory scopes separate
Example prompts for the agent
- Remember that this project keeps its database in
data.db. - Check whether the user has already shared API requirements and return the matching memories.
- Fit
logs/session.txtinto the context budget.
How to install LLMSlim memory
Platform CLI
claude mcp add --env LLMSLIM_MEMORY_DB=<LLMSLIM_MEMORY_DB> --env LLMSLIM_USER_ID=<LLMSLIM_USER_ID> --env LLMSLIM_AGENT_ID=<LLMSLIM_AGENT_ID> --transport stdio llmslim-memory -- uvx llmslimReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llmslim <command>
Platform CLI
codex mcp add llmslim-memory --env LLMSLIM_MEMORY_DB=<LLMSLIM_MEMORY_DB> --env LLMSLIM_USER_ID=<LLMSLIM_USER_ID> --env LLMSLIM_AGENT_ID=<LLMSLIM_AGENT_ID> -- uvx llmslimReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llmslim <command>
Config file
{
"mcpServers": {
"llmslim-memory": {
"command": "uvx",
"args": [
"llmslim"
],
"env": {
"LLMSLIM_MEMORY_DB": "<LLMSLIM_MEMORY_DB>",
"LLMSLIM_USER_ID": "<LLMSLIM_USER_ID>",
"LLMSLIM_AGENT_ID": "<LLMSLIM_AGENT_ID>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llmslim <command>
Config file
{
"servers": {
"llmslim-memory": {
"type": "stdio",
"command": "uvx",
"args": [
"llmslim"
],
"env": {
"LLMSLIM_MEMORY_DB": "<LLMSLIM_MEMORY_DB>",
"LLMSLIM_USER_ID": "<LLMSLIM_USER_ID>",
"LLMSLIM_AGENT_ID": "<LLMSLIM_AGENT_ID>"
}
}
}
}Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llmslim <command>
Platform CLI
gemini mcp add -e LLMSLIM_MEMORY_DB=<LLMSLIM_MEMORY_DB> -e LLMSLIM_USER_ID=<LLMSLIM_USER_ID> -e LLMSLIM_AGENT_ID=<LLMSLIM_AGENT_ID> llmslim-memory uvx llmslimReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llmslim <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 LLMSlim memory
How do I install LLMSlim memory in Claude Code?
Run claude mcp add llmslim -- uvx llmslim. Claude Code can then start the MCP server.
What does LLMSlim memory do?
It stores messages as provided and retrieves relevant records within a token budget. The default memory flow does not call an LLM or require an API key.
Which Python version does the MCP server need?
The MCP server needs Python 3.10 or newer. The LLMSlim library itself supports Python 3.9 or newer.