What the krusch-context-mcp MCP server does
The krusch-context-mcp MCP server gives AI coding agents a local store for project decisions, invariants, bug diagnoses, lessons, and blockers. It is designed for context that should persist between sessions rather than for source-code indexing, AST analysis, Git history, document ingestion, or legal and business workflows.
The server limits its interface to five canonical tools. Retrieved context can include active memories, steering rules, and project state. Stored memories use a fixed five-category taxonomy, which keeps writes focused on information relevant to ongoing development. The system also identifies likely duplicate memories and records when knowledge has been superseded or invalidated.
How it works
By default, krusch-context-mcp stores data in a SQLite database at .agent/context.db and requires no Docker deployment. With no embedding provider configured, retrieval remains local and uses deterministic keyword extraction, recency scoring, and heuristic tags. Ollama can provide local embeddings, while OpenRouter can provide remote embeddings when the corresponding settings are supplied.
The usual agent workflow starts with retrieve, which can return active context within a token limit. New decisions or observations go through remember. If an existing item has become outdated, revise can supersede it with lineage tracking or invalidate it with a required explanation. The nudge tool checks a proposed diff against active invariants, normally at a pre-commit or manual boundary, and limits the result to one to three findings. health reports storage details, taxonomy counts, and a 30-day TTL review.
When provenance is attached to a memory, the server records a file, locator, quoted sentence, hash, and line range. Later state retrieval can detect source changes, adjust line references when content moves, or mark the provenance as drifted.
Setup and configuration
Install and initialize the project-local setup with Node.js 22 or newer:
npx krusch-context-mcp init
Initialization creates the SQLite database, prepares a project .env, seeds initial context, runs a diagnostic check, and prints configuration examples for supported agent clients. It also clears stale MCP tool schemas from local IDE caches. The default setup needs no environment variables.
Optional embedding configuration includes OLLAMA_URL with EMBED_MODEL for local Ollama embeddings, or OPENROUTER_API_KEY with EMBED_MODEL for OpenRouter embeddings. PostgreSQL is available through STORAGE_MODE=postgres for centralized persistence across machines and multi-agent deployments; SQLite is the stated default for individual projects.
Tools and capabilities
krusch_context_retrieve: Returns active memories, rules, and state within a token budget, with citations.
krusch_context_remember: Adds categorized project knowledge and warns about near-duplicates at the documented similarity threshold.
krusch_context_revise: Supersedes stale records or invalidates obsolete rules with a reason.
krusch_context_nudge: Audits proposed changes against active invariants.
krusch_context_health: Reports storage mode, memory counts, and TTL review information.
The krusch-context-mcp MCP server also aliases older tool names from earlier releases and can migrate the prior .agent/memory.db path to the current database location through initialization.
Limitations and notes
Use a separate code-search or Git-focused tool for symbols, call graphs, and Git DAG traversal. This server is not a cloud SaaS service and does not provide those indexing functions. Its nudge trigger rejects every_turn, so auditing is intended for focused lifecycle points rather than every interaction. PostgreSQL is aimed at shared, multi-machine deployments; local SQLite is the recommended starting point for a single developer or IDE session.