agentmux
Agentmux is an MCP server that lets you orchestrate coding-agent sessions across Codex, Claude Code, and Antigravity from one host, with session control, messaging, teams, and provider diagnostics.
Spawn agents:
spawn/spawn_manystart one or more sessions oncodex,claude, orantigravitywith a prompt, optional model/role/name, access mode (read-only,workspace-write,full), and workspace mode (shared,worktree,auto).Resume conversations:
sendcontinues an existing provider-native session by agent ID.Track sessions:
statusshows an agent and its latest job;listlists visible sessions;killcancels/stops an agent.Get results:
resultfetches a job result;waitwaits on up to 32 jobs with a 60s max timeout.Agent messaging:
message_sendpersists attributed messages and can optionally wake an idle recipient;inboxreads messages;message_ackmarks messages read.Manage teams:
team_create,team_status, andteam_listgroup agents; managed agents are scoped to their own team while external supervisors see all.Identify context:
whoamitells whether the MCP process is running as a managed agent or an external control tower.Inspect providers:
providerslists supported adapters and expected CLIs;doctorchecks provider CLI installation/health.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agentmux spawn a Codex agent to refactor this module and a Claude agent to review it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agentmux
English | 한국어
Use Codex, Claude Code, and Antigravity as each other's subagents — without leaving the coding-agent UI you already use.
agentmux is a local MCP orchestration layer for coding-agent CLIs. Keep Codex, Claude Code, or Antigravity as your control tower, then delegate work to other installed providers while preserving their native sessions.
Quick start
Requirements: Node.js 20+ and at least one supported provider CLI installed (codex, claude, or agy).
Install agentmux as a native plugin in every supported coding-agent host already installed on your machine:
npx -y '@jiho.ko/agentmux@latest' plugins installCheck the result:
npx -y '@jiho.ko/agentmux@latest' plugins statusThen fully exit and relaunch Codex, Claude Code, or Antigravity so the plugin's MCP tools and orchestration skill are loaded. Opening only a new chat/thread may not reload plugin-provided MCP servers.
If you previously registered agentmux as a direct MCP server, migrate to the native plugin and remove the duplicate registration only after plugin installation succeeds:
npx -y '@jiho.ko/agentmux@latest' plugins install --replace-mcpRelated MCP server: subturn
Why agentmux?
Keep your existing agent UI. No separate multi-agent dashboard is required; Codex, Claude Code, or Antigravity stays in control.
Mix providers in one task. A Codex session can delegate to Claude Code or Antigravity, and managed agents can spawn children across providers.
Preserve native conversations. Codex
thread_id, Claudesession_id, and Antigravityconversation_idare retained so work can resume in the same provider-native session.Delegate durable work. By default, jobs run through a detached local broker, while messages, delegations, and orchestration events are persisted across MCP/UI process restarts.
Parallelize without immediately colliding on files. Writable agents can be isolated in Git worktrees, with explicit diff/apply control before changes reach the base workspace.
Reuse provider authentication. agentmux invokes the installed provider CLIs and does not store provider credentials itself.
Install as native plugins. Codex, Claude Code, and Antigravity are all supported through one installer command.
Use cases
Cross-provider control tower
Keep your preferred agent as the supervisor and send specialist work elsewhere.
Use Codex as the control tower.
Ask Claude Code to review the API design.
Ask Antigravity to inspect the implementation for edge cases.
Wait for both and summarize the disagreements.Parallel independent review
Run multiple providers on the same question before committing to a change.
Spawn one Codex and one Antigravity reviewer for this pull request.
Have them review independently, then compare their findings.Builder + reviewer
Separate implementation from verification.
Delegate the implementation to Claude Code in an isolated worktree.
Have Codex review the resulting diff before applying it to the main workspace.Long-running delegated work
Start work from one UI and let the local broker keep ownership if that UI or MCP process exits. Reconnect later through the shared state, job, delegation, and event APIs.
Model name resolution
For Antigravity, agentmux queries the installed CLI with agy models instead of hard-coding a model list. Informal names are resolved before a job is created:
agy 3.8 flash high
Gemini 3.8 Flash High
gemini-3.8-flash-high
↓
gemini-3.8-flash-highIf a request matches multiple installed models, agentmux returns the candidates instead of guessing. The MCP models tool can be used to inspect or disambiguate the current catalog. Codex and Claude Code model names currently pass through to their native CLIs.
Supported providers
Provider | Worker CLI | Native plugin | Native session resume |
Codex |
| ✓ |
|
Claude Code |
| ✓ |
|
Antigravity |
| ✓ |
|
How it works
your existing coding-agent UI
Codex / Claude Code / Antigravity
|
agentmux MCP
|
local orchestration runtime
/ | \
Codex Claude Antigravity
worker worker workerThe interactive host can remain the external control tower, or a managed agent can supervise nested children. agentmux supplies the shared session, delegation, messaging, event, execution, and workspace layer rather than introducing another UI.
Status: early alpha. The core runtime and real Codex ↔ Antigravity delegation path are validated, but command surfaces and plugin integration may still evolve.
Current scope
The MCP server exposes a provider-neutral session API:
spawn/spawn_many— create one or many agent sessions and start their jobs asynchronouslysend— continue the same provider-native conversationwhoami— identify a managed child agent from inherited runtime contextmessage_send,inbox,message_ack— persisted, attributed agent-to-agent messagingdelegate,delegation_list,delegation_accept,delegation_complete,delegation_cancel— explicit tracked work handoffevents/events_wait— durable, ordered orchestration history shared across MCP hostsstatus— inspect an agent and its latest jobresult/wait— fetch results or wait for multiple jobs in one MCP calllist— list local sessionskill— cancel an active job and stop the sessionteam_create,team_status,team_list— group sessions and record supervisionproviders— show supported runtime adaptersmodels— inspect provider model names; Antigravity models are discovered dynamically fromagy modelsand informal names can be resolved to canonical slugsdoctor— report provider install/auth health and MCP-host configuration
Provider sessions are preserved using their native IDs:
Provider | CLI | Native session ID |
Codex |
|
|
Claude Code |
|
|
Antigravity |
|
|
Main vs subagent
agentmux does not hard-code one model as the main agent.
When a team has no supervisorAgentId, the interactive MCP host is the control tower:
You
|
Codex UI <- external supervisor
|
agentmux team
|- Claude reviewer
|- Antigravity implementer
`- Codex researcherA managed agent can also supervise children. Provider subprocesses inherit AGENTMUX_AGENT_ID, AGENTMUX_TEAM_ID, AGENTMUX_PARENT_AGENT_ID, and AGENTMUX_ROLE. If that coding agent starts its configured agentmux MCP server, whoami resolves the inherited identity and nested spawn automatically creates children inside the same team.
Managed agents are team-scoped: they can inspect and send work within their team, read only their own inbox, and stop only themselves or descendants. An external Codex/Claude Code/Antigravity UI has no inherited agent ID and remains the unrestricted control tower. This is a coordination boundary, not an OS-level security sandbox.
Multiple agentmux MCP processes on the same machine can share this state safely. State mutations are serialized with an inter-process filesystem lock and committed by atomic replacement.
Provider jobs are owned by a small detached local broker by default, not by the MCP stdio process that happened to launch them. Codex UI, Claude Code UI, Antigravity UI, and nested managed agents therefore share one local execution owner, and a running delegated job can continue if its launching UI or MCP process exits. The broker uses a local Unix socket or Windows named pipe plus a per-state capability token, and shuts itself down after an idle period.
If the broker cannot start, agentmux falls back to MCP-owned execution and reports the mode through runtime_status. Set AGENTMUX_EXECUTION=local to force that fallback behavior explicitly.
Requirements
Node.js 20+
Provider CLIs are optional. Install only the workers you actually plan to use:
codex,claude, and/oragy.Git is needed only for worktree isolation/integration.
A valid installation can therefore be Codex + Antigravity only, Claude Code only, or even agentmux with no provider installed yet.
Installation details
For normal installations, use the Quick start at the top of this README. The sections below cover direct-MCP fallback and development setups.
Direct MCP fallback
If a host does not support or should not use plugins, register agentmux directly as MCP instead:
npx -y '@jiho.ko/agentmux@latest' setupOr install the CLI globally:
npm install -g '@jiho.ko/agentmux'
agentmux setupThe quotes around the scoped package are intentionally shown so the commands can be pasted unchanged into PowerShell as well as POSIX shells.
Local checkout for development
git clone https://github.com/seaweedsoup98/agentmux.git
cd agentmux
npm install
npm run build
npm link
agentmux setupInteractive setup detects installed Codex, Claude Code, and Antigravity hosts and asks which ones to configure. Non-interactive examples:
agentmux setup --hosts codex,antigravity
agentmux setup --hosts claude
agentmux setup --yes
agentmux setup --hosts codex,antigravity --dry-runThe setup command uses native host configuration paths:
Codex:
codex mcp addClaude Code: user-scoped
claude mcp addAntigravity: merges only
mcpServers.agentmuxinto~/.gemini/config/mcp_config.json
Existing Antigravity MCP entries and unrelated JSON keys are preserved. If a native agentmux plugin is already installed for a host, setup does not add a second direct MCP registration.
Verify the machine afterwards:
agentmux doctor
agentmux doctor --jsonProvider health and authentication
agentmux doctor separates installation from authentication instead of treating every provider as a required dependency.
Typical states:
ready: CLI installed and its non-inference authentication status says it is logged in.auth_required: CLI installed but login is required.installed: CLI installed, but authentication cannot be verified without a real model request.missing: CLI is not installed.unhealthy: the status probe itself failed unexpectedly.
Codex uses codex login status; Claude Code uses claude auth status. Antigravity has no documented zero-cost shell auth-status command, so doctor reports its auth as unknown rather than consuming quota or opening a browser. A real headless Antigravity run is the authoritative check.
If a provider is missing, doctor prints its official installation command rather than installing software implicitly. Provider installation can modify PATH, shell profiles, or system state, so it remains an explicit user action.
If authentication expires, agentmux does not store or repair provider credentials. Re-authenticate with the provider itself:
Codex: codex login
Claude Code: claude auth login
Antigravity: run agy interactively once and complete sign-inRuntime failures that look like missing executables or authentication errors include the corresponding remediation hint.
When setup is running from an npx cache, it registers npx -y @jiho.ko/agentmux@latest as the stable MCP launch command rather than pinning an ephemeral cache path.
Native plugins
The repository ships native plugin bundles for Codex/OpenAI, Claude Code, and Antigravity. The recommended installer is:
npx -y '@jiho.ko/agentmux@latest' plugins installCodex / OpenAI
Manual equivalent:
codex plugin marketplace add seaweedsoup98/agentmux --ref main
codex plugin add agentmux@agentmuxThe repository marketplace is .agents/plugins/marketplace.json; the plugin bundle is plugins/codex.
Claude Code
Manual equivalent:
claude plugin marketplace add seaweedsoup98/agentmux@main --scope user
claude plugin install agentmux@agentmux --scope user
claude plugin enable agentmux@agentmux --scope userThe Claude marketplace is .claude-plugin/marketplace.json; the plugin bundle is plugins/claude.
Antigravity
The universal installer stages the npm-bundled plugin automatically. From a repository checkout, the manual equivalent is:
agy plugin install ./plugins/antigravityThe plugin bundle is plugins/antigravity.
All three native plugins bundle the orchestration skill and launch the same published MCP runtime, npx -y @jiho.ko/agentmux@latest. Direct MCP registration and native plugin installation are alternative integration methods; use --replace-mcp when migrating to avoid duplicate tool surfaces.
Development
git clone https://github.com/seaweedsoup98/agentmux.git
cd agentmux
npm install
npm run checkRun the MCP server over stdio:
npm run devThe server stores local session metadata in ~/.agentmux/state.json. Override that directory with AGENTMUX_HOME.
The state store is shared across local agentmux MCP processes. Reads use fresh snapshots; mutations use a process-safe lock plus atomic file replacement. Windows transient replace failures are retried without falling back to a non-atomic delete-and-rewrite path. A running job records its owner PID/instance so starting another MCP host does not incorrectly recover or overwrite work owned by a live host.
Example
Once the MCP server is registered in your host, you can ask the host agent naturally:
Create a team for this task.
Spawn two Antigravity agents to review this repository independently.
Use one Codex agent to compare their findings, then report the consensus.The host remains the control tower. agentmux provides the runtime/session layer.
Agent-to-agent messaging
A managed child can discover itself and its team with whoami, then inspect peers with team_status. Direct send is reserved for resuming your own managed session (or for an external control tower); peer-to-peer work must use attributed messages or tracked delegations.
message_send(
to_agent_id="<peer>",
message="I changed the repository interface. Rebase your implementation on it.",
wake=false
)Messages are persisted before delivery. wake=false leaves the message unread in the peer's inbox. wake=true additionally resumes the peer's provider-native session when that peer is idle and resumable; if it is busy, the wake fails but the message remains in the inbox.
A wake job is owned by the detached broker, so it can outlive the MCP host that launched it. Call wait when the current turn depends on the result; otherwise the delegated work may continue independently and can be observed later through job status or the durable event stream.
inbox(unread_only=true)
message_ack(message_ids=["msg_..."])This lets agents communicate without requiring a separate agentmux UI.
Tracked delegations
Use messages for coordination and use delegations when work ownership/completion matters.
delegate(
to_agent_id="<specialist>",
task="Review the provider adapter and report concrete defects.",
wake=true
)A delegation is pending until accepted, active while owned by the target, then completed or canceled. With wake=true, an idle resumable target is woken immediately and the delegation becomes active automatically. If wake fails because the target is busy, the task remains persisted as a pending delegation plus an inbox message.
Managed agents can delegate only within their team. The assigned agent can explicitly accept and complete the work, while the sender or receiver can cancel a non-terminal delegation. Delegation transitions are also emitted into the durable event stream.
Durable orchestration events
Every important lifecycle transition is also appended to a process-safe ordered event stream. Events use a monotonic seq cursor and cover team creation, agent spawning/stopping, job creation/start/completion/cancellation, message delivery/read/wake state, workspace integration, and bounded provider progress.
events(after_seq=0, team_id="<team>")
events_wait(after_seq=42, timeout_ms=30000)events_wait is a bounded long-poll rather than tight polling. Because the cursor is persisted in the same transactional state store, Codex UI, Claude Code UI, Antigravity UI, and nested managed agents can observe the same orchestration history even when they are backed by different agentmux MCP processes. Managed agents remain restricted to their own team.
The event stream is intentionally metadata-oriented: message bodies, assistant text deltas, command contents, and raw provider stdout are not copied into events. Detailed content remains in inbox/job APIs.
Provider adapters normalize only useful structured progress:
Codex
exec --json: non-response item start/completionClaude Code
stream-json: tool-use and tool-result transitionsAntigravity
stream-json: non-response step state transitions
These become provider.progress, provider.tool_started, and provider.tool_completed events. Exact duplicates within one second are coalesced, and the durable event journal is bounded rather than growing indefinitely.
Workspace isolation
Each spawned agent accepts workspace: shared | worktree | auto.
shareduses the requested working directory directly.worktreecreates a detached Git worktree under~/.agentmux/worktrees/<agent-id>.autois the default. Read-only agents share the workspace. A single writable agent normally shares it; parallel writable agents in the samespawn_manybatch are isolated before they start, and a later writable agent is isolated when another shared writer is already running.
Worktrees are created from Git HEAD, and the exact base commit is recorded on the agent session. To avoid silently dropping local edits, worktree creation refuses a dirty repository; commit/stash first or explicitly choose shared.
The control tower can inspect and integrate isolated writable work explicitly:
workspace_status(agent_id="<agent>")
workspace_diff(agent_id="<agent>")
workspace_apply(agent_id="<agent>")
kill(agent_id="<agent>")
workspace_cleanup(agent_id="<agent>", force=true)workspace_diff builds one base-relative patch using a temporary Git index, so committed, staged, unstaged, deleted, and untracked files are represented without modifying the agent's real index. workspace_apply is external-control-tower only, refuses a dirty base repository, runs git apply --check, and never performs an automatic merge. Cleanup requires the session to be stopped; dirty isolated worktrees require an explicit force=true.
This keeps parallel writers reproducible while leaving integration authority with the interactive control tower.
Access modes
spawn accepts a provider-neutral access mode. Adapters map it to the nearest native behavior:
agentmux | Codex | Claude Code | Antigravity |
|
|
|
|
|
|
|
|
|
| skip permission prompts |
|
For Antigravity, read-only uses the bundled agentmux-readonly custom agent. It exposes only native repository-reading tools (view_file, list_dir, find_by_name, and grep_search) and excludes run_command plus all file-writing tools. This avoids headless permission prompts for shell-based reads while preserving a true read-only review surface.
These mappings are intentionally conservative and are not identical security models.
Design principles
Keep the existing Codex, Claude Code, or other MCP-host UI.
Treat main vs subagent as a session relationship, not a model property.
Preserve native provider sessions instead of flattening everything into stateless API calls.
Make workspace isolation optional;
autoonly isolates concurrent writers.Keep the core small. Worktrees, messaging policy, and richer supervision sit above provider adapters.
Deliberate non-goals
To keep the runtime small, agentmux intentionally does not add:
a separate multi-agent UI — the existing Codex, Claude Code, or Antigravity UI stays in control
a workflow/task-DAG DSL — nested agents plus tracked delegations cover ownership without another orchestration language
a second push/message transport —
events_waitis the shared long-poll event primitiveautomatic worktree merging — the control tower explicitly inspects and applies isolated changes
provider-specific workflow abstractions in the core — provider adapters stop at execution/session/progress normalization
Named roles remain lightweight session metadata instead of persistent templates.
Real-provider validation
Normal CI uses deterministic fake provider executables and never consumes Codex, Claude Code, or Antigravity quota. Providers reported as auth_required are excluded from the default real-provider smoke run rather than making an otherwise valid partial installation fail. To validate installed authenticated CLIs explicitly:
npm run e2e:realThe smoke harness detects installed providers, then sequentially verifies initial spawn and native-session resume using read-only prompts. Requests are spaced by 2 seconds by default to avoid aggressive traffic. Select providers explicitly with:
npm run e2e:real -- --providers codex,claudeRun the full heterogeneous parent/child matrix only when desired:
npm run e2e:real:matrixMatrix mode exercises every selected cross-provider parent -> child pair, nested managed identity, wake/resume delegation, and delegation completion. It writes one machine-readable JSON report to stdout and uses a disposable local state/workspace. It never requests full access.
Tune pacing and timeout with AGENTMUX_E2E_DELAY_MS and AGENTMUX_E2E_TIMEOUT_MS.
License
Apache-2.0
Available Tools
17 toolsdoctorA
Check whether each supported provider CLI is installed and report its version.
Inputs: no named parameters.
inboxA
Read persisted messages. Managed agents can only read their own inbox; external supervisors must specify agent_id.
Inputs: agent_id, mark_read, unread_only.
killA
Cancel an active job and stop a session. Managed callers may stop only themselves or their descendants.
Inputs: agent_id (required).
listA
List visible sessions. Managed agents see only their team; external supervisors see all sessions.
Inputs: no named parameters.
message_ackB
Mark one or more inbox messages as read.
Inputs: message_ids (required).
message_sendB
Persist an attributed message to another agent. With wake=true, also start a new turn if the recipient is idle and resumable.
Inputs: message (required), to_agent_id (required), wake.
providersA
List provider adapters and the local CLI command each adapter expects.
Inputs: no named parameters.
resultB
Get an accessible job result by job ID.
Inputs: job_id (required).
sendC
Continue an existing idle provider-native session. Managed callers are limited to their team.
Inputs: prompt (required), agent_id (required).
spawnC
Spawn a coding-agent session and start its first job asynchronously. Managed callers automatically create children in their own team.
Inputs: prompt (required), provider (required), cwd, name, +7 more.
spawn_manyC
Spawn up to 16 coding-agent sessions. Sessions are started sequentially but their jobs run concurrently.
Inputs: agents (required).
statusB
Get one accessible agent and its latest job.
Inputs: agent_id (required).
team_createC
Create a top-level logical team. This tool is available to external control-tower hosts.
Inputs: name, supervisor_agent_id.
team_listA
List visible teams. Managed agents see their own team; external supervisors see all teams.
Inputs: no named parameters.
team_statusA
Get a team and its members. Managed agents are limited to their own team.
Inputs: team_id (required).
waitA
Wait for one or more jobs to finish, returning early when all are terminal. Timeout is capped at 60 seconds.
Inputs: job_ids (required), timeout_ms.
whoamiA
Return the managed agent identity inherited by this MCP process, or managed=false for an external control-tower host.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools target distinct resources and actions: sessions, jobs, teams, messages, and provider metadata are clearly separated. The main ambiguity is between send and message_send, but their descriptions clarify session continuation versus persisted messaging.
Naming is readable but mixes conventions: verb_noun (team_create, team_status), noun_verb (message_send, message_ack), bare verbs (send, wait, list, kill), and nouns (inbox, status, providers). The send/message_send pair is especially inconsistent.
With 17 tools, the server is at the borderline of feeling heavy for an orchestration/mux utility. Each tool covers a distinct concern, but the count is above the typical well-scoped range.
The surface covers core session, job, team, and messaging workflows, but there are notable gaps: no way to list all jobs, no team deletion or update, and no session transcript/history retrieval. These gaps can force workarounds but basic orchestration is functional.
Maintenance
Related MCP Connectors
- aXDeprecatedio.github.ax-platform
Agent-native collaboration network: orchestrate a team of long-running agents from any MCP client.
Real-time chat for AI agents. Claude Code, Cursor, Cline and Codex join channels over MCP.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseAqualityBmaintenanceBridges multiple CLI coding agents (Codex, Cursor, OpenCode, Claude, Antigravity) into any MCP client, enabling delegation of prompts, parallel execution, and code review workflows.671 npmMozilla Public 2.0
- AlicenseNot gradedqualityBmaintenanceEnables any MCP client to launch and manage subagent sessions in installed coding agents like Codex, Claude Code, Grok, and OpenCode, using your existing logins and chosen models.15 npmMIT
- AlicenseAqualityBmaintenanceEnables Cursor's main agent to delegate development tasks to Claude CLI subagents via MCP, supporting synchronous, asynchronous, and parallel task execution with monitoring and control.7ISC
- AlicenseBqualityBmaintenanceEnables a host coding agent to launch and coordinate real subagent sessions in other agent CLIs and accounts, sharing existing MCP servers, skills, plugins, and instructions. Supports two-way messaging, automatic account failover, and mixed-CLI delegation while leaving credentials with the vendor CLIs.814Apache 2.0