Docs

Model Context Protocol

MCP

Beforewear's MCP server is hosted at https://mcp.beforewear.com/. An assistant connected to it opens the library, makes and changes designs, shows them on the garment's own models and exports print files, for your Beforewear organization. The tools follow the protocol.

Connect an assistant

Add the address as a connector in Claude, ChatGPT or another assistant that speaks MCP. It sends you to Studio, where you see what it will be able to do and connect it to your organization. It stays connected until you disconnect it in Studio, under Connect.

claude mcp add --transport http beforewear https://mcp.beforewear.com/

A personal token

For a script, or an assistant you run yourself: make a personal token in Studio, under Connect. It is shown once; send it as a bearer token. The Python SDK does this for you.

Tools

ToolDoesCosts
garment.listThe garments you can design on: yours (at the sizes whose look you accepted in Studio), then the library's, each with its sizes.free
garment.get(garment_id)One garment, yours or the library's: each size's build, check, fit and states.free
preset.list(kind?)Patterns (with their repeat in cm and background), motifs (with their width), murals and abstracts (words for design.generate).free
design.list(limit?)Your designs, the last saved first.free
design.get(design_id)One design: its base colour, layers and areas, and the Studio link that opens it.free
design.create(garment_id, size, name, base_colour?, preset_id?)A new design. A pattern preset prints over the whole garment, on its background unless a base colour is given.free
design.update(design_id, name?, base_colour?, preset_id?)Its name, base colour or print.free
design.place(design_id, area, artwork | text | preset_id, width_cm?, x?, y?, rotate?, colour?)Puts one layer on an area: your file (attached, an https link, or sent as a data URL), lettering, or a motif. Kept where it can print.free
design.place(design_id, layer_id, …)Moves, resizes, turns or recolours a layer; changes lettering's words.free
design.remove(design_id, layer_id)Takes a layer off.free
design.delete(design_id)Forgets the design.free
design.generate(design_id, prompt)The design generator draws from words onto the design's pieces; on a design already drawn, the words change the drawing. A run takes minutes.a generated design's price, from the balance
design.get_generation(handle, wait_sec?)How a run is going (waits up to 50 s); once drawn, the design with the drawing on it.free
design.export(design_id)The print files, behind a link for an hour.free
mockup.render(design_id, models?, views?)The garment's own models wearing the design; the mockups come back in the answer. Views: front, side, back, torso.free
design.show(design_id)The design in 3D on its garment, in Studio's viewer, where the assistant's host draws apps; elsewhere the Studio link. Not in the SDK.free
garment.show(garment_id, size)A garment as built at one size, in 3D, each piece in its own colour. Not in the SDK.free
balance.getThe balance in dollars and the last entries.free
build.price(sizes)What a build of the sizes comes to, about, and how long it takes: New garment's price, and the cap a build stops at unless you say.free
build.request(words, pattern? | model? | files? | start_from + changes?, name?, sizes?, technique?, fabric?, cap_dollars?)Studio's New garment: what the person wants, in their words, with their sewing pattern (DXF or PDF) or a 3D model (GLB or OBJ), and a size chart and photos if they have them; or a library garment from build.list's starts, with their changes (its options, a zip's length, each size cut as another). What the call does not say is read as Studio reads it. It waits for its computer.its cap is held; charged for its computer's time and its AI's work
build.get(build_id) · build.listWhere a build stands, size by size: the step each size is at, what its computer said in plain words, what it has come to against its cap, and what it asks.free
build.answer(build_id, answers)Sends the person's answer to what a build asks; it starts again on a computer of its own.nothing while it waits; charged once, at its end
build.send(build_id, pattern? | files?, sizes?, cap_dollars?)The file an ended build refused a size for, which the size names: a build of those sizes starts with it, of the same garment.its own cap is held; charged for its own computer's time and AI work
build.cancel(build_id)Calls off a build: waiting for its computer, its cap is released whole; running, it stops at its computer's next report; waiting for an answer, it ends then.what it used up to then

On the wire

Streamable HTTP, JSON-RPC: one tools/callper request, answered as JSON or as a server-sent event. A tool's answer is in structuredContent; mockup.render also returns its mockups as image blocks.

curl https://mcp.beforewear.com/ \
  -H "Authorization: Bearer vbl_pat_..." \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
  "jsonrpc": "2.0", "id": 1,
  "method": "tools/call",
  "params": {
    "name": "design.create",
    "arguments": {
      "garment_id": "vb-py-aop-hood",
      "size": "L",
      "name": "Club hoodie",
      "base_colour": "navy"
    }
  }
}'

A refusal comes back as an error result with a sentence that says why; a token the server does not take is a 401 with the address of its protected-resource document, which is how an assistant finds the sign-in.

The design generator

design.generate answers at once with a handle; the drawing takes minutes. Poll design.get_generation with wait_secup to 50: once it is drawn, the answer carries the design with the drawing on its pieces. It costs a generated design's price, from your balance. A build is charged for its computer's time and its AI's work; the other tools are free.