Context Fabric MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add context-fabric -- docker run --rm -i -v context-fabric-data:/data/.context-fabric context-fabric
README.md

Persistent memory for AI coding agents.

Context Fabric

Persistent memory for AI coding agents. Your agent remembers everything -- across sessions, projects, and tools.

[!NOTE] 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.getCurrent without cluttering the conversation.
  • Pattern detection -- Auto-captures and reuses code patterns across projects.
  • Self-installing -- Ask your AI to run context.setup and 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 context.setup({ cli: "claude-code" }) Guide
Kimi context.setup({ cli: "kimi" }) Guide
OpenCode context.setup({ cli: "opencode" }) Guide
Codex CLI context.setup({ cli: "codex" }) Guide
Gemini CLI context.setup({ cli: "gemini" }) Guide
Cursor context.setup({ cli: "cursor" }) Guide
Claude Desktop context.setup({ cli: "claude" }) Guide

[!TIP] Skip manual config entirely. Once Context Fabric is running in any 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-fabric

3. Add to your CLI. Point your MCP config at the Docker transport:

docker run --rm -i -v context-fabric-data:/data/.context-fabric context-fabric

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

Local install (without Docker)

Requires Node.js 22.5+:

git clone https://github.com/Abaddollyon/context-fabric.git
cd context-fabric
npm install && npm run build

The 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

Tools (8)

storeStore information in the memory system
recallRetrieve information from memory
orientGet time-aware orientation for the current session
getCurrentRetrieve relevant memories for the current context
summarizeSummarize project context or memory
searchCodeSearch through local code files
reportEventLog an event into the memory system
setupConfigure the context fabric for a specific CLI

Configuration

claude_desktop_config.json
{"mcpServers":{"context-fabric":{"command":"docker","args":["run","--rm","-i","-v","context-fabric-data:/data/.context-fabric","context-fabric"]}}}

Try it

What happened in this project while I was away?
Search my codebase for the implementation of the authentication middleware.
Install and configure Context Fabric for Cursor using Docker.
Summarize the architectural decisions made in the last three sessions.
Store a note that we decided to use PostgreSQL for the new database schema.

Frequently Asked Questions

What are the key features of Context Fabric?

Three-layer memory system (Working, Project, Semantic). Local code indexing with file watching and symbol extraction. Time-aware orientation for session continuity. Hybrid search combining FTS5 BM25 and vector cosine similarity. Zero external dependencies with all storage in SQLite.

What can I use Context Fabric for?

Maintaining project context across multiple coding sessions. Quickly orienting an AI agent to recent changes after a long break. Searching for specific code patterns or symbols across a large repository. Automatically logging architectural decisions and bug fixes for future reference.

How do I install Context Fabric?

Install Context Fabric by running: docker build -t context-fabric .

What MCP clients work with Context Fabric?

Context Fabric works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Context Fabric docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare