Part 2 of the Building Mizan in Public series (Part 1: cutting multi-agent fixed prefix tokens by 94%).
Mizan is an open-source, zero-dependency, local-first multi-agent control plane and 4-tool stdio SQLite FTS5 MCP hub for Claude Code, Codex, Cursor, OpenCode, and Antigravity.
-
npm (
100.3 kB,32files,0npm dependencies): https://www.npmjs.com/package/mizan-os - GitHub Repository (MIT, 3/3 Cross-OS CI green on Ubuntu, macOS, Windows): https://github.com/csa7mdm/mizan
-
Glama Verified MCP Listing (
Release 0.1.0, Try in Browser): https://glama.ai/mcp/servers/csa7mdm/mizan - YouTube Walkthrough: https://youtu.be/ZNotXOrvZFI
- Spotify Engineering Podcast: https://open.spotify.com/show/1DAaUpiRfV8ASWlp36yzY8
- Author: Ahmed Mustafa, AI-Native Solutions Architect & R&D Lead.
If you use more than one AI coding agent, configuring MCP servers gets repetitive fast. Every tool stores its config in a different path and format. Worse, stacking eager-loaded MCP servers quietly adds 50,644+ upfront tokens to your fixed prefix before you even ask a question.
I shipped mizan-os on npm (100.3 kB, 0 external dependencies) so you can fix both problems without cloning a repo:
-
npx mizan-os connect: One command that wires Mizan's 4-toolstdioSQLite FTS5 brain (brain_search_lessons,brain_search_components,brain_get_ops_state,brain_log_decision) across Claude Code, OpenCode, Codex, and Cursor with atomic writes. -
npx mizan-os start(Streamable HTTP/mcpinside Action Center): Boots a Bearer-authenticated endpoint restricted to strictly 5 safe Control-Plane tools (zero shell execution) so ChatGPT and Claude Mobile can inspect ops state and approve decisions remotely over Cloudflare Tunnel or Tailscale Funnel.
Before vs. After
| Workflow | Manual Multi-Agent MCP Setup | With npx mizan-os
|
|---|---|---|
| Wiring 4 coding agents | Hand-edit 4 separate config files |
npx mizan-os connect (--dry-run, --status, --remove) |
| Prefix token overhead |
50,644+ tokens from eager-loaded MCP stacks |
< 3k fixed prefix (4 stdio tools locally, 5 remote /mcp tools) |
| Playbooks & ops history | Pasted manually into system prompts | Indexed in Node 24 node:sqlite FTS5 (knowledge/ + ops/ACTIVITY-LOG.jsonl) with 0 prefix bloat |
| Remote mobile control | Exposed shell endpoints or none | Bearer-auth /mcp with strictly 5 non-exec Control-Plane tools via Tailscale Funnel / Cloudflare Tunnel |
1. Atomic Auto-Connect (npx mizan-os connect)
Instead of asking users to copy-paste JSON blocks across four tools, connect detects installed agent configs and writes safely using atomic file replacement:
# Preview changes without touching disk (zero clone required)
npx mizan-os connect --dry-run
# Wire brain-hub into Claude Code, OpenCode, Codex, and Cursor
npx mizan-os connect
# Verify wiring, run isolated selftests, or cleanly remove
npx mizan-os connect --status
npx mizan-os test
npx mizan-os connect --remove
2. Searchable knowledge/ Playbooks With Zero Prefix Increase
Every time you add a long playbook to a system prompt, you pay for it on every turn. Instead, Mizan keeps curated playbooks (Browser Automation, Mobile Android USB ADB / Wi-Fi Wireless Debugging / iOS from Windows, and Token-Optimal engineering) plus the unified ops/ACTIVITY-LOG.jsonl indexed in Node 24's built-in node:sqlite FTS5 engine.
Agents query only what they need on demand via brain_search_lessons and brain_search_components, keeping fixed prefix budgets under 3,000 tokens with zero cloud lock-in and zero telemetry.
3. Safe 5-Tool Remote /mcp for ChatGPT and Claude Mobile
Opening a remote shell-exec MCP endpoint to the internet is a security incident waiting to happen.
Mizan's /mcp endpoint inside action-center/server.mjs enforces:
- Mandatory Bearer token authentication (
crypto.timingSafeEqual). - Strictly 5 safe Control-Plane tools with zero shell execution.
- Verified via an isolated selftest suite (
action-center/mcp-selftest.mjs). - Works over Tailscale Funnel or Cloudflare Tunnel so you can check fleet status or resolve pending decisions from ChatGPT or Claude Mobile.
Honest Limits
-
Node 24 required: Both
hub-mcpandaction-centerrely on built-in Node 24 modules (node:sqlite,node:http,node:crypto) to stay zero-dependency. - Remote tunnel setup is opt-in: Mizan does not bundle or auto-expose a public tunnel; you control Tailscale Funnel or Cloudflare Tunnel explicitly.
-
No remote shell execution by design:
/mcpintentionally omits shell commands so mobile clients can only inspect and steer the control plane safely.
Frequently Asked Questions (FAQ)
How do I connect one MCP server to Claude Code, Cursor, Codex, and OpenCode automatically?
Run npx mizan-os connect --dry-run to preview the detected config paths, then run npx mizan-os connect to wire brain-hub atomically across all four agents without manual JSON editing.
How can I connect ChatGPT or Claude Mobile to my local AI agent control plane safely?
Expose Mizan's Bearer-authenticated /mcp endpoint (npx mizan-os start) through Tailscale Funnel or Cloudflare Tunnel. It restricts remote callers to 5 non-exec Control-Plane tools verified with crypto.timingSafeEqual.
Does indexing knowledge/ playbooks in hub-mcp increase my agent's startup prefix tokens?
No. Playbooks and ops/ACTIVITY-LOG.jsonl live in Node 24 SQLite FTS5 and are fetched on demand through the 4-tool stdio interface, adding zero tokens to the fixed startup prefix.
Try it locally (100.3 kB, 0 deps):
- npm: https://www.npmjs.com/package/mizan-os
- GitHub (MIT): https://github.com/csa7mdm/mizan
- Glama Verified MCP: https://glama.ai/mcp/servers/csa7mdm/mizan
If npx mizan-os connect --dry-run misses a config path on your OS or IDE, open an issue (or check our good first issue #3) and we will add it.
Top comments (0)