شعار Krusch Context MCP

Krusch Context MCP

المجتمع
kruschdev

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

الناشرkruschdev
المستودعkrusch-context-mcp
اللغةJavaScript
التفريعات
6
النجوم
72
الأدوات المتاحة
0
نوع نقل البياناتstdio
الترخيصMIT
الروابط
  • اربط الأدوات بسير عمل الذكاء الاصطناعي

    يتيح Krusch Context MCP إمكانات MCP التي يمكن لتطبيقات الذكاء الاصطناعي العميلة ووكلاء الذكاء الاصطناعي المتوافقة استخدامها.

  • الأدوات المتاحة: 0

    تصفّح الإجراءات القابلة للاستدعاء أدناه، بما في ذلك أسماؤها وأوصافها عندما يوفّرها الخادم.

  • إعدادات جاهزة للنسخ

    استخدم أمثلة إعداد التثبيت لتهيئة هذا الخادم في تطبيق MCP العميل المفضّل لديك.

  • مؤشرات الاهتمام بالمصدر المفتوح

    النجوم: 72، والنسخ المتفرعة: 6 في المستودع المرتبط.

Krusch Context MCP

Local MCP server: five tools to store, retrieve, and retire project decisions. SQLite by default.

Node.js 22+ License: MIT MCP: 5 Verbs Storage: SQLite-First Article: What Makes It Special Docs: What Makes It Special HOL Guard Catalog M8ven Score

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


🚫 What This Is Not

  • Not a codebase AST or Git indexer: Code symbol search, call graphs, and Git DAG traversal belong in krusch-git or your IDE's native search.
  • Not a 61-tool cafeteria: Collapsed to strictly 5 canonical verbs (~350 prompt tokens) for boring reliability.
  • Not a cloud SaaS platform: Runs 100% locally on your machine with zero external cloud dependencies.
  • Not a monolithic domain suite: Legal compliance (krusch-law), document ingestion (krusch-nexus), and contract graphs (krusch-biz) live in separate companion repositories.

⚡ 30-Second Quickstart

Requires Node.js >= 22.0.0. Run once inside your project repository:

bash
npx krusch-context-mcp init

This command will:

  1. Validate Node >= 22.0.0 and initialize .agent/context.db via node:sqlite.
  2. Clear stale MCP tool schemas from local IDE caches.
  3. Create your project .env with sensible defaults.
  4. Seed initial project context and run a diagnostic health check.
  5. Print copy-paste JSON configurations for Cursor, Claude Code, and Claude Desktop.

🛠️ The 5-Verb Agent Loop

Krusch Context MCP exposes strictly 5 canonical verbs designed to fit into standard coding workflows:

VerbShort AliasPurpose
krusch_context_retrieveretrievePulls active memories, steering rules, and project state briefings within a strict limit_tokens budget. Returns citations.
krusch_context_rememberrememberWrites episodic facts and steering nuggets. Detects near-duplicates (similarity >= 0.85) and proposes revise(action: 'supersede') without blocking contrasting rules.
krusch_context_revisereviseUpdates stale knowledge (supersede with lineage tracking) or revokes obsolete rules (invalidate with mandatory reason).
krusch_context_nudgenudgePre-commit auditor that checks proposed diffs against active project invariants (max 1–3 findings). Trigger defaults to pre_commit or manual; rejects every_turn.
krusch_context_healthhealthReports storage mode, memory counts by closed taxonomy, and 30-day TTL decay review.

🤖 Recommended Agent Protocol

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)│
└─────────────────────────────────────────────────────────────┘

🛡️ Safe Memory Writes: Closed Taxonomy & Deduplication

To prevent memory hallucination and database pollution:

  1. Closed Taxonomy: Every write must use one of 5 categories:
    • 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.
  2. Near-Duplicate Detection: If a proposed memory matches an existing active record ($\ge 0.85$ cosine similarity), the memory is saved with a warning proposing revise(action: 'supersede', target_id: ...). This protects contrasting rules (e.g., "Allow CORS" vs "Do not allow CORS") while flagging twin facts.
  3. Compulsory Invalidation Reasons: Calling revise(action: 'invalidate') strictly requires a non-empty reason.
  4. Focused Audits: nudge caps findings at 3 with concrete evidence, rejecting every_turn triggers to eliminate auditor nagware.
  5. Span-Grounded Provenance & Drift Self-Healing: Passing 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.

🧠 Embedding Reality & Offline Mode

  • Zero-GPU Default: If neither Ollama nor an API key is present, the engine runs 100% offline using deterministic keyword extraction, recency scoring, and heuristic tag indexing.
  • Local Ollama (Optional): Set OLLAMA_URL="http://127.0.0.1:11434" with EMBED_MODEL="bge-large" (1024 dims).
  • Remote Cloud (Optional): Set OPENROUTER_API_KEY="sk-..." with EMBED_MODEL="baai/bge-large-en-v1.5" for zero-local-VRAM embeddings.

🐘 When Do You Need PostgreSQL?

  • Use SQLite (Default): Perfect for single developers, local IDE sessions, and projects with hundreds to thousands of decisions. Zero Docker, zero setup.
  • Use PostgreSQL (STORAGE_MODE=postgres): Required only when scaling to multi-agent swarms across different machines needing centralized persistence and server-side pgvector HNSW indexing.

🔄 Migration from v1.6 / v1.7

  • Tool Aliases: Legacy tool names (add_memory, search_memory, compile_state, supersede_memory, invalidate_memory, proactive_nudge) are automatically aliased to the 5 verbs with a deprecation notice.
  • Database Path: v1.7 used .agent/memory.db. v1.8.0 uses .agent/context.db. Run npx krusch-context-mcp init to migrate.
  • See docs/MIGRATION.md for the complete mapping table.

🧩 Sibling Architecture

┌─────────────────────────────────────────────────────────────┐
│                 AI Coding Agent (Cursor / Claude)           │
└──────────────────────────────┬──────────────────────────────┘
                               │
               ┌───────────────┴───────────────┐
               ▼                               ▼
┌─────────────────────────────┐ ┌─────────────────────────────┐
│  krusch-context-mcp (v1.8)  │ │   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.


💻 IDE Configuration

Cursor (.cursor/mcp.json)

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

Claude Code

bash
claude mcp add krusch-context -- npx -y krusch-context-mcp

Claude Desktop (claude_desktop_config.json)

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

📚 Documentation & Specifications


🧪 Testing

bash
# Run full unit & contract test suite (100% SQLite, zero Docker)
npm test

# Check storage and memory health
npm run health

License

MIT © kruschdev

استخدم MCP الخاص بـ Krusch Context MCP مع نماذج ذكاء اصطناعي متعددة

يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا بمجرد توصيل Krusch Context MCP، يمكنك استخدامه مع نماذج ذكاء اصطناعي مختلفة في TypingMind بدلًا من إعداده لكل نموذج على حدة. يعمل تكامل MCP هذا محليًا عبر موصل MCP الخاص بـ TypingMind على جهازك.

دليل الإعداد لاستخدام الموصل المحلي

استخدم هذا الخيار عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات أو موارد خاصة على جهاز الكمبيوتر لديك.

1

فتح إعدادات MCP

في TypingMind، انتقل إلى «الإعدادات»، ثم «الإعدادات المتقدمة»، ثم «بروتوكول سياق النموذج»، واختر «إعداد الموصل».

  1. افتح TypingMind في متصفحك.
  2. انقر على أيقونة الإعدادات.
  3. انتقل إلى الإعدادات المتقدمة.
  4. افتح قسم بروتوكول سياق النموذج.
  5. انقر على «إعداد الموصل» واختر «هذا الجهاز».
شاشة إعداد موصل MCP في TypingMind مع تحديد «هذا الجهاز»
2

تنفيذ أمر الموصل

اختر «هذا الجهاز»، وانسخ الأمر من TypingMind وشغّله في Terminal. أبقِ العملية قيد التشغيل أثناء استخدام MCP.

  1. انسخ أمر الإعداد الذي يعرضه TypingMind.
  2. افتح Terminal على macOS أو Windows Terminal على Windows.
  3. الصق الأمر ونفّذه.
  4. وافق على تثبيت الحزمة إذا طلب منك Terminal تأكيد المتابعة.
  5. أبقِ نافذة Terminal والعملية التي تعمل فيها قيد التشغيل أثناء استخدام أدوات MCP.
3

أضف Krusch Context MCP كخادم

عندما تظهر حالة الموصل «جاهز»، انقر على «تعديل الخوادم» والصق إعدادات خادم MCP.

  1. انتظر حتى تظهر حالة الموصل «جاهز».
  2. انقر على «تعديل الخوادم».
  3. الصق إعدادات خادم MCP الخاص بـ Krusch Context MCP.
  4. احفظ قائمة الخوادم.
  5. حدّث الحالة إذا أردت التأكد من أن الموصل لا يزال جاهزًا.
إعدادات MCP في TypingMind تعرض خادمًا نشطًا وزر «تعديل الخوادم»
{
  "mcpServers": {
    "krusch-context-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

استخدام الاتصال مع نماذج مختلفة

احفظ قائمة الخوادم، وافتح «الإضافات»، وفعّل أدوات MCP الخاصة بـ Krusch Context MCP، ثم اختر أي نموذج ذكاء اصطناعي مدعوم في TypingMind واستخدم الأدوات في المحادثة أو أسندها إلى وكيل ذكاء اصطناعي.

  1. افتح صفحة الإضافات في TypingMind.
  2. فعّل أدوات MCP الخاصة بـ Krusch Context MCP.
  3. ابدأ محادثة واختر نموذج الذكاء الاصطناعي الذي تريد استخدامه.
  4. استخدم أدوات MCP في المحادثة أو عيّنها لوكيل ذكاء اصطناعي.
  5. انتقل إلى نموذج ذكاء اصطناعي آخر عند الحاجة دون إعادة الاتصال بـ MCP.
محادثة في TypingMind تستخدم أدوات MCP المفعّلة مع نموذج ذكاء اصطناعي محدّد
هل يمكنك استخدام Krusch Context MCP لمساعدتي في هذه المهمة؟
Krusch Context MCP
بالتأكيد. قرأته.
إليك ما وجدته باستخدام Krusch Context MCP.

الأسئلة الشائعة

ما استخدامات خادم MCP Krusch Context MCP؟

Krusch Context MCP هو خادم MCP يتيح لتطبيقات الذكاء الاصطناعي المتوافقة الاتصال بأدوات ومصادر سياق خارجية. في TypingMind، يمكنك إضافة خادم MCP هذا مرة واحدة وإتاحة أدواته في مساحة عملك للذكاء الاصطناعي.

هل يمكنني استخدام خادم MCP Krusch Context MCP مع نماذج ذكاء اصطناعي متعددة في TypingMind؟

نعم. يربط TypingMind أدوات MCP على مستوى مساحة العمل، لذا يمكنك استخدام Krusch Context MCP مع نماذج ذكاء اصطناعي مختلفة مثل Claude أو ChatGPT أو Gemini أو غيرها من النماذج التي أعددتها في TypingMind، دون إعداد خادم MCP لكل نموذج على حدة.

لماذا تستخدم موصل MCP Krusch Context MCP مع TypingMind؟

يُعد TypingMind من أفضل واجهات المحادثة مع النماذج اللغوية الكبيرة، إذ يجمع نماذج ذكاء اصطناعي متعددة ومطالبات وإضافات ووكلاء ذكاء اصطناعي ومفاتيح API وأدوات MCP في مساحة عمل واحدة. بعد توصيل Krusch Context MCP، يمكنك استخدام أدوات MCP الخاصة به عبر نماذجك المفضلة مع الحفاظ على سير عمل محادثاتك منظمًا في TypingMind.

كيف أوصّل خادم MCP Krusch Context MCP بـ TypingMind؟

يعمل Krusch Context MCP عبر موصل MCP المحلي في TypingMind. هذا هو الخيار الأنسب عندما يحتاج خادم MCP إلى الوصول إلى ملفات محلية أو تطبيقات سطح المكتب أو أدوات سطر الأوامر أو موارد خاصة على حاسوبك.

ما الأدوات التي يوفّرها خادم MCP Krusch Context MCP في TypingMind؟

يتيح Krusch Context MCP إمكانات MCP يمكنك تفعيلها من صفحة الإضافات في TypingMind واستخدامها في المحادثات أو تعيينها لوكلاء ذكاء اصطناعي.

هل أحتاج إلى مشاركة مفاتيح API الخاصة بي مع TypingMind لاستخدام خادم MCP Krusch Context MCP؟

لا. يعطي TypingMind الأولوية للعمل المحلي ويُبقي مزوّدي النماذج ومفاتيح API والمطالبات وإعدادات MCP تحت تحكمك. إذا كان Krusch Context MCP يتطلب مصادقة، فأضف الترويسات أو إعدادات OAuth أو الإعدادات المحلية المطلوبة لخادم MCP هذا عند إنشاء الاتصال.

خوادم MCP ذات صلة

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇