Fleet-native agent orchestration for OpenCode
Spawn parallel agents as independent OS processes. Route work to specialists. Let agents collaborate peer-to-peer. No timeouts. No markups. Open source.
// From any OpenCode session
const { fleet_id, agent_ids } = await callTool("spawn_fleet", {
agents: [
{ role: "Codebase Onboarding Engineer", prompt: "Map all auth middleware", agent: "codebase-onboarding-engineer" },
{ role: "Oracle", prompt: "Review the auth architecture", agent: "oracle" },
{ role: "Backend Architect", prompt: "Implement JWT token refresh", agent: "backend-architect" },
],
});
// Route work to the best agent
const { matches } = await callTool("route_work", {
description: "audit authentication security vulnerabilities"
}); 10 MCP tools. One mesh.
Each tool is a primitive you can compose. Spawn fleets, route work, send messages between agents, attach specialists mid-flight. No opinions about how to use them.
spawn_fleet MCP Spawn N parallel agents as independent OS processes
fleet_status MCP Check fleet and agent lifecycle state
collect_results MCP Aggregate outputs when the fleet completes
send_message MCP P2P handoff, question, result, alert, request_help
get_inbox MCP Agents poll for incoming messages
ack_message MCP Mark messages as processed
register_capability MCP Self-describe role, skills, model for routing
route_work MCP Match a task to the best available agent
list_agents MCP Discover 100+ premade agent personalities
attach_agent MCP Dynamically join a running fleet mid-flight
Collaboration patterns
With P2P messaging enabled, the topology shifts from star (orchestrator → workers) to mesh. Three patterns we use every day.
Pipeline handoff
Explore → Oracle → Engineer: each specialist hands context to the next, no orchestrator mediation.
Debate consensus
Two agents review the same artifact, debate via questions, converge before reporting.
Failure recovery
An agent hits a wall → broadcasts alert → peers with relevant skills respond with fixes.
Inspect your fleet from the terminal
Once you have a running fleet, the agent-mesh CLI shows you what's happening — without opening OpenCode.
3 fleets:
bc34d339-935c-4… complete 3 agents, 3 done (34.8m)
37ae1cf2-5ce8-4… complete 1 agents, 1 done (28.2m)
d648beb0-cfb2-4… failed 2 agents, 2 done (27.3s) Total fleets: 7
completed: 3
failed: 4
Total agents: 16
Success rate: 42.9%
Avg duration: 1.34s Install in 30 seconds
Meshfleet is an MCP server. Clone, build, register. That's it. No accounts. No cloud. No telemetry.
git clone https://github.com/johnmwhitman/agent-mesh.git \
~/.config/opencode/mcp-servers/agent-mesh
cd ~/.config/opencode/mcp-servers/agent-mesh
npm install && npm run build Add to ~/.config/opencode/opencode.jsonc:
{
"mcp": {
"agent-mesh": {
"type": "local",
"enabled": true,
"command": ["node", "~/.config/opencode/mcp-servers/agent-mesh/dist/index.js"]
}
}
} const { fleet_id } = await callTool("spawn_fleet", {
agents: [{ role: "explorer", prompt: "Map src/", agent: "codebase-onboarding-engineer" }]
}); Watch your fleet live
npx agent-mesh-dashboard shows running fleets, recent agents (with retry counts), and recent events in real time. Refreshes every second. ANSI in-place updates. Ctrl+C to exit.
No daemon, no IPC — the dashboard just polls the same JSON ledger the MCP server uses. See /stats for the full perf breakdown.
Meshfleet Dashboard — 2026-07-02 22:53:11 Fleets (13) ✓ bc34d339 complete agents= 3 (run=0 done=3 fail=0) 34m46s ✗ 5db4167a failed agents= 2 (run=0 done=0 fail=2) 567ms ◐ eeeb4e7f running agents= 3 (run=0 done=0 fail=0) 41m16s Recent Agents (last 10) 896d0605 cfb1ce9e hool-dev-canon interrupted 2s 17f8d7d8 eeeb4e7f wikidata-surveyor interrupted 15m58s Recent Events (last 20) 22:53:08 agent_retry_scheduled a2 f1 22:53:10 agent_failed_permanent a2 f1
The last step before v1.0
v0.9.0 is the bridge release. Four items: batch writes for sendMessage (the 3.8ms/msg bottleneck), wire the existing skill-taxonomy into route_work, wire synonyms into role/skill parsing, and per-version fixture tests for COMPATIBILITY.md. After v0.9.0 ships, the API freezes and the mesh is production-ready as v1.0.
react agent to nextjs via the tree ui to a frontend agent via the synonym table Stop managing agents. Mesh them.
MIT licensed. Works with any OpenCode setup. 100+ premade agent personalities included via the agency-agents integration.