Krusch Context MCP
Local MCP server: five tools to store, retrieve, and retire project decisions. SQLite by default.
接入你的智能体
從發布者安裝。不是 PlugMCP 端點。
遠端 URL 還是本機指令? 兩種安裝方式的差異
📖 Read the Systems Deep Dive: Check out the published architecture essay Beyond Flat Vector RAG: What Makes krusch-context-mcp Special on krusch.dev, or the local companion guide in
docs/WHAT_MAKES_IT_SPECIAL.md.
Krusch Context MCP gives AI coding agents (Cursor, Claude Code, Windsurf, Antigravity) persistent working memory across sessions. It captures architectural decisions, invariants, lessons, and bug diagnoses, warns on near-duplicate memories, maintains temporal lineage when facts are superseded or invalidated, and audits diffs against active constraints.
krusch-git or your IDE's native search.krusch-law), document ingestion (krusch-nexus), and contract graphs (krusch-biz) live in separate companion repositories.Requires Node.js >= 22.0.0. Run once inside your project repository:
npx krusch-context-mcp init
This command will:
.agent/context.db via node:sqlite..env with sensible defaults.Krusch Context MCP exposes strictly 5 canonical verbs designed to fit into standard coding workflows:
Coding agents should interact with memory at specific lifecycle boundaries:
┌─────────────────────────────────────────────────────────────┐
│ 1. SESSION START │
│ Agent calls retrieve(query: '*', include_state: true) │
│ -> Obtains active invariants, recent decisions, blockers │
└──────────────────────────────┬──────────────────────────────┘
│
┌──────────────────────────────▼──────────────────────────────┐
│ 2. DURING WORK │
│ Agent calls remember(content: '...', category: '...') │
│ -> If near-duplicate returned, agent calls revise(...) │
└──────────────────────────────┬──────────────────────────────┘
│
┌──────────────────────────────▼──────────────────────────────┐
│ 3. PRE-COMMIT / PRE-EDIT │
│ Agent calls nudge(trigger: 'pre_commit') │
│ -> Audits code against active invariants (max 3 findings)│
└─────────────────────────────────────────────────────────────┘
To prevent memory hallucination and database pollution:
decision: Architectural choices, design directions, trade-offs.invariant: Non-negotiable rules (e.g., "Use node:sqlite, zero native compiles").bug: Solved defects, regressions, and root-cause analyses.lesson: Tactical insights and framework discoveries.blocker: Active dependencies or external obstacles.revise(action: 'supersede', target_id: ...). This protects contrasting rules (e.g., "Allow CORS" vs "Do not allow CORS") while flagging twin facts.revise(action: 'invalidate') strictly requires a non-empty reason.nudge caps findings at 3 with concrete evidence, rejecting every_turn triggers to eliminate auditor nagware.provenance: { file, locator, quoted_sentence } to remember computes a normalized SHA-256 anchor_hash and line range (start_line..end_line). On subsequent retrieve(include_state: true) calls, the engine verifies the span on disk—automatically healing line numbers when code shifts above it, or flagging [DRIFTED] when the underlying code changes.OLLAMA_URL="http://127.0.0.1:11434" with EMBED_MODEL="snowflake-arctic-embed2" (8,192-token context, 1024 dims, ~664 MB VRAM, asymmetric query: retrieval via /api/embed; also supports qwen3-embedding MRL 1024d, nomic-embed-text, and legacy bge-large).OPENROUTER_API_KEY="sk-..." with EMBED_MODEL="baai/bge-large-en-v1.5" (or any 1024-dim OpenRouter embedding model) for zero-local-VRAM embeddings.Float32Array binary vector blobs (4 KB/row) and an external-content Porter-stemmed FTS5 lexical index. Zero Docker, zero setup.STORAGE_MODE=postgres): Required only when scaling to multi-agent swarms across different machines needing centralized persistence and server-side pgvector HNSW indexing.add_memory, search_memory, compile_state, supersede_memory, invalidate_memory, proactive_nudge) are automatically aliased to the 5 verbs with a deprecation notice..agent/memory.db. v1.8+ uses .agent/context.db. Run npx krusch-context-mcp init to migrate.┌─────────────────────────────────────────────────────────────┐
│ AI Coding Agent (Cursor / Claude) │
└──────────────────────────────┬──────────────────────────────┘
│
┌───────────────┴───────────────┐
▼ ▼
┌─────────────────────────────┐ ┌─────────────────────────────┐
│ krusch-context-mcp (v2.0) │ │ krusch-git (External) │
│ Project Memory & Steering │ │ Codebase RAG & AST Search │
│ (5 Canonical Verbs) │ │ (7 Specialized Tools) │
└──────────────┬──────────────┘ └─────────────────────────────┘
│
▼
┌─────────────────────────────┐
│ .agent/context.db │
│ (node:sqlite, Node ≥22) │
└─────────────────────────────┘
Other specialized tools (krusch-nexus, krusch-law, krusch-biz) run as independent MCP servers in their own repositories.
.cursor/mcp.json){
"mcpServers": {
"krusch-context": {
"command": "npx",
"args": ["-y", "krusch-context-mcp"]
}
}
}
claude mcp add krusch-context -- npx -y krusch-context-mcp
claude_desktop_config.json){
"mcpServers": {
"krusch-context": {
"command": "npx",
"args": ["-y", "krusch-context-mcp"]
}
}
}
npm run docs:generate).v2.0.0 multi-scale retrieval invariants.100 conversations (~178.34M tokens) and 2,000/2,000 questions (100K, 500K, 1M, 10M splits) on 96 GB Blackwell G4 (snowflake-arctic-embed2 8K ctx on SQLite: v2.0.0 reaches 92.58% Hybrid 8K at 100K, 42.23% R@10 at 1M, and 55.54% Hybrid 8K [93.00% IE] + 48.18% / 58.71% E2E QA at 10M, beating cloud past.dev on Contradiction Resolution across all 4 splits and on 10M Multi-Session Reasoning across both Referees [29.54% / 38.33% vs. 28.17%]) with 5/5 zero-leakage verification.# Run full unit & contract test suite (100% SQLite, zero Docker)
npm test
# Check storage and memory health
npm run health
MIT © kruschdev
Long-term memory for AI coding agents — remembers project rules across sessions at $0 AI cost (MCP server, SQLite/PostgreSQL). 90.26% on Snap LoCoMo.
工具
尚無工具清單。遠端伺服器會在首次健康檢查後取得工具清單。
常見問題
在本頁複製適用於 Cursor、Claude Desktop、Claude Code 或 VS Code 的 stdio 設定。它使用發布者的安裝方式,而不是 PlugMCP 代理伺服器。
這筆記錄未列出必要的環境變數。
Krusch Context 透過 stdio 在本機執行。
上次檢查時間:2026-11-12。 Long-term memory for AI coding agents — remembers project rules across sessions at $0 AI cost (MCP server, SQLite/PostgreSQL). 90.26% on Snap LoCoMo.