# Context Fabric [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/VIKAS9793/context-fabric  
**GitHub Stars:** 2  
**npm Downloads (last month):** 353  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/context-fabric

## Description
Project continuity infrastructure. Detects context drift and routes token-budgeted AI briefings.

## Tools
Capabilities this server exposes over MCP:

- **cf_capture** — Manual context capture outside of a git commit
- **cf_drift** — Standalone drift check — returns severity and stale file count
- **cf_query** — Full context briefing for the current task
- **cf_health** — Report database, capture, hook, and search index health
- **cf_log_decision** — Persist an architecture decision across sessions

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "context-fabric": {
    "command": "npx",
    "args": ["-y","context-fabric"]
  }
}
```

## Documentation

## What Context Fabric does

The Context Fabric MCP server maintains local project context for AI-assisted coding sessions. It captures repository state after Git commits, stores that information in SQLite, checks whether recorded files still match the working project, and assembles task-specific briefings.

The system is intended for projects that span multiple agent sessions. It addresses context becoming outdated after code changes by reporting stale files and placing a drift warning before the rest of a briefing when the detected severity is medium or high. It also records architecture decisions so they can be carried into later sessions.

## How it works

Running `context-fabric init` creates the local store, installs a Git post-commit hook, places the runtime under `.context-fabric/runtime`, and performs an initial capture. Later commits trigger automatic capture without another manual action.

The Context Fabric MCP server uses SHA256 fingerprints to compare stored file state with current tracked files. Its local component index uses SQLite FTS5 and BM25 ranking to find relevant files and exported symbols from a query. Path matches receive greater weight than export-symbol matches, while queries with no matching terms fall back to recency ordering.

A configurable token ceiling limits which ranked components enter the response. The default is 8% of the model context window. Components that exceed the remaining budget are skipped, and the selected material is composed into Markdown sections covering project state, architecture, decisions, and budget information.

## Setup and configuration

From a Git-managed repository, run:

```bash
npx context-fabric init
```

Then add the server to the MCP configuration used by the client. On macOS or Linux, the command uses `npx -y context-fabric`. On Windows, the documented configuration invokes `cmd` with `/c`, followed by `npx context-fabric`.

Node.js 22.0.0 through 24.x is listed as supported. The package is distributed through npm. For installation checks or repair, run `npx context-fabric doctor` or `npx context-fabric doctor --repair`. Repair refreshes the local runtime, reinstalls the hook wrapper, checks `.gitignore`, and rebuilds the search index when the database is healthy.

## Tools and capabilities

The MCP tools are:

- `cf_capture`: Capture context manually outside a Git commit.
- `cf_drift`: Return drift severity and the number of stale files.
- `cf_query`: Produce a full context briefing for the current task.
- `cf_health`: Report database, capture, hook, and search-index health.
- `cf_log_decision`: Save an architecture decision for use across sessions.

The Context Fabric MCP server combines these operations with automatic post-commit capture, drift scoring from 0 to 100, relevance-ranked retrieval, token-budgeted selection, and structured briefing generation.

## Limitations and notes

Context is stored locally in SQLite and depends on the Git hook and local runtime being available. The documented setup targets Git-managed repositories. The project is marked stable at version 1.2.2 and uses the MIT license.

_Full upstream README: https://allmcps.com/mcp/context-fabric/readme_

