← Back to work

Systems Research · In progress · 2026

Agent Mesh — Networking Agents With NATS + MCP

Role
Design · Experiments
Stack
NATS · JetStream · MCP · Codex CLI · PowerShell
Context
Research · In progress
Year
2026
  • 10 passing
    Runtime experiments
  • NATS · JetStream
    Transport
  • Mac ↔ Win
    Coverage
  • Research · in progress
    Status

Ongoing research: letting Codex / Claude Code-style agent hosts talk to each other over a NATS message bus with an MCP facade — a local and cross-device mesh that shares commands, tasks and status. Ten runtime experiments so far: NATS loopback baseline, JetStream command facts, MCP Agent-Host facade, Mac↔Win forwarding, command allowlists and sidecar approval, remote mesh preflight, and more.

Background

One person often runs several agent hosts side by side — Codex, Claude Code, and others — each with its own process, state and command log, but none aware of the others. I want to know: can a message bus plus an MCP facade turn these isolated agents into a mesh that shares commands, tasks and status, locally and across devices?

Approach

Break the networking question into transport experiments that each stand on their own. Every path gets a dated doc, a PowerShell harness, and a JSON evidence trail; only once a path proves itself does it earn a seat in the unified prototype.

  • NATS Core pub/sub + request/reply — low-latency channel for live commands
  • JetStream — durable, replayable, auditable command events
  • MCP Agent-Host facade — exposes the control plane as MCP to upstream agents
  • References cloned for comparison: the MCP spec, A2A, AG-UI, openai/codex, cli-agent-orchestrator, headscale

Transport experiments that pass

Each one proves itself in isolation before any conversation about folding it into the main prototype.

  • NATS loopback baseline — the smallest cross-process / cross-language unit that works
  • JetStream command facts — commands as durable, replayable, traceable events
  • MCP Agent-Host facade — upstream agents drive the local control plane through MCP
  • Mac ↔ Win forwarding — cross-device command routing with an allowlist
  • Sidecar command approval — commands are held for user adjudication
  • Remote mesh preflight — handshake and identity for a fresh host joining

Design principles

A handful of principles the research keeps returning to — both as the yardstick for what to fold in and as the guardrail against well-known pitfalls.

  • Every transport path is its own experiment; prove it standalone before debating inclusion
  • Upstream agents only see the mesh via the MCP facade; transport details stay below the line
  • Commands must be auditable and replayable — that is why JetStream was chosen
  • Cross-device starts with Mac ↔ Win because that is my own daily setup

Status

Active work under G:\agent组网. Ten runtime experiments pass; current effort is folding the standalone experiments into a usable local prototype. Logged here as in-progress research; will update as it lands.