agent-fleet-mcp
# agent-fleet
**Unified cross-harness MCP server and CLI for orchestrating local and remote AI coding agents.**
`agent-fleet` provides one clean interface to discover, health-check, invoke, stream/inspect outputs from, resume, and transfer files across heterogeneous AI coding tools running locally or on remote GPU servers—including sandboxed containers with strict network egress verification.
## Supported Harnesses & Transports
- **Harnesses**: Claude Code (`claude`), OpenAI Codex CLI (`codex`), DeepSeek Harness (`dsh`), Antigravity (`agy`).
- **Transports**:
- `local`: Native subprocess execution (inherits user's native tool profile & session history).
- `ssh`: Direct remote execution over BatchMode SSH.
- `ssh+sbc`: Sandboxed container execution (`sbc exec`) with **fail-closed egress verification** (`sbc status` check against `required_egress`) and automatic host ↔ sandbox path mapping.
## Exposed Tools (MCP & CLI)
Both the stdio MCP server (`agent-fleet-mcp`) and CLI (`agent-fleet`) expose identical capabilities:
| Tool / Subcommand | Purpose |
| :--- | :--- |
| `fleet_list` / `list` | List configured endpoints, account labels, transports, and egress constraints |
| `fleet_status` / `status` | Live probe of SSH/sandbox reachability, egress IP verification, auth status, and usage totals |
| `fleet_run` / `run` | Delegate tasks (`wait_sec`, `session_id` resume, optional `tmux`, 2-line caller header w/ `raw_prompt` opt-out) |
| `fleet_output` / `output` | Flexible output inspection: `final`, `summary`, incremental `delta` (`cursor` + `next_cursor`), `tail`, `events`, `raw`, with built-in `wait_sec` |
| `fleet_runs` / `runs` | Distinguish `origin="agent_call"` delegations from `origin="human"` native sessions |
| `fleet_stop` / `stop` | Terminate local, remote, or tmux-backed tasks cleanly |
| `fleet_transfer` / `transfer` | Push/pull files via `rsync`/`scp` with automatic `sandbox_home_host` path translation |
## Installation
```bash
uv venv ~/.local/state/agent-fleet/venv --python 3.12
uv pip install --python ~/.local/state/agent-fleet/venv/bin/python -e .
```
Copy [`examples/registry.example.yaml`](examples/registry.example.yaml) to `~/.config/agent-fleet/registry.yaml` (or point `AGENT_FLEET_CONFIG` to your private config file kept outside this public repo).
## MCP Registration
**Generic `mcp_config.json` (Antigravity / Claude / Cursor, etc.):**
```json
{
"mcpServers": {
"agent-fleet": {
"command": "/path/to/agent-fleet-mcp",
"env": {
"AGENT_FLEET_CONFIG": "/path/to/your/private/registry.yaml",
"AGENT_FLEET_CALLER": "antigravity"
}
}
}
}
```
**Codex (`~/.codex/config.toml`):**
```toml
[mcp_servers.agent_fleet]
command = "/path/to/agent-fleet-mcp"
[mcp_servers.agent_fleet.env]
AGENT_FLEET_CONFIG = "/path/to/your/private/registry.yaml"
AGENT_FLEET_CALLER = "codex"
```
**CLI usage (for DeepSeek Harness `dsh` or shell scripts):**
```bash
agent-fleet list
agent-fleet status
agent-fleet run gpu1.sbc.claude "Summarize training logs in ~/work" --wait-sec 30 --tmux
agent-fleet output <run_id> --view final
```
## Security & Design Principles
1. **Zero secrets in repo**: All endpoints, SSH aliases, account labels, and private host paths live in a user-managed `registry.yaml` outside the package repository.
2. **Follow native host configurations**: Respects each host/sandbox tool's own configuration instead of injecting conflicting permission overrides.
3. **Fail-closed sandbox guard**: `ssh+sbc` targets with `required_egress` refuse execution if `sbc status` reports `running=false`, `exit_verified=false`, or an unexpected exit IP.
4. **Anti-recursion**: `AGENT_FLEET_DEPTH` enforces `max_recursion_depth` (default `2`) across delegated calls.
5. **Human-visible sessions**: Every delegated run persists natively in the target tool's session store and returns a copy-pasteable `resume_cmd` (plus optional `tmux_attach_cmd`).
TDQS
Scored across 7 tools
fleet_run (delegate) vs fleet_runs (history) differ only by a plural, and fleet_list (configured endpoints) vs fleet_status (live health) vs fleet_runs (run history) all describe inspection of the same fleet object, which invites misselection. Descriptions do clarify each intent, so an attentive agent can disambiguate, but the singular/plural pair especially requires reading the description.
All tools share the fleet_ prefix and snake_case, which is predictable. Minor deviation: the set mixes verbs (list, stop, transfer, run) with bare nouns (status, runs, output), so the suffix does not signal the action consistently.
Seven tools is well-scoped for a fleet orchestration server: discovery, health, delegation, history, output, transfer, and stop each earn a distinct role. No filler tools and no obvious missing niche within the count.
The run lifecycle is covered end to end: list targets, check status, delegate/resume, stream output, list runs, stop, and move files. The notable gap is target lifecycle management—no tool to register, edit, or remove a harness endpoint—so configuration must happen outside the server.