Claude Code plugin for connecting Claude instances as discoverable agents over NATS. Runs as an MCP channel server — Claude Code manages the lifecycle automatically. Agents announce themselves on startup and can be invoked point-to-point or via broadcast.
/nats:configure NATS_URL=nats://my-server:4222
Then restart Claude Code with the channel flag:
claude --dangerously-load-development-channels plugin:nats@claude-skillsNote:
--dangerously-load-development-channelsrequires interactive approval the first time you run it. Once channels are generally available, switch back to--channelsinstead.
The NATS agent server starts automatically. Run /nats:discover to see who's
on the network.
| Skill | Command | Description |
|---|---|---|
| configure | /nats:configure |
Save the NATS server URL, test connectivity |
| status | /nats:status |
Show agent status, NATS URL, and known agents |
| discover | /nats:discover |
Ping the network and list all discovered agents |
| call | /nats:call |
Invoke a capability on a specific agent |
| broadcast | /nats:broadcast |
Broadcast a capability call to all agents |
The channel server exposes these tools directly to Claude:
| Tool | Description |
|---|---|
publish(subject, payload) |
Fire-and-forget message to any subject |
request(subject, payload, timeout_ms?) |
Request/reply — waits for one response |
broadcast(capability, payload?, timeout_ms?) |
Invoke capability on all agents, collect responses |
discover(timeout_ms?) |
Ping all agents, return their capabilities |
get_agents() |
Return known agents from local cache |
claude.agents.<agent-id>.invoke.<cap> # direct invocation (inbound)
claude.agents.broadcast.<cap> # broadcast to all agents
claude.discovery.announce # agent announces on join
claude.discovery.ping # discovery ping (all agents reply)
claude.discovery.pong # discovery pong responses
All messages use a common JSON envelope:
{
"schema": "1.0",
"from": "<agent-id>",
"ts": "<ISO timestamp>",
"type": "request | response | announce | error",
"payload": {}
}NATS URL is stored in ~/.claude/channels/nats/.env (chmod 600):
| Key | Description | Default |
|---|---|---|
NATS_URL |
Full NATS server URL | nats://nats:4222 |
If not configured, the server tries nats://nats:4222 then
nats://nats-server:4222 automatically.
Each agent gets a stable ID generated once and persisted to
~/.claude/skills/nats/agent-id. The ID survives restarts.
Agent cache is stored at ~/.claude/channels/nats/agents.json.
/plugin install nats@claude-skills
/reload-plugins
MIT