# krusch-context-mcp [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/kruschdev/krusch-context-mcp  
**GitHub Stars:** 83  
**npm Downloads (last month):** 1029  
**Views:** 6  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/krusch-context-mcp

## Description
Persistent working memory and invariant steering MCP server for AI coding agents (Claude Code, Cursor, Windsurf). Captures architectural decisions, enforces project rules with pre-commit audits, and supersedes obsolete facts with temporal lineage. SQLite-first, zero Docker, <350 tokens

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

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

## Documentation

## What krusch-context-mcp does

krusch-context-mcp provides persistent working memory for AI coding agents. It records architectural decisions, project invariants, lessons, and bug diagnoses so later sessions can retrieve relevant project context. The memory model distinguishes active knowledge from facts that have been superseded or invalidated, preserving temporal lineage rather than treating every stored item as current.

The server also supports invariant steering. Agents can check proposed changes against active project constraints before committing, helping surface conflicts with documented project rules. It is intentionally focused on project memory and steering rather than source-code indexing: code symbol search, call graphs, and Git history are outside its scope.

## How it works

Storage is SQLite-first, using Node.js `node:sqlite`, write-ahead logging, and Porter stemming through SQLite FTS5. Local 1024-dimensional embeddings are available for semantic retrieval. PostgreSQL 16 with `pgvector` is an optional storage path. The server runs locally and does not require Docker, external cloud services, or API keys for the documented local verification workflow.

A five-verb agent loop covers the main lifecycle:

- Retrieve active memories, steering rules, and project state within a token limit.
- Remember new episodic facts and steering notes.
- Revise existing knowledge by superseding it or invalidating it with a reason.
- Nudge proposed diffs against active invariants.
- Check health, storage mode, memory counts, and TTL decay review information.

Near-duplicate memories are detected during writes. The server can propose a superseding revision when similarity reaches its configured threshold, while allowing contrasting rules to remain distinct.

## Setup and configuration

Node.js 22 or newer is required. From a project repository, run:

```bash
npx krusch-context-mcp init
```

Initialization creates `.agent/context.db`, prepares a project `.env` with defaults, seeds initial context, runs a health check, and prints MCP configuration examples for Cursor, Claude Code, and Claude Desktop. It also clears stale MCP tool schemas from local IDE caches.

For local development or verification, clone the repository, run `npm ci`, and use `npm test`. The documented verification commands exercise the SQLite engine, unit and contract tests, benchmark verifiers, proxy checks, and SHA-256 audit-log checks without Docker or API keys.

## Tools and capabilities

The five canonical MCP tools are:

- `krusch_context_retrieve`: Finds active memories and project state, with citations and a `limit_tokens` budget.
- `krusch_context_remember`: Stores facts and steering content while checking for near duplicates.
- `krusch_context_revise`: Supersedes stale knowledge or invalidates obsolete rules with a required reason.
- `krusch_context_nudge`: Audits proposed diffs against project invariants. Its trigger defaults to `pre_commit` or `manual`; `every_turn` is rejected.
- `krusch_context_health`: Reports storage mode, categorized memory counts, and the 30-day TTL decay review.

## Limitations and notes

The server is not an AST or Git indexer, so it should complement an IDE's code search or a dedicated Git-oriented tool. Its scope is project context, memory lifecycle, and invariant checks. PostgreSQL and `pgvector` are optional; the default path uses local SQLite. The project is released under the MIT license.

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

