SDK & MCP

Garment creation,
inside your product.

Let users ask for a result while your application or agent directs the garment workflow. Python and MCP provide the operations and feedback needed to execute the steps behind your interface.

Developer preview: the SDK and local MCP use an in-memory stub. They demonstrate contracts and state transitions, not connected physics or hosted processing.

Request developer access ↗

For application code

Python SDK

Select garment resources, compose jobs, inspect results, and decide the next step in your own code.

from beforewear import Client

bw = Client()
Explore the Python SDK ↗

For AI agents

MCP

Expose garment operations as agent tools through the Model Context Protocol. The agent can call jobs, inspect refusals, and revise the inputs.

python -m beforewear.mcp
Explore MCP tools ↗

Both interfaces use the same resource and job model. These examples run locally from a provided SDK checkout; hosted MCP is planned.

An example workflow

An existing garment.
A new set of assets.

The client selects resources, creates a garment state, and applies artwork to a child state. The mockup request refers to that specific result.

Examples run from a Beforewear SDK checkout. SDK access, managed pilots, and production integrations are gated. Request access to establish the delivery path for your workflow.

Walk through this example ↗
Python / dress an existing productSDK preview
from beforewear import Client

bw = Client()
product = bw.products.get("aop-hoodie")
body = bw.bodies.select(
    sex="male", size="M", pose="native_straight"
)
material = bw.materials.get("fleece_250gsm")

run = bw.projects.create(
    product=product.id,
    body=body.id,
    material=material.id,
).drape(device="gpu")

printed = bw.graphics.apply(
    run.id, artwork={"front": "front.png"}
)
mockup = bw.mockups.render(printed.id, kind="ghost")

Use a SKU from your catalog in place of aop-hoodie. The current SDK returns fixture states and output paths through an in-memory stub. It does not generate these images yet.

Workflow / 01

An existing garment, many variations.

For POD, custom merch, and product catalogs. Work from a known garment and vary its presentation without rebuilding unchanged geometry.

Read the workflow ↗

Starting input

Product + Body + Material + artwork

  1. Create a Project and drape the blank
  2. Apply color and artwork as child Runs
  3. Request renders, mockups, or an export

Workflow / 02

A new garment, with its history intact.

For apparel tools and internal agent workflows. Keep construction inspectable and use structured gate failures to drive revision. A tech pack can also branch directly from the 2D inputs.

Read the workflow ↗

Starting input

Pattern + Construction + Body + Material

  1. Author or import the construction inputs
  2. Compile, arrange, drape; revise refused inputs
  3. Inspect the Run or request a tech pack

Workflow / 03

Product content from a shared state.

For merchandising and visualization systems. The contract defines on-avatar, ghost, flat, and on-model stills. Motion has its own simulate-then-encode branch.

Read the workflow ↗

Starting input

Draped or presented Run + requested output

  1. Select a Run and apply approved artwork
  2. Choose catalog or mockup presentation
  3. Keep the result linked to its garment

The agent has a boundary

Propose. Verify. Revise.

Author the inputsAgents work with Pattern and Construction. Provenance identifies observed, derived, human-declared, and agent-declared information.

Inspect the failureGateError returns a phase, gate, counts, witnesses, and a hint. A failed gate becomes a specific revision task.

Continue from the resultRevise the source inputs, rerun the job, and inspect the new state. The harness keeps this feedback loop explicit.

Explore the harness ↗

Gated access

Bring your next
garment idea.

Request access

Start with an idea or existing garment.
Tell us what you want to create.