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.
Both use the Processing API, part of the FarmLoop Business plan.
What happens to your files
Section titled “What happens to your files”- 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.
- The FarmLoop tool on your computer reads the file and sends it to the FarmLoop server, which prepares it.
- 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.
What you need
Section titled “What you need”- A FarmLoop Business plan.
- An API key: in the FarmLoop app, open API Keys and create one, e.g. named “Claude”. Treat it like a password.
- 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.
Set it up
Section titled “Set it up”Claude desktop, Cursor and other MCP apps
Section titled “Claude desktop, Cursor and other MCP apps”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" } } }}Claude Code
Section titled “Claude Code”claude mcp add farmloop --env FARMLOOP_API_KEY=fl_user_your_key_here -- npx -y @3dfarmers/farmloop mcpAdd to ~/.codex/config.toml:
[mcp_servers.farmloop]command = "npx"args = ["-y", "@3dfarmers/farmloop", "mcp"]env = { FARMLOOP_API_KEY = "fl_user_your_key_here" }n8n, LangChain or your own software
Section titled “n8n, LangChain or your own software”Call the Processing API directly. The
package ships an openapi.yaml describing it, and there is a
spec written for AI coding assistants.
Ask in plain words
Section titled “Ask in plain words”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.”
From the command line
Section titled “From the command line”export FARMLOOP_API_KEY=fl_user_your_key_herenpx -y @3dfarmers/farmloop checknpx -y @3dfarmers/farmloop process plate1.gcode.3mf plate2.gcode.3mf --copies-per-file 3,2 --stage 2 --out ./ready| Command | Does |
|---|---|
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> --yes | Delete a preset |
farmloop check | Check the key, the plan and the engine |
farmloop settings | Every 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.
Rules the tools follow
Section titled “Rules the tools follow”- 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,-2is 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_KEYonly and never shown.
Limits
Section titled “Limits”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.
Support
Section titled “Support”Questions or a key problem: contact FarmLoop support and mention “AI agents”.