kern
Writes .windsurfrules context files for Windsurf (Codeium), giving it the scanned codebase intelligence, component inventory and design-system rules.
Generates .github/copilot-instructions.md so GitHub Copilot receives the scanned codebase context (framework, components, hooks, routes, tokens, patterns) and design system constraints.
Generates GEMINI.md context for Google Gemini CLI, supplying the same scanned codebase intelligence and design-system rules as other AI tools.
Ships a Material Design 3 preset (rounded/tonal M3 color system, Roboto, dynamic 28px radius) served through MCP tools for components, tokens and patterns, and validates AI-written code against its rules.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
KERN
One scan. Every tool. Full codebase intelligence.
KERN scans your codebase once — components, hooks, routes, tokens, imports, patterns, database schemas — then feeds that context to every AI coding tool you use. Claude Code, Cursor, Windsurf, Copilot, Gemini, Cline — all get the same rich context, automatically.
Without KERN: AI guesses your codebase → generic output → manual corrections
With KERN: kern scan → every AI tool knows your codebase → accurate outputQuick Start
# Scan your codebase (25 scanners, 8 output formats)
npx @usekern/cli scan
# Initialize with your design system
npx @usekern/cli init
# Install Claude Code hooks for automatic context injection
npx @usekern/cli activate
# Check your code for design violations
npx @usekern/cli check
# Auto-fix what it finds
npx @usekern/cli fixRelated MCP server: io.tseha/tseha
How It Works
Codebase Intelligence
kern scan runs 25 scanners across your project and outputs context files for 8 AI tools:
Output | Tool |
| Universal (Cursor, Copilot, Gemini, Zed, 20+) |
| Claude Code |
| Cursor (legacy) |
| Cursor (new MDC format) |
| GitHub Copilot |
| Windsurf (Codeium) |
| Google Gemini CLI |
| Cline / Roo Code |
The scan covers: framework detection, components, hooks, API routes, design tokens, import graphs, database schemas, env vars, test coverage, security audit, anti-patterns, and more.
Claude Code Integration
kern activate installs PreToolUse hooks so Claude Code automatically gets file-level context (component info, imports, design rules) before every read/edit — zero manual prompting.
Design System Enforcement
Pick from 8 built-in design system presets. KERN serves them via MCP tools — AI queries for components, tokens, and patterns instead of guessing, then KERN checks the output with regex-based rules.
AI: → calls kern_suggest("settings page")
← components, layout pattern, spacing rules
AI: → calls kern_component("Card")
← import path, variants, props, example, rules
AI: → calls kern_tokens("colors")
← ONLY your valid semantic tokens
AI: → writes code → calls kern_check(code)
← "0 violations"No AI in the enforcement layer. File lookup + regex + BM25 search. Deterministic.
Scanners
25 built-in scanners run in parallel:
Scanner | What it finds |
| Framework, language, router, styling |
| React components with props, complexity, imports |
| Custom React hooks and their requirements |
| Next.js API routes with methods and Zod schemas |
| Import graph, hub files, circular dependencies |
| Design tokens from CSS variables and Tailwind |
| Prisma and Drizzle schemas |
| Exported TypeScript types, interfaces, enums |
| File counts, line counts, size |
| Environment variables from .env and source |
| Test coverage mapped to components |
| Code patterns (react-hook-form, Zustand, tRPC) |
| npm audit and outdated packages |
| Codebase complexity with AI model recommendations |
| Git history, branches, uncommitted changes |
| CVA variant definitions |
| Component import dependencies |
| Barrel export files |
| cn(), shadcn/ui, Radix, CVA detection |
| Visual file tree representation |
| Workspace configuration (pnpm, yarn, lerna) |
| GraphQL type definitions |
| npm scripts |
| Existing AI docs (CLAUDE.md, .cursorrules) |
| Context-aware anti-patterns from scan data |
Available Presets (all free)
Preset | Style | Font | Radius | Key trait |
Swiss Industrial | Sharp, monospace, UPPERCASE | Monospace | 0px | Brutalist precision |
Material Design 3 | Rounded, tonal, dynamic | Roboto | 28px | M3 color system |
Apple Glass | Clean, native, vibrancy | System (SF Pro) | 12px | 44px touch targets |
IBM Carbon | Structured, productive | IBM Plex Sans | 0px | 2x grid, layer model |
GitHub Primer | Neutral, accessible | System | 6px | Sentence case, green actions |
Linear | Dense, keyboard-first | Inter | 6px | Command palette, compact |
Shopify Polaris | Friendly, commerce | Inter | 8px | Commerce patterns |
TypeScript Strict | Type-safe, predictable | System | 6px | Exhaustive checks, no-any |
MCP Setup
kern init auto-configures your AI tool. Or add manually:
Claude Code (.claude/settings.local.json):
{
"mcpServers": {
"kern": {
"command": "npx",
"args": ["@usekern/mcp-server"]
}
}
}Cursor (.cursor/mcp.json):
{
"mcpServers": {
"kern": {
"command": "npx",
"args": ["@usekern/mcp-server"]
}
}
}MCP Tools (21)
Codebase Intelligence (reads from kern scan cache):
Tool | What it does |
| Full project analysis: framework, components, stats, recommendations |
| Everything known about a file: component info, imports, rules |
| Import graph: hub files, circular deps, unused files |
| Find files that import or reference a given symbol |
| Codebase metrics: files, lines, types, database health |
| Cross-category keyword search across scan results |
Design System (requires active preset):
Tool | What it does |
| Lists available design system presets |
| Initializes a preset, returns all files to write |
| Full design system reference in one call |
| Recommends components and patterns for a UI task |
| Returns full component spec: import, variants, props, example, rules |
| Returns design tokens: colors, spacing, typography, sizing |
| Returns code templates for common UI compositions |
| Validates code against design system rules |
Infrastructure:
Tool | What it does |
| Analyzes a codebase for design system patterns |
| Captures a point-in-time compliance snapshot |
| Lists all saved snapshots |
| Compares two snapshots to show drift |
| Restores code to a previous snapshot state |
| Scrapes a URL for design tokens (llms.txt, CSS) |
| Extracts design tokens from CSS/HTML content |
Plus 6 MCP resources for direct context access.
CLI Commands
kern scan [--format <id>] [--dry-run] [--json]
Scan your codebase with 25 scanners and generate context files for all AI tools:
kern scan # Full scan, all formats
kern scan --format claude-md # Generate only CLAUDE.md
kern scan --dry-run # Preview without writing
kern scan --json # Output raw scan datakern activate / kern deactivate
Install or remove Claude Code PreToolUse hooks for automatic context injection:
kern activate # Install hooks + scan if cache is stale
kern deactivate # Remove hooks, preserve other settingskern check [file] [--staged] [--strict]
Find design system violations:
KERN: 3 violations
src/app/settings/page.tsx:23
✗ bg-gray-100 → use bg-muted
[auto-fixable]
src/app/settings/page.tsx:45
✗ rounded-lg → use mode.radius
[auto-fixable]
Run `kern fix` to auto-repair (3/3 fixable).Use --staged for pre-commit hooks. Use --strict for CI (exits with code 1).
kern fix [file] [--staged]
Auto-repair fixable violations (string replacements).
kern guard [--threshold <n>] [--fix]
Pre-commit enforcement. Blocks commits below compliance threshold.
kern init [--preset <name>] [--force] [--hook]
Initialize KERN in your project:
Copies preset to
.kern/preset/Generates
mode.ts(typed design token accessor)Writes MCP config for detected AI tools
--hook: installs pre-commit hook
kern sync
Generates AI tool context files from your preset (KERN.md, .cursorrules, etc.).
For Agencies & Freelancers
KERN is built for teams that juggle multiple projects with different brands:
# Client A: Their brand tokens from Figma
cd client-a && FIGMA_TOKEN=xxx kern sync --from-figma ABC123
# Client B: Material Design
cd client-b && kern init --preset material-design
# Client C: Custom preset from their existing code
cd client-c && kern init --preset ./their-brand/Each project has its own preset in .kern/. AI adapts to whichever project is open. No style bleeding between clients.
CI Integration
Add to your GitHub Actions:
- name: KERN Design System Check
uses: jpoindexter/kern/actions/kern-check@main
with:
directory: src
strict: trueOr use the CLI directly:
- run: npx @usekern/cli check --strictPreset Format
Each preset is a collection of JSON files:
.kern/preset/
├── registry.json # Metadata, component list
├── tokens.json # Colors, spacing, typography, sizing
├── rules.json # FORBIDDEN/REQUIRED patterns
├── patterns.json # Code templates for UI compositions
├── examples.json # Wrong vs. right code examples
└── components/ # Per-component specs
├── Button.json
├── Card.json
└── ...Packages
Package | Description |
CLI tool (23 commands, 25 scanners, 8 format generators) | |
MCP server (21 tools + 6 resources) | |
Rules engine, suggest engine, fixer, preset loader, composition | |
GitHub Action — check mode, PR review bot, LLM review pass | |
GitLab CI — inline MR discussion comments via Discussions API | |
Bitbucket Pipelines — Code Insights annotations | |
VS Code extension — inline squiggles, quick-fix, @kern chat |
Development
pnpm install
pnpm build # Build all packages (turbo)
pnpm test # Run all 245 tests
pnpm type-check # TypeScript validationLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Run accessibility, contrast, and design token audits and file QA issues from your AI coding tool.
Serves your design system and coding standards to coding agents, so they stop guessing.
Live React design-system APIs, patterns, and code validation so AI agents build real UI, not slop.
Give AI agents your deeepSpace design system: components, tokens, styles and code mappings.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search, understand, and generate code for design system components by syncing and indexing a component library.ISC
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to retrieve accurate design system information, component APIs, design tokens, and coding standards, so they build with real specs rather than guessing.2MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI coding assistants to inspect frontend projects, search a curated design and motion recipe catalog, prepare and preview structured design plans, apply changes with backups and rollback, capture previews, audit UI accessibility and performance, and monitor activity via a web dashboard.-
- AlicenseAqualityBmaintenanceIt lets AI coding agents look up design tokens, component specifications, and prohibition rules on demand, then validate generated HTML or JSX with the same lint logic used by CI and editor hooks so violations are caught and corrected immediately. It also exposes the design constitution and rule sets as resources for reference during generation.6206 npm202MIT