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" }]
}); Stop managing agents. Mesh them.
MIT licensed. Works with any OpenCode setup. 100+ premade agent personalities included via the agency-agents integration.