Skip to content

Use FarmLoop with AI agents

Your AI agent can prepare FarmLoop files for you: point it at sliced prints and it hands back files ready for automatic printing, with the cooldown and part-removal sequence for your kit and as many loops as you ask for. Nobody has to open the FarmLoop app.

There are two ways in, from one package (@3dfarmers/farmloop):

  • The MCP server (farmloop mcp) for AI assistants: Claude desktop, Claude Code, Codex, Cursor and any other app that supports MCP.
  • The CLI (farmloop) for coding agents, scripts and watch folders.
  1. The AI decides to use FarmLoop and passes the file path and your settings. It never sees the file itself, only a short summary of the result.
  2. The FarmLoop tool on your computer reads the file and sends it to the FarmLoop server, which prepares it.
  3. The finished file is saved next to the original, or in the folder you name. The original is never changed, and an existing file is never overwritten.

The agent prepares files. It never starts, pauses or stops a print: you, or the farm software you already use, send the file to the printer as usual.

  1. A FarmLoop Business plan.
  2. An API key: in the FarmLoop app, open API Keys and create one, e.g. named “Claude”. Treat it like a password.
  3. Node.js 20 or newer on the computer that runs the agent.

Put the key in your agent’s settings as FARMLOOP_API_KEY, as shown below. Never paste it into a chat.

Add FarmLoop to the app’s MCP configuration (Claude desktop: Settings → Developer → Edit config; Cursor: .cursor/mcp.json), then restart the app:

{
"mcpServers": {
"farmloop": {
"command": "npx",
"args": ["-y", "@3dfarmers/farmloop", "mcp"],
"env": { "FARMLOOP_API_KEY": "fl_user_your_key_here" }
}
}
}
Terminal window
claude mcp add farmloop --env FARMLOOP_API_KEY=fl_user_your_key_here -- npx -y @3dfarmers/farmloop mcp

Add to ~/.codex/config.toml:

[mcp_servers.farmloop]
command = "npx"
args = ["-y", "@3dfarmers/farmloop", "mcp"]
env = { FARMLOOP_API_KEY = "fl_user_your_key_here" }

Call the Processing API directly. The package ships an openapi.yaml describing it, and there is a spec written for AI coding assistants.

Once it’s set up, just ask:

Prepare the three plates in Downloads/jobs for Stage 2 with my PETG preset, 4 loops each.

The agent answers with where it saved the file and how many prints it holds. If FarmLoop reports warnings, the agent shows them to you first: a warned file may not detach correctly, so read them before printing.

Other things you can ask:

  • “Which FarmLoop presets do I have?”
  • “Save these settings as ‘X2D ASA fast’.”
  • “Delete my old test preset.” The agent asks you before deleting, because that can’t be undone.
  • “Check my FarmLoop setup.”
Terminal window
export FARMLOOP_API_KEY=fl_user_your_key_here
npx -y @3dfarmers/farmloop check
npx -y @3dfarmers/farmloop process plate1.gcode.3mf plate2.gcode.3mf --copies-per-file 3,2 --stage 2 --out ./ready
CommandDoes
farmloop process <files...>Process 1 to 10 files into one FarmLoop file
farmloop presets list / get <name>Show presets
farmloop presets save <name> --file preset.json [--replace]Create or replace a preset
farmloop presets delete <name> --yesDelete a preset
farmloop checkCheck the key, the plan and the engine
farmloop settingsEvery setting with range and default

Options for process: --preset, --stage 1|2, --copies, --copies-per-file 2,1,3, --set key=value (any setting), --out <dir>, --overwrite. Add --json for machine-readable output. Exit codes: 0 ok, 1 unexpected, 2 invalid input, 3 key or plan, 4 file rejected, 5 rate limited or busy, 6 network.

  • Only the files you name are read; results are written only to the output folder.
  • The original file is never changed. An existing file is never overwritten unless you ask (-1, -2 is added instead).
  • The output name is kept, including the FL_S2_ prefix that Digital Mode kits need.
  • Deleting a preset needs your confirmation; replacing one needs an explicit yes.
  • The key is read from FARMLOOP_API_KEY only and never shown.

The same as the Processing API: 10 jobs per 5 minutes per key (several files sent together count once), 200 MB per job, 400 MB after copies, up to 99 loops per file, 50 presets. The tools wait and retry on their own when FarmLoop is busy.

Questions or a key problem: contact FarmLoop support and mention “AI agents”.