# LLMSlim memory

This MCP server keeps agent and user messages in local SQLite, then selects relevant context under a token budget.

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

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

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `LLMSLIM_MEMORY_DB`, `LLMSLIM_USER_ID`, `LLMSLIM_AGENT_ID` — 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 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 llmslim
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llmslim <command>

### Codex

**Platform CLI**
```bash
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 llmslim
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llmslim <command>

### Cursor

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

### GitHub Copilot

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

### Gemini CLI

**Platform CLI**
```bash
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 llmslim
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from llmslim <command>

## When to use it
- 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
- 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.txt` into the context budget.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
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
