Context Fabric logo

Context Fabric

Tracks project state, detects context drift, and delivers token-budgeted coding briefings through MCP.

Install Context Fabric

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "context-fabric": {
      "command": "npx",
      "args": [
        "-y",
        "context-fabric"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio context-fabric -- npx -y context-fabric

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We hit an unexpected error while testing this listing automatically.

npx -y context-fabric

Rate limit exceeded, please try again later - you have reached the maximum number of concurrent E2B sandboxes (20). If you need more, please visit 'https://e2b.dev/docs/billing'

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The Context Fabric MCP server captures project state from Git commits, checks stored context against current files, and returns structured briefings for AI coding agents. A local SQLite store records file fingerprints, exported symbols, token estimates, and searchable components; MCP tools query and update that data. Use it for multi-session coding projects where stale handoff notes or manually maintained agent instructions can mislead an AI assistant. Setup requires a Git repository, Node.js 22 or newer, and an MCP client configuration.

Use cases

  • Capture project state after Git commits
  • Check whether stored context has drifted
  • Generate task-specific coding briefings
  • Persist architecture decisions across sessions
  • Inspect local database and hook health

Key features

  • Automatic post-commit context capture
  • SHA256-based drift detection
  • SQLite FTS5 and BM25 retrieval
  • Token-budgeted briefing selection
  • Architecture decision persistence
  • Local health and repair commands

Tools5

What Context Fabric lets your agent do. Expand a tool for its parameters.

Self-reported~76 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

25/28 checks healthy over the last 117d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 17d ago via OSV.dev · context-fabric (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
npm downloads353Package downloads in the last 30 days.
Last commit4d agoMost recent push to the default branch.
Install checkInconclusiveWe hit an unexpected error running the automated check.
Tools exposed5Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Context Fabric works

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:

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

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Context Fabric

Context Fabric is an MCP server that connects AI coding agents to a local SQLite project-context store and Git commit workflow. Its main tools capture context, check drift, query task briefings, report database and hook health, and save architecture decisions for later sessions.

Run `npx context-fabric init` inside a Git-managed repository. The command initializes the SQLite store, installs the post-commit hook, stages the local runtime, and performs an initial capture. Then add the documented npm command to your MCP client configuration.

Add the `context-fabric` MCP entry to Cursor’s MCP configuration, using `npx -y context-fabric` on macOS or Linux, or the Windows `cmd /c` form.

It compares stored SHA256 fingerprints with the current state of tracked files. The drift check returns a score from 0 to 100, a LOW, MED, or HIGH severity, and the stale files identified by path and hash difference.

Run `npx context-fabric doctor --repair`. It refreshes the local runtime, reinstalls the stable hook wrapper, validates `.gitignore`, and rebuilds the search index when the database is healthy.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewContext Fabric AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/context-fabric?style=directory)](https://allmcps.com/mcp/context-fabric)
HTML Embed
<a href="https://allmcps.com/mcp/context-fabric"><img src="https://allmcps.com/api/badge/context-fabric?style=directory" alt="Context Fabric on AllMCPs" /></a>