Token-light local memory with SQLite hybrid retrieval for MCP agents.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Context that fits your local LLMs.
TinyContext is a token-light local memory layer for AI agents. It stores concise memories and their embeddings in SQLite, ranks them with hybrid BM25 and dense retrieval, and returns only the context that fits the requested token budget.
No hosted account. No giant context dumps. No required vector database.
| Tier | Use it when | Entry point |
|---|---|---|
| Python library | You are building an agent or Python application | pip install tinysuite-context |
| One-command MCP | An MCP client should launch TinyContext for you | uvx --python 3.12 --from "tinysuite-context[server]" tinycontext |
| Docker | You want persistent self-hosted storage and HTTP MCP | docker compose ... up -d |
The Python library contains the memory engine. MCP, FastAPI, and Docker are
adapters around the same save_memories, recall_memories, and
delete_memory operations.
Add TinyContext to any stdio MCP client:
The no-argument tinycontext command runs stdio MCP. On its first launch,
TinyContext downloads the selected ONNX embedding bundle into its per-user data
directory. The database is created lazily on the first save or recall. Later
launches reuse both local assets.
Check the resolved configuration and storage readiness with:
TinyContext exposes six tools:
save_memories for durable facts, preferences, decisions, and research notes. Writes are cheap and dedup/token-budgeting happens at recall time, so don't be shy about calling it β when in doubt, save it.recall_memories with a query for query-based semantic recall when previous context may help.recall_memories with no query (typically top_k=5) only when chronological continuity with the latest stored context matters; that mode is not a semantic search and does not need to run every turn.list_memories to browse the store newest-first, with pagination (limit/offset) and an optional since/until date range on created_at. It does no embedding calls, no ranking, and no token-budget cutoff, so it's the answer to "what's actually in there" and "what did we do last week" β ground on current_time from a recent recall/list response, compute the range, and page with offset until has_more is false. It's also how to see the rest of a recall_memories response that a token budget cut short (that response's <notice> says so, alongside matched_count).get_memory to read one memory's full content by ref/id, bypassing ranking β e.g. after list_memories shows a truncated preview.delete_memory to forget or correct a previously saved memory (find its ref via recall_memories or list_memories first).Each memory saved via save_memories can set kind to "episodic" (default)
or "profile". Profile memories are for durable identity/preference facts β
what to call the user, what they call you, how they like to work β and are
global to the store regardless of session_id. They're never semantically
ranked or searched; instead, every recall_memories call (query or no-query
alike) automatically attaches the full profile pool, trimmed to its own
profile_max_tokens budget, so there's no separate call or "remember this"
prompt needed to see them. To correct a profile fact, recall first to find
its ref, then use update_memory rather than saving a second, conflicting
one.
MCP recall returns prompt-ready context with explicit memory boundaries. The profile block (when non-empty) precedes the ranked/recent block:
Recent recall uses an explicit mode and newest-first indexes without fabricated semantic metadata:
ref is a short, deletion-safe reference derived from the memory's id --
stable across recalls, unlike index, which just reflects the current
ranking. Pass it straight to delete_memory; the full id also still works.
Python and FastAPI semantic recall remain structured and include relevance and
retrieval scores. Recent recall instead returns mode: "recent", the current
UTC time, newest-first rank, id, ref, creation timestamp, and token counts;
it omits semantic query, relevance, and similarity fields.
Install only the transport-independent core:
Programmatic configuration does not read environment variables or depend on the
checkout. Passing no config uses the per-user data directory returned by
platformdirs.
Run the published image as an MCP server over Streamable HTTP:
Connect an MCP client to:
The data volume persists /data/memories.db and /data/models.
compose.quickstart.yaml is deliberately a local, single-user example. Do
not expose it directly to multiple users. For an authenticated hosted service,
use compose.hosted.yaml behind a reverse proxy:
The proxy is the only component on tinycontext-proxy that may reach the
container. It must authenticate the caller, strip any incoming
X-TinyContext-User-Id header, and inject that header with a stable verified
user ID. Set TINYCONTEXT_TRUSTED_PROXY_CIDRS to the proxy's direct Docker or
private-network CIDR. TinyContext rejects requests from other peers and never
accepts a user ID in an MCP tool or API request body.
Hosted tenancy stores each user in a separate SQLite file under
TINYCONTEXT_TENANT_STORE_DIR; filenames are HMAC-derived and do not expose
the source user ID. Existing /data/memories.db data is not migrated, because
it has no safe ownership attribution. session_id remains an optional scope
inside a single user's store.
Stop the service with:
For a local image build:
The optional FastAPI profile uses the same image:
http://localhost:8000/mcphttp://localhost:8001Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/tinycontext)<a href="https://allmcps.com/mcp/tinycontext"><img src="https://allmcps.com/api/badge/tinycontext?style=directory" alt="Tinycontext on AllMCPs" /></a>