Skip to content
Judd Gurtman

← All work

Agent fleet

My agents are separate apps, each with its own folder, tests and ship. A small MCP server exposes all of them as tools, so one orchestrator agent can run them. Anything that spends money has a cap and waits for a person to approve it.

Code ↗

Shipped
September 2026
Stack
Python, Model Context Protocol (MCP)
Agents connected
The research agent and the code fixer, so far
Built with
Claude Code as my pair programmer

How it works

Every agent follows one result contract: run its command line with --json, and it prints progress on one channel and exactly one JSON object on the other. The server only has to know that contract, not how each agent works inside.

  1. 01
    A request The orchestrator, in Claude Code

    Decides which agent a goal needs and calls it like any other tool.

  2. 02
    The MCP server Python, over stdio

    One small server exposes every agent as a tool. It checks the settings a caller asked for against the caps.

  3. 03
    The agent runs Its own app, in its own environment

    The server starts the agent's command line with --json. Agents never share dependencies, so adding one changes nothing else.

  4. 04
    Progress streams back Code

    The agent's stage lines ([3/6]...) become progress updates the caller can watch.

  5. 05
    One result The result contract

    Exactly one JSON object: status, output, error, cost in dollars, seconds, and the files it saved.

The tools so far

ToolWhat it doesCost
researchRuns the research agent: a brief where every sentence cites its source. Cost and time measured on a two-part question with the shipped code (run of Sep 28).$0.37, 7.5 min
recent_researchLists past briefs, so a caller can reuse one instead of paying again.Free

Guarding the money

  • Caps a caller can't raise. A research call can ask for at most 4 sub-questions with 3 searches each. It can ask for less, never more.
  • A person in the loop. Paid tools aren't pre-approved, so the orchestrator has to ask before it spends.
  • Stuck jobs get killed. A cancelled or stuck call shuts down the agent's process so it stops spending. The cleanup runs no matter how the call ends, not only on a timeout.
  • Failures say what they cost. Every error comes back as a tool error that includes what was spent.

What I learned

  • In an MCP server over stdio, never print to stdout. That channel carries the protocol itself, so one stray print breaks the connection.
  • Big results need a limit. The caller caps a tool result at about 25,000 tokens, so long output is cut and points to the saved file instead.
  • A paid run must never crash after the money is spent. Anything that touches the network catches its errors and keeps what it already has.

What's next

A front door that sends every request to the right agent and checks my rules on privacy and cost before anything runs, and more agents behind it.

How I built it

I built it with Claude Code as my pair programmer, and the orchestrator itself runs in Claude Code.

Next case study Research agent → The first agent in the fleet: a brief where every sentence cites its source.