Integrates with the Google Gemini CLI to provide semantic memory, pattern detection, and time-aware session orientation.
Enables persistent context management and architectural decision tracking for the OpenAI Codex CLI across multiple development sessions.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Context FabricRecall the key architectural decisions from our last session."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Context Fabric
Persistent memory for AI coding agents. Your agent remembers everything -- across sessions, projects, and tools.
Beta Software. Context Fabric works and is actively used, but APIs and storage formats may change between versions. Pin your version and check the CHANGELOG before upgrading.
The Problem
Every time an AI CLI session ends, its context vanishes. Decisions, patterns, bug fixes -- gone. Next session, you start from scratch.
The Solution
Context Fabric is an MCP server that gives your AI agent a three-layer memory system and time-aware orientation. It remembers what happened, what changed while you were away, and what matters right now. No external APIs. No cloud. Everything runs locally.
Features
Three-layer memory -- Working (L1), Project (L2), Semantic (L3). Memories auto-route to the right layer.
Local code indexing -- Scans source files, extracts symbols (functions/classes/types), and stays up-to-date via file watching. Search by text, symbol name, or semantic similarity.
Semantic recall -- Search by meaning using in-process vector embeddings. No API keys needed.
Time-aware orientation -- "What happened while I was away?" Offline gap detection, timezone support, session continuity.
Ghost messages -- Relevant memories surface silently via
context.getCurrentwithout cluttering the conversation.Pattern detection -- Auto-captures and reuses code patterns across projects.
Self-installing -- Ask your AI to run
context.setupand it configures itself into any supported CLI.Docker-first -- Cross-platform
docker run --rm -i. No Node.js required on the host.Hybrid search -- FTS5 BM25 + vector cosine + Reciprocal Rank Fusion. Keyword, semantic, or both.
12 MCP tools -- Store, recall, orient, getCurrent, summarize, searchCode, CRUD (get/update/delete/list), reportEvent, setup.
Zero external dependencies -- All storage is SQLite. All search is local. Nothing leaves your machine.
Supported CLIs
CLI | Setup | Docs |
Claude Code |
| |
Kimi |
| |
OpenCode |
| |
Codex CLI |
| |
Gemini CLI |
| |
Cursor |
| |
Claude Desktop |
|
Skip manual config entirely. Once Context Fabric is running inany CLI, the AI can install itself into all the others -- see Quick Start step 3.
Quick Start
Get running in 3 steps:
# 1. Clone and build the Docker image (~2 min)
git clone https://github.com/Abaddollyon/context-fabric.git
cd context-fabric
docker build -t context-fabric .
# 2. Test that it works
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' \
| docker run --rm -i context-fabric3. Add to your CLI. Point your MCP config at the Docker transport:
docker run --rm -i -v context-fabric-data:/data/.context-fabric context-fabricSee CLI Setup for copy-paste configs for all 7 CLIs, or let the AI do it -- once Context Fabric is running in one CLI, tell it:
"Install and configure Context Fabric for Cursor using Docker"
It writes the config automatically. No manual editing needed.
Requires Node.js 22.5+:
git clone https://github.com/Abaddollyon/context-fabric.git
cd context-fabric
npm install && npm run buildThe server is at dist/server.js. Point your CLI's MCP config at node dist/server.js.
What It Looks Like
Start a session. The AI calls context.orient and instantly knows where it is:
It is 9:15 AM on Wednesday, Feb 25 (America/New_York).
Project: /home/user/myapp.
Last session: 14 hours ago. 3 new memories added while you were away.Store a decision. The AI remembers it next session, next week, across tools:
// Store
{ "type": "decision", "content": "Use Zod for all API validation. Schemas in src/schemas/." }
// Recall (semantic search -- doesn't need exact words)
{ "query": "how do we validate inputs?" }
// => "Use Zod for all API validation. Schemas in src/schemas/." (similarity: 0.91)No configuration. No prompting. Memories route to the right layer automatically.
How It Works
CLI (Claude Code, Cursor, etc.)
|
| MCP protocol (stdio / Docker)
v
Context Fabric Server
|-- Smart Router -----> L1: Working Memory (in-memory, session-scoped)
|-- Time Service L2: Project Memory (SQLite, per-project)
| L3: Semantic Memory (SQLite + vector search, cross-project)Memories auto-route to the right layer. Scratchpad notes go to L1 (ephemeral). Decisions and bug fixes go to L2 (persistent). Code patterns and conventions go to L3 (searchable by meaning). See Architecture for the full deep dive.
Documentation
Resource | Description |
Installation, first run, Docker and local setup | |
Per-CLI configuration (all 7 supported CLIs) | |
All 12 MCP tools with full parameter docs | |
Type system, three layers, smart routing, decay | |
Storage paths, TTL, embedding, environment variables | |
System prompt instructions for automatic tool usage | |
System internals, data flow, embedding strategy | |
Version history and migration notes |
Contributing
Contributions are welcome. See CONTRIBUTING.md for how to get started.
License
Stop re-explaining your codebase every session.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.