Local-first protocol built for real codebases

Kadrum splits cleanly into three open-source packages so every layer can be audited, tested, and extended without vendor lock-in.

TRUST BOUNDARY · 127.0.0.10 CLOUD HOP
UNTRUSTED TABReel Video720px JPEG maxLOOPBACK TRUST ZONE (X-KADRUM-TOKEN)Bridge 4817stdin CLI / MCPProject RootRoot-jailed IO

Monorepo boundaries

Shared packet schemas live in one dependency-free TypeScript package imported by both the browser extension and the Node.js local bridge.

  • packages/protocolTyped ReelPacket, ProjectContext, ProjectDiff, DeepCheckResult, local radar scoring, prompt builders, and Markdown artifact exporters.
  • packages/bridgeLoopback HTTP server (127.0.0.1), auto repository scanner, non-shell CLI runner for Claude Code / Codex / Gemini / Antigravity / Ollama, and JSON-RPC 2.0 MCP stdio server.
  • apps/extensionChrome Manifest V3 Side Panel, multi-platform content extractors, tungsten Loupe crop overlay, captureVisibleTab CORS fallback, BYOK clients, and Contact Sheet storage.

ReelPacket wire format

Compact, deterministic JSON shared across the Chrome Side Panel, HTTP Bridge, and MCP stdio tools. Images are bounded to 720px JPEG to keep vision token budgets low.

REELPACKET JSON PAYLOAD
{
  "id": "reel-c8demo123-1733280",
  "platform": "instagram",
  "url": "https://www.instagram.com/reels/C8demo123/",
  "author": "@opticalbuilder",
  "currentTimeSec": 14.5,
  "caption": "Built a real-time WebGL aperture with Next.js",
  "transcript": "Watch how every frame syncs directly via localhost MCP.",
  "frames": [{ "id": "frame-1", "isLoupeCrop": true, "width": 412, "height": 268 }],
  "pinnedFrameId": "frame-1"
}

Threat model and guardrails

Browser-to-localhost bridges require strict security engineering from day one.

  • No wildcard CORS, no 0.0.0.0 bindingThe bridge binds exclusively to 127.0.0.1 and accepts CORS origins only from chrome-extension:// and localhost, always requiring X-Kadrum-Token.
  • No shell string interpolationLocal AI CLIs receive arguments as explicit arrays and prompt payloads over stdin so hostile Reel captions can never inject shell commands.
  • Root-jailed repository exportsEvery docs/IDEAS.md export resolves its canonical target path and rejects any request attempting to leave the scanned project root.
Install Kadrum now