# tinycontext

Keeps an agent's notes and facts in SQLite and hands back only what fits a set token budget. Useful when old conversations keep bloating the context.

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

## What it does

TinyContext is a local memory layer for AI agents. Entries and their embeddings live in SQLite, and retrieval is hybrid: BM25 alongside dense ranking. Only the portion that fits the requested token budget leaves the store. There is no hosted account, and no separate vector database is required.

Six tools are exposed: `save_memories`, `recall_memories`, `list_memories`, `get_memory`, `update_memory`, `delete_memory`. Saved entries carry a `kind` of `episodic` (the default) or `profile` — the latter holds durable facts about the user and is attached in full to every recall, capped by its own `profile_max_tokens` budget. Deduplication and token accounting happen at recall time, so saving often costs little.

Python 3.12 and `uvx` are required. On first launch the bare `tinycontext` command starts stdio MCP and pulls the chosen ONNX embedding set into the per-user data directory; the database appears on the first save or recall. Run `tinycontext doctor` to check the resolved configuration and storage readiness.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `MCP_TRANSPORT`, `TINYCONTEXT_CONFIG_PATH`, `TINYCONTEXT_MEMORY_DB_PATH`, `TINYCONTEXT_MODELS_DIR`, `OTEL_SERVICE_NAME`, `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_EXPORTER_OTLP_PROTOCOL`, `OTEL_EXPORTER_OTLP_HEADERS` — 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 MCP_TRANSPORT=<MCP_TRANSPORT> --env TINYCONTEXT_CONFIG_PATH=<TINYCONTEXT_CONFIG_PATH> --env TINYCONTEXT_MEMORY_DB_PATH=<TINYCONTEXT_MEMORY_DB_PATH> --env TINYCONTEXT_MODELS_DIR=<TINYCONTEXT_MODELS_DIR> --env OTEL_SERVICE_NAME=<OTEL_SERVICE_NAME> --transport stdio tinycontext -- uvx tinysuite-context
```
Replace <…> with your own values. 3 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from tinysuite-context <command>

### Codex

**Platform CLI**
```bash
codex mcp add tinycontext --env MCP_TRANSPORT=<MCP_TRANSPORT> --env TINYCONTEXT_CONFIG_PATH=<TINYCONTEXT_CONFIG_PATH> --env TINYCONTEXT_MEMORY_DB_PATH=<TINYCONTEXT_MEMORY_DB_PATH> --env TINYCONTEXT_MODELS_DIR=<TINYCONTEXT_MODELS_DIR> --env OTEL_SERVICE_NAME=<OTEL_SERVICE_NAME> -- uvx tinysuite-context
```
Replace <…> with your own values. 3 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from tinysuite-context <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "tinycontext": {
            "command": "uvx",
            "args": [
                "tinysuite-context"
            ],
            "env": {
                "MCP_TRANSPORT": "<MCP_TRANSPORT>",
                "TINYCONTEXT_CONFIG_PATH": "<TINYCONTEXT_CONFIG_PATH>",
                "TINYCONTEXT_MEMORY_DB_PATH": "<TINYCONTEXT_MEMORY_DB_PATH>",
                "TINYCONTEXT_MODELS_DIR": "<TINYCONTEXT_MODELS_DIR>",
                "OTEL_SERVICE_NAME": "<OTEL_SERVICE_NAME>"
            }
        }
    }
}
```
Replace <…> with your own values. 3 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from tinysuite-context <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "tinycontext": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "tinysuite-context"
            ],
            "env": {
                "MCP_TRANSPORT": "<MCP_TRANSPORT>",
                "TINYCONTEXT_CONFIG_PATH": "<TINYCONTEXT_CONFIG_PATH>",
                "TINYCONTEXT_MEMORY_DB_PATH": "<TINYCONTEXT_MEMORY_DB_PATH>",
                "TINYCONTEXT_MODELS_DIR": "<TINYCONTEXT_MODELS_DIR>",
                "OTEL_SERVICE_NAME": "<OTEL_SERVICE_NAME>"
            }
        }
    }
}
```
Replace <…> with your own values. 3 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from tinysuite-context <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e MCP_TRANSPORT=<MCP_TRANSPORT> -e TINYCONTEXT_CONFIG_PATH=<TINYCONTEXT_CONFIG_PATH> -e TINYCONTEXT_MEMORY_DB_PATH=<TINYCONTEXT_MEMORY_DB_PATH> -e TINYCONTEXT_MODELS_DIR=<TINYCONTEXT_MODELS_DIR> -e OTEL_SERVICE_NAME=<OTEL_SERVICE_NAME> tinycontext uvx tinysuite-context
```
Replace <…> with your own values. 3 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from tinysuite-context <command>

## When to use it
- carry agent memory across sessions without a cloud service
- fit a recall result inside a token limit
- find a stored entry by meaning rather than exact wording
- browse what has actually accumulated in the store
- correct or drop an outdated fact about the user

## Example prompts
- Save to memory that this project builds with `uv` and Python 3.12.
- Recall everything we decided about the database schema.
- List the memories saved this week.

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