API and MCP

Members can call the same nesting engine as the web tool from their own order system (REST API) or from an AI assistant (MCP). Both return the layout as JSON: each sheet's length and every piece's position, size and rotation. Use the web tool to turn a layout into print-ready PNGs.

API key

API and MCP access is in early access. Contact us for a key. Send it as Authorization: Bearer <key>. Each key has a daily request limit (1,000 by default).

REST API

curl https://dtfnest.app/api/v1/nest \
  -H "Authorization: Bearer $DTFNEST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "profile_id": "xtool-apparel",
    "pieces": [
      { "id": "logo-front", "width_mm": 250, "height_mm": 280, "quantity": 3, "order_id": "1001" },
      { "id": "neck-label", "width_mm": 60, "height_mm": 40, "quantity": 12 }
    ]
  }'

Limits: 500 designs and 2,000 total pieces per request. Errors return JSON with a message saying which field to fix. Send a User-Agent header that names your app; requests with an empty User-Agent or Python urllib's default one are blocked by our firewall.

MCP server

Endpoint https://dtfnest.app/mcp (Streamable HTTP). Tools: list_printer_profiles and nest_layout. Supports MCP protocol 2026-07-28 and the earlier 2025 revisions. Example client configuration:

{
  "mcpServers": {
    "dtfnest": {
      "type": "http",
      "url": "https://dtfnest.app/mcp",
      "headers": { "Authorization": "Bearer YOUR_DTFNEST_API_KEY" }
    }
  }
}

Then ask your assistant, for example: "Nest today's 14 orders for the xTool printer and tell me how much film it uses."