KERNL MCP

KERNL MCP

Transforms Claude into a persistent intelligence layer with automatic checkpointing, crash recovery, semantic memory, and cross-project learning. It provides 128+ tools for session management, adversarial testing, and browser automation to eliminate state loss and context rebuild costs.

Category
访问服务器

README

KERNL MCP

Transform Claude from stateless assistant into persistent intelligence layer

Version Tools Build TypeScript License

The Problem

MCP-based development suffers from three catastrophic failure modes that cost hours of lost work:

The 8-Minute Death - Long-running sessions crash during complex operations (efficiency mode throttling, memory limits), losing all architectural decisions and context built up over the session.

The Bootstrap Tax - Every new session requires 5-10 minutes manually restoring context. This happens dozens of times per day across multiple projects.

Isolated Learning - Solutions discovered in one project stay trapped there. The same problem gets solved independently across different codebases because there's no transfer mechanism.

The Solution

KERNL provides aggressive session state management with automatic checkpointing every 2-3 tool calls. When crashes happen (and they do), recovery restores exact state—active files, architectural decisions, progress, next steps—losing minutes instead of hours.

Core Capabilities:

  • Crash Recovery: Automatic checkpoints with 1-click resume
  • Semantic Memory (brain.db): RRF hybrid search (vector + BM25 + semantic rerank), ACT-R decay, graph-enhanced recall across 7k+ edges, SHA-256 dedup
  • Cross-Project Learning: Structural isomorphism detection, pattern transfer between codebases
  • YUMA Testing: Multi-tier quality gates (static analysis, API contracts, terminology compliance, dependency graphs, evidence chain integrity)
  • WHETSTONE: Adversarial engine via Anthropic API. Challenges positions with strongest counterargument. Code mutation testing identifies untested paths
  • IMPRINT: Post-session reflection engine. Typed deltas, wound healing cascade, preference tracking
  • Chrome Automation: 19 tools for browser-based workflows
  • 128 Tools Across 19 Categories: Session management, file operations, intelligence layer, process control, git integration, testing, brain/memory, adversarial, research, and more

Why This Exists

Long-running MCP sessions accumulate significant state: architectural decisions, active file contexts, progress markers, and reasoning chains. When that state is lost to crashes, efficiency throttling, or session rotation, the recovery cost is measured in hours per incident.

KERNL was built to solve this systematically. What started as a checkpoint/recovery system evolved into a full intelligence layer as each friction point was addressed: session persistence led to semantic search, which led to cross-project pattern transfer, which led to adversarial testing and reflection engines. Each tool exists because the problem was encountered and the solution was validated in production.

Installation

# Clone the repository  
git clone https://github.com/duke-of-beans/KERNL.git
cd KERNL

# Install dependencies
npm install

# Build
npm run build

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "kernl": {
      "command": "node",
      "args": ["/path/to/KERNL/dist/index.js"],
      "env": {
        "PROJECT_MIND_DB_PATH": "/path/to/KERNL/data/project-mind.db"
      }
    }
  }
}

Restart Claude Desktop. You'll see KERNL tools available immediately.

Quick Start

// Start of EVERY session - mega-bootstrap with mode detection
KERNL:get_session_context({ 
  project: "my-project", 
  mode: "auto"  // coding | architecture | debugging | auto
})

// During work - aggressive checkpointing (every 2-3 tool calls)
KERNL:auto_checkpoint({ 
  project: "my-project", 
  operation: "Implementing Z3 solver integration",
  progress: 0.65,
  currentStep: "Writing constraint translation layer",
  decisions: ["Using Z3 Python API instead of SMT-LIB2", "Caching solver instances"],
  nextSteps: ["Test constraint generation", "Add error handling", "Document API"],
  activeFiles: ["src/solver/z3-wrapper.ts", "tests/solver.test.ts"]
})

// Task complete - clear checkpoint state
KERNL:mark_complete({ 
  project: "my-project", 
  summary: "Z3 integration complete, 12 tests passing" 
})

Design Decisions

Session Management

State management isn't just "save state." It's understanding what state matters — architectural decisions outweigh file changes — and how to capture it without interrupting flow. Checkpoint frequency is aggressive (every 2-3 tool calls) because state loss compounds faster than checkpoint overhead.

Crash Recovery

Detection is non-intrusive (silent background check), recovery prompts feel natural, and the system gracefully handles partial state. Race conditions in concurrent checkpointing are solved with queue-based writes.

Semantic Search

Keyword matching fails for conceptual queries across large codebases. ONNX embeddings (all-MiniLM-L6-v2) with cosine similarity enable meaning-based search — local inference, no API calls, instant results.

Resilience

The entire tool suite has been rebuilt from documentation after an accidental drive wipe. The architecture survived because every decision was recorded as it happened. This validates the documentation-first approach that KERNL enforces.

Architecture

MCP Protocol Foundation - Exposes tools to any MCP client (Claude Desktop, custom clients). Clean separation between tool interface and implementation.

SQLite State Persistence - All session state, project metadata, and semantic indices in better-sqlite3 for transaction safety and zero-config deployment.

ONNX Embeddings - Local transformer model (all-MiniLM-L6-v2) for semantic search. No API calls, instant results, works offline.

Modular Tool Categories - 19 categories with clear boundaries and independent operation. Cognitive systems (WHETSTONE, IMPRINT, brain.db) integrate with infrastructure tools (testing, git, process management) through shared state in brain.db.

Protocol-Driven Quality - Every tool has explicit input validation, comprehensive error handling, and typed interfaces. No mocks, no stubs, no placeholders—production-quality code or nothing.

Tool Categories (134 Total)

  • Session Management (5 tools): Checkpoints, recovery, state management
  • Project Operations (6 tools): Register, list, update, delete, status
  • File Operations (6 tools): Read, write, search, batch operations
  • Semantic Search (3 tools): Concept-based search, indexing, patterns
  • Pattern Recognition (3 tools): Cross-project learning, suggest solutions
  • Parallel Gates (1 tool): Five-gate verification (git/code/ui/backlog/patterns)
  • Process Management (7 tools): Launch, monitor, control system processes
  • Streaming Search (4 tools): Large-scale file/content search
  • System Files (5 tools): Advanced file operations, metadata
  • Config & Meta (4 tools): Version, status, configuration management
  • Chrome Automation (19 tools): Browser control, scraping, interaction
  • Shadow Docs (4 tools): Parallel documentation system
  • Git Tools (3 tools): Smart commits, session packaging, staged versioning
  • Backlog (5 tools): EPIC management, sprint tracking
  • AUTONOMIC (6 tools): Sprint queue, scoring, pre-flight, validation, abort analysis, backlog conversion — enhanced backends for the AUTONOMIC protocol
  • Testing / YUMA (12 tools): Test generation, contracts, chains, baselines, precommit, health scores
  • Brain / Memory (7 tools): brain_briefing, brain_recall (RRF), brain_recall_graph, brain_remember, brain_status, brain_feedback, brain_invalidate
  • Adversarial / WHETSTONE (1 tool): Epistemic challenge + code mutation testing via Anthropic API
  • Reflection / IMPRINT (3 tools): Post-session reflection, intention tracking, intention resolution
  • Utilities (12 tools): Helpers, formatters, converters, backup, disk usage
  • Research (10 tools): Notes, search, tags, links, export, summary

Current Status

Production v6.0.0 - Active daily use across multiple development projects. 134 tools across 20 categories. Eleven-system cognitive architecture operational (including AUTONOMIC sprint execution) (brain.db memory, WHETSTONE adversarial, IMPRINT reflection, YUMA testing, plus NIGHTSHIFT maintenance running 13 daily passes).

YUMA Testing Subsystem - Multi-tier quality gates deployed to production projects. Static analysis (route sync, voice compliance, security), behavioral contracts (API patterns, status codes), terminology compliance (legal risk scanning), dependency graphs, evidence chain integrity. Example: TRACE project runs 17 tests / 84 checks pre-deploy.

brain.db v3.0 - Reciprocal Rank Fusion hybrid retrieval (vector + BM25 + semantic rerank). ACT-R decay modeling. 7k+ graph edges with structural isomorphism detection. SHA-256 dedup (97.7% noise reduction). Retrieval tracking feeds decay calculations.

WHETSTONE - Adversarial engine calling Anthropic API for heterogeneous counter-positions. Two modes: epistemic (challenge assumptions with strongest counterargument) and code (intelligent mutation testing that identifies untested paths). Optional calibration dataset matching.

Resilience Tested - The full tool suite has been rebuilt from documentation after catastrophic data loss, validating the system's own documentation-first methodology.

Documentation

Contributing

Standards:

  1. Quality Gates - TypeScript strict mode, zero errors before commit
  2. No Technical Debt - No mocks, stubs, or TODOs without tickets
  3. Documentation Sync - Every architectural decision documented inline
  4. Aggressive Checkpointing - State preserved every 2-3 operations
  5. Protocol-Driven - Explicit interfaces, comprehensive error handling

Pull requests welcome that maintain these standards.

License

MIT - See LICENSE for details

Author

@duke-of-beans


Philosophy: Build intelligence, not plumbing.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选