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

RoleTypical runtimeResponsibility
Plannernfltr mcp under VS Code, Claude Desktop, or another MCP clientDiscovers peers, probes capacity, starts tasks, answers follow-up questions, and aggregates final results.
Workernfltr worker on each remote machineAdvertises labels and capacity, launches a local MCP session, streams progress, and returns results or artifacts.
Local executorclaude mcp serve, nfltr copilot-mcp, or another MCP-capable toolRuns the actual AI task next to the local repo, tools, credentials, and runtime state on that worker machine.
CollectorOptional second-stage task on the planner or another workerCombines fan-out outputs into one report, bundle, or deployment decision.
Mental model

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:


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:

LabelMeaning
coord.cpu_coresCPU capacity advertised by the worker
coord.memory_mbAvailable memory class for scheduling decisions
coord.load_pctCurrent utilization hint for planner-side filtering
coord.transferPreferred transfer mode such as a2a, p2p, or wireguard
nfltr.worker.protocolWorker protocol version, currently a2a-mcp-v1
nfltr.worker.toolLocal MCP tool name used for task execution
nfltr.worker.max_tasksMax concurrent tasks this worker will accept
Copilot model selection lives on the worker

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:

StepToolWhat it does
Discoverlist_my_peers or list_worker_peersInspect the peers visible under the current API key and shortlist worker-capable machines.
Probeprobe_workerConfirm live availability, remaining slots, and worker protocol support before sending expensive tasks.
Dispatchorchestrate_taskSend an objective, structured context, constraints, and optional local files to a specific worker.
Observeget_task_statusWatch for running, waiting_input, completed, failed, or cancelled.
Replyrespond_to_workerProvide an answer, clarify scope, or attach additional files when the worker asks follow-up questions.
Stopcancel_taskTerminate the active worker stream when the planner changes course.
Inspectlist_active_tasksReview 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

StateMeaningPlanner action
acceptedThe worker accepted the task and opened a live session.Keep polling for progress or completion.
runningThe worker reported progress.Continue polling or update your own progress view.
waiting_inputThe worker needs an answer or more artifacts.Call respond_to_worker with content or files.
completedThe worker returned a final result and optional artifacts.Read the result, collect materialized artifacts, and decide next steps.
failedThe worker or stream failed.Apply your retry policy or reschedule to another worker.
cancelledThe planner cancelled the task.Treat the stream as closed and move on.

Two behavior details matter in real workflows:


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.

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.

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

NeedRecommended NFLTR pattern
Structured planner-worker task loops with progress, prompts, and artifactsnfltr mcp orchestration tools plus nfltr worker
Simple service-to-service HTTP calls between agentslist_my_peers plus proxy_request
Expose one laptop-hosted AI session directly in a browsernfltr ai or the Remote AI Workstation pattern
Move large binaries or datasets directly between machinesP2P Direct Transfer with orchestration metadata kept on the control stream

Related Reading