> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wearo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP server

> Connect Claude, ChatGPT, Cursor or Claude Code to Wearo and create virtual try-ons from your AI assistant.

# MCP server

Wearo runs a remote [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server. Once connected, an AI assistant can create a virtual try-on from two photos, follow its progress and check your credit balance.

```
https://api.wearo.io/functions/v1/mcp
```

The server uses the Streamable HTTP transport and keeps no session between requests.

> [!NOTE]
>
> The server needs a Wearo account with credits. Each try-on uses the credits of the account you connect, exactly like the [Direct API](https://docs.wearo.io/api/tryon-endpoint.md).

## Connect your assistant

Sign in with your Wearo account when the assistant asks. You approve the connection on a Wearo consent page. No API key is needed. See [Authentication](https://docs.wearo.io/api/authentication.md#oauth-access-tokens) for how the sign-in works.

> [tab] Claude
>
> 1. Open **Settings**, then **Connectors**.
> 2. Choose **Add custom connector**.
> 3. Enter the URL `https://api.wearo.io/functions/v1/mcp` and add it.
> 4. Click **Connect** and approve the connection on the Wearo page.

> [tab] ChatGPT
>
> 1. Turn on developer mode in **Settings**, then **Connectors**.
> 2. Create a connector and enter the URL `https://api.wearo.io/functions/v1/mcp`.
> 3. Choose **OAuth** as the authentication method, then connect and approve the connection on the Wearo page.

> [tab] Cursor
>
> Add the server to your `mcp.json`:
>
> ```json mcp.json theme={"dark"}
> {
>   "mcpServers": {
>     "wearo": {
>       "url": "https://api.wearo.io/functions/v1/mcp"
>     }
>   }
> }
> ```
>
> Cursor opens the Wearo sign-in page the first time a tool is used.

> [tab] Claude Code
>
> ```bash theme={"dark"}
> claude mcp add --transport http wearo https://api.wearo.io/functions/v1/mcp
> ```
>
> Then run `/mcp` in Claude Code, select **wearo** and choose **Authenticate**.

To use an API key instead of OAuth (for a script or a client without OAuth support), send it as a header:

```json mcp.json theme={"dark"}
{
  "mcpServers": {
    "wearo": {
      "url": "https://api.wearo.io/functions/v1/mcp",
      "headers": { "Authorization": "Bearer wearo_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }
    }
  }
}
```

Menu names vary between client versions. If a step differs, look for the option to add a custom or remote MCP server.

## Tools

| Tool | What it does | Cost |
| - | - | - |
| `create_try_on` | Generates an image of the person in the first photo wearing the garment in the second photo | 1 credit, 2 for a wedding dress |
| `get_try_on` | Returns the status and, once finished, the result link of a try-on | Free |
| `get_credit_balance` | Returns the credits left on the connected account | Free |

### create\_try\_on

| Field | Type | Required | Description |
| - | - | - | - |
| `person_image_url` | string | **Yes** | Public `https` URL of a photo of the person |
| `garment_image_url` | string | **Yes** | Public `https` URL of the garment or product photo |
| `garment_type` | string | No | Garment category, for example `"dress"` or `"jacket"` (80 characters at most) |
| `wedding_dress` | boolean | No | Set to `true` to render the train of a wedding dress. Costs 2 credits. |

The tool waits up to about 40 seconds. If the image is ready, it returns `status: "completed"` with `try_on_id`, `result_url` and `credits_remaining`. If generation takes longer, it returns `status: "pending"` and a `try_on_id`: call `get_try_on` with it after about 30 seconds.

### get\_try\_on

| Field | Type | Required | Description |
| - | - | - | - |
| `try_on_id` | string (UUID) | **Yes** | The `try_on_id` returned by `create_try_on` |

It returns `pending`, `completed` (with `result_url`) or `failed` (with `error_code`). It only reads try-ons of the connected account. A `try_on_id` with no recorded result returns `pending`; if nothing appears after about five minutes, the try-on did not complete and you can create a new one.

### get\_credit\_balance

Takes no input and returns `credits_remaining`.

### Tool annotations

| Tool | Read-only | Destructive | Idempotent | Open world |
| - | - | - | - | - |
| `create_try_on` | No | No | No | Yes |
| `get_try_on` | Yes | No | Yes | No |
| `get_credit_balance` | Yes | No | Yes | No |

## Example prompts

* "Show me how this dress looks on me. My photo: [https://example.com/me.jpg](https://example.com/me.jpg), the dress: [https://example.com/dress.jpg](https://example.com/dress.jpg)."
* "Try this jacket on the person in this photo and give me the link to the result."
* "How many Wearo credits do I have left?"

## Where the result is stored

> [!WARNING]
>
> The result image is stored by Wearo and served at a **public URL that cannot be guessed**. The URL is not signed: anyone who has the link can open the image. Share it only with people you want to see it.

Only use photos of people who agreed to it: yourself, or someone who gave you permission. The assistant can only reach images that are public `https` links; links to private or local addresses are refused.

## Errors

Tool errors come back with `isError: true` and a message. Credits used by a generation that then fails are refunded.

| Situation | What you see | What to do |
| - | - | - |
| No credentials | HTTP `401` with a `WWW-Authenticate` header pointing to the OAuth metadata | Connect the assistant and sign in |
| Invalid or expired token, or a dashboard session token | HTTP `401` with `error="invalid_token"` | Reconnect, or use a valid API key |
| Shopify bridge token | HTTP `403` | Use OAuth or an API key |
| Not enough credits | `errorCode: insufficient_credits` | [Add credits](https://wearo.io/dashboard/credits) |
| Image link refused | `errorCode: image_url_not_allowed` | Use a public `https` link to an image |
| Content rejected by the AI engine | `errorCode: ai_content_rejected` | Try another photo or garment |

The [troubleshooting guide](https://docs.wearo.io/resources/troubleshooting.md) covers the other API errors.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.