AI Agent Orchestration
Use nfltr mcp as the planner-side control plane, run nfltr worker on remote machines, and attach each worker to a local MCP-capable tool such as Claude or GitHub Copilot CLI. NFLTR handles discovery, worker probing, encrypted A2A task streams, and direct artifact handoff while your planner decides which worker should do what.
What Runs Where
| Role | Typical runtime | Responsibility |
|---|---|---|
| Planner | nfltr mcp under VS Code, Claude Desktop, or another MCP client | Discovers peers, probes capacity, starts tasks, answers follow-up questions, and aggregates final results. |
| Worker | nfltr worker on each remote machine | Advertises labels and capacity, launches a local MCP session, streams progress, and returns results or artifacts. |
| Local executor | claude mcp serve, nfltr copilot-mcp, or another MCP-capable tool | Runs the actual AI task next to the local repo, tools, credentials, and runtime state on that worker machine. |
| Collector | Optional second-stage task on the planner or another worker | Combines fan-out outputs into one report, bundle, or deployment decision. |
NFLTR is the coordination transport, not the planner. It gives your AI peer visibility, live capacity checks, bidirectional worker streams, artifact movement, and end-to-end encrypted A2A frames. Worker ranking, retry rules, task decomposition, and final synthesis still live in your planner prompt or orchestration application.
1. Start the Planner-Side MCP Bridge
On the machine running your MCP client, start nfltr mcp and point it at both the NFLTR HTTP API and the gRPC control plane.
nfltr mcp \
--proxy-url https://nfltr.xyz \
--server grpc.nfltr.xyz:443 \
--api-key "$NFLTR_API_KEY" \
--a2a-e2ee
If you want to wire it straight into VS Code, generate the MCP config instead:
nfltr mcp \
--proxy-url https://nfltr.xyz \
--server grpc.nfltr.xyz:443 \
--write-mcp-json .vscode/mcp.json
When the A2A connection is available, this server exposes both raw discovery tools and the orchestration tool set:
list_my_peersfor the raw peer inventory under your keylist_worker_peersfor worker-filtered peers with resource labelsprobe_workerfor live capacity, available slots, and protocol supportorchestrate_taskto start a bidirectional worker taskget_task_statusto inspect progress, questions, errors, or resultsrespond_to_workerto answer a question or attach follow-up artifactscancel_taskandlist_active_tasksfor session control
2. Start Worker Machines
Each worker is just an NFLTR A2A agent with a local MCP server behind it.
Claude-backed worker
nfltr worker \
--server grpc.nfltr.xyz:443 \
--api-key "$NFLTR_API_KEY" \
--labels gpu=a100,repo=payments,zone=eu-west \
--max-tasks 2 \
--mcp-command "claude mcp serve"
Copilot-backed worker
nfltr worker \
--server grpc.nfltr.xyz:443 \
--api-key "$NFLTR_API_KEY" \
--labels repo=payments,tool=copilot,device=laptop \
--max-tasks 1 \
--mcp-command "nfltr copilot-mcp --cwd ~/projects/payments --model gpt-5.2 --reasoning-effort high"
Workers automatically advertise labels that planners can use for selection:
| Label | Meaning |
|---|---|
coord.cpu_cores | CPU capacity advertised by the worker |
coord.memory_mb | Available memory class for scheduling decisions |
coord.load_pct | Current utilization hint for planner-side filtering |
coord.transfer | Preferred transfer mode such as a2a, p2p, or wireguard |
nfltr.worker.protocol | Worker protocol version, currently a2a-mcp-v1 |
nfltr.worker.tool | Local MCP tool name used for task execution |
nfltr.worker.max_tasks | Max concurrent tasks this worker will accept |
nfltr copilot-mcp accepts --model, --mode, and --reasoning-effort when the worker-side process starts. Task calls do not override the Copilot model per request, so pin that behavior at worker boot.
3. Run the Orchestration Cycle
A typical planner loop looks like this:
| Step | Tool | What it does |
|---|---|---|
| Discover | list_my_peers or list_worker_peers | Inspect the peers visible under the current API key and shortlist worker-capable machines. |
| Probe | probe_worker | Confirm live availability, remaining slots, and worker protocol support before sending expensive tasks. |
| Dispatch | orchestrate_task | Send an objective, structured context, constraints, and optional local files to a specific worker. |
| Observe | get_task_status | Watch for running, waiting_input, completed, failed, or cancelled. |
| Reply | respond_to_worker | Provide an answer, clarify scope, or attach additional files when the worker asks follow-up questions. |
| Stop | cancel_task | Terminate the active worker stream when the planner changes course. |
| Inspect | list_active_tasks | Review every task still tracked by the current nfltr mcp session. |
One practical task payload looks like this:
{
"agent_id": "worker-gpu-01",
"task_id": "release-report-20260414",
"objective": "Generate a release summary and attach a markdown report",
"context": {
"service": "payments-api",
"branch": "release/2026-04-14",
"checks": ["unit", "smoke", "security"]
},
"constraints": {
"max_minutes": 15,
"must_include": ["risks", "rollback plan"]
},
"artifact_files": [
"./artifacts/test-summary.json",
"./artifacts/changelog.txt"
],
"timeout_ms": 120000
}
After fan-out, your planner can optionally send one more aggregation task to a collector worker or combine the returned outputs locally.
4. Handle Task State and Recovery
| State | Meaning | Planner action |
|---|---|---|
accepted | The worker accepted the task and opened a live session. | Keep polling for progress or completion. |
running | The worker reported progress. | Continue polling or update your own progress view. |
waiting_input | The worker needs an answer or more artifacts. | Call respond_to_worker with content or files. |
completed | The worker returned a final result and optional artifacts. | Read the result, collect materialized artifacts, and decide next steps. |
failed | The worker or stream failed. | Apply your retry policy or reschedule to another worker. |
cancelled | The planner cancelled the task. | Treat the stream as closed and move on. |
Two behavior details matter in real workflows:
orchestrate_taskcan move fromacceptedtowaiting_input,running, or evencompletedvery quickly, so planners should tolerate fast state transitions.- Provide your own stable
task_idwhenever retries or resume logic matter. Treat that identifier as the planner-side idempotency key for the work item.
5. Move Files and Generated Outputs
Use artifact_files when you want NFLTR to stream local files directly over the existing A2A task stream instead of uploading them to a server-managed URL.
- Planner-side local paths are chunked over A2A when the transport is
a2a-chunk. - The worker receives receiver-local materialized files before the local MCP tool sees them.
- Returned artifacts come back the same way, with planner-local materialized paths once the inbound transfer finishes.
- For very large datasets, keep the task stream for control and move the bulk payload through P2P or object storage with a digest in the task result.
This lets the planner keep prompts small while still attaching build logs, screenshots, test reports, generated binaries, or patch bundles to the worker run.
6. Security and Relay Visibility
nfltr mcp enables A2A payload encryption by default with --a2a-e2ee=true.
- NFLTR can still see source and target agent IDs, timing, and ciphertext sizes so it can route the stream correctly.
- NFLTR cannot read the objective, context, follow-up messages, or chunked artifact contents inside the encrypted A2A frames.
- If you turn encryption off for debugging, do it deliberately and only for non-sensitive workflows.
This is the right default for code review, deployment planning, security triage, or any workflow where the relay should stay blind to task contents.
When to Use This Pattern
| Need | Recommended NFLTR pattern |
|---|---|
| Structured planner-worker task loops with progress, prompts, and artifacts | nfltr mcp orchestration tools plus nfltr worker |
| Simple service-to-service HTTP calls between agents | list_my_peers plus proxy_request |
| Expose one laptop-hosted AI session directly in a browser | nfltr ai or the Remote AI Workstation pattern |
| Move large binaries or datasets directly between machines | P2P Direct Transfer with orchestration metadata kept on the control stream |
Related Reading
- CLI Reference: nfltr mcp — planner-side MCP bridge flags and generated VS Code config.
- Agent-to-Agent Communication — the underlying A2A transport model.
- End-to-End Encryption — what the relay can and cannot see.
- Remote AI Workstation — publish one laptop-hosted AI session directly.
- Managed Capabilities — dashboard-driven route and runtime control for long-lived agent surfaces.