KernelMind MCP

KernelMind MCP

Enables AI agents to query Linux kernel source code, git history, LKML discussions, Patchwork patches, and documentation with evidence-ranked results, citations, and explicit assumptions or contradictions.

Category
Visit Server

README

KernelMind MCP

Evidence-based Linux kernel engineering for AI agents — citations, not hallucinations.

License: GPL v2 MCP Compatible Python 3.12+

KernelMind MCP is a Model Context Protocol server that turns the public corpus of Linux kernel knowledge — git history, LKML / lore.kernel.org, Patchwork, and Documentation/ — into a queryable, evidence-ranked knowledge platform for AI coding and planning agents.

Every tool response carries an explicit evidence chain: which commit, which mailing-list thread, which patch state transition supports the conclusion — plus explicit assumptions and contradictions when the evidence is incomplete. Performance claims are never fabricated; the system flags them hardware_validation_required instead.

Why

LLMs hallucinate kernel facts — invented signatures, misremembered locking rules, APIs removed years ago cited as current. KernelMind's contract:

  1. Index primary sources, kept current by incremental sync (never full rebuild)
  2. Fuse dense vectors + BM25 + PostgreSQL full-text via Reciprocal Rank Fusion (k=60)
  3. Rank by a fixed evidence hierarchy: commit messages > LKML consensus > Documentation/ > maintainer comments > accepted patches > LWN > source code > rejected RFCs > vendor trees
  4. Return evidence_sources, assumptions, contradictions, and hardware_validation_required on every engineering conclusion

Subsystem-agnostic by design: works identically on mainline, stable, linux-next, and vendor trees.

Features & Registered Tools

KernelMind MCP provides 16 specialized, evidence-first engineering tools across 5 categories:

Category Available MCP Tools Description
Source Code search_kernel_code, lookup_symbol Search kernel C source code and lookup symbol definitions with AST tree-sitter chunking
Git Intelligence search_commits, get_commit_details, get_file_history, blame_line_range Inspect commit history, blame line ranges, and trace file evolution
Patchwork & LKML search_patches, get_patch_details, search_lkml, get_thread_details Query patch discussions, LKML thread consensus, and patch state transitions
Research & Risk analyze_patch_series, analyze_subsystem_risk Evaluate stability ratings, race/locking risk factors, and hardware validation requirements
Documentation & LWN search_docs, get_doc_details, search_lwn, get_lwn_article Search kernel Documentation/ files and Linux Weekly News articles

MCP prompts implement a 9-stage agent workflow: Knowledge Gathering → Subsystem Understanding → Architecture Modeling → Maintainer Review → Hypothesis Generation → Experiment Design → Implementation Planning → Patch Review → Self-Critique.

Architecture

AI Agent (Opencode / Claude Code / any MCP host)
      │  JSON-RPC 2.0 — stdio (default) or Streamable HTTP
      ▼
MCP Gateway (validation, auth, audit)
      ▼
Tools → Hybrid Search (Qdrant + BM25 + PG FTS, RRF)
      → EvidenceCorrelator (priority tiers, assumptions, contradictions)
      ▼
PostgreSQL · Qdrant · Neo4j · Redis · MinIO
      ▲
Incremental Sync (Celery): git delta · LKML/lore · Patchwork
(state-transition tracking across all 12 patch states) · Documentation/

Indexing is kernel-aware: tree-sitter C grammar chunks at function/struct/macro granularity without splitting function bodies; subsystem attribution is parsed from MAINTAINERS (longest-prefix match) — no hardcoded maps.

Details: docs/ARCHITECTURE.md

Quick Start

git clone https://github.com/Reinazhard/kernelmind-mcp.git
cd kernelmind-mcp
cp .env.example .env       # set EMBEDDING_* and any overrides
docker compose up -d --build
curl http://localhost:8080/health

Opencode (opencode.json)

{
  "mcp": {
    "kernelmind": {
      "type": "local",
      "command": ["docker", "compose", "exec", "-T", "kernelmind-mcp",
                  ".venv/bin/python", "-m", "kernelmind.server", "--stdio"],
      "enabled": true
    }
  }
}

Any stdio MCP client uses the same command. For remote hosts, set KERNELMIND_TRANSPORT=streamable-http and connect to http://<host>:8080/mcp. See docs/OPENCODE.md and docs/DEPLOYMENT.md.

Configuration

All config via environment variables (Pydantic, fail-fast at startup) — see .env.example.

Variable Default Purpose
KERNELMIND_TRANSPORT stdio stdio or streamable-http
KERNELMIND_EMBEDDING_BASE_URL / KERNELMIND_EMBEDDING_API_KEY / KERNELMIND_EMBEDDING_MODEL — Embedding provider (required)
KERNELMIND_POSTGRES_DSN, KERNELMIND_QDRANT_URL, KERNELMIND_NEO4J_URI, KERNELMIND_REDIS_URL, KERNELMIND_S3_ENDPOINT compose defaults Storage backends
KERNELMIND_HOST / KERNELMIND_PORT 0.0.0.0 / 8080 HTTP Server Bind Address

Project Status

Phase completion and known limitations: docs/PROGRESS.md. Available tool reference: docs/TOOLS.md. Deployment guide: docs/DEPLOYMENT.md.

License

GPL-2.0 — see LICENSE.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured