JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q39065F
  • License MIT

A virtual try-on service using FastMCP framework

Package Exports

  • clothing-servermcp
  • clothing-servermcp/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (clothing-servermcp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Virtual Try-On Service

This is a FastMCP service that provides virtual try-on capabilities for clothing. Users can upload clothing and model images, and the service will generate a composite image showing the clothing on the model. The service implements the Model Context Protocol (MCP) for seamless integration with compatible clients.

Features

  1. Virtual Try-On: Upload clothing and model images to generate a try-on result
  2. Outfit Recommendations: Get recommendations for outfits with fabric materials and prices

Prerequisites

  • Python 3.10+ (required for FastMCP)
  • Node.js and npm for running with npx

Installation

Option 1: Manual Installation

Install the required Python packages:

pip install requests fastmcp

Alternative installation using uv (recommended):

uv pip install requests fastmcp

Option 2: Using Installation Scripts (Windows)

For Windows users, you can use the provided installation scripts:

In Command Prompt:

install.bat

In PowerShell:

.\install.ps1

Set API Key

Set your ARK API Key as an environment variable:

export ARK_API_KEY=your_api_key_here

On Windows (Command Prompt):

set ARK_API_KEY=your_api_key_here

On Windows (PowerShell):

$env:ARK_API_KEY="your_api_key_here"

Or you can pass it as a parameter in the API request.

Usage

To run the service directly with npx:

npx clothing-servermcp

This will automatically download and run the latest version of the service.

Running locally

Start the service:

python clothing_mcp_server.py

The service will start on http://0.0.0.0:8000 with SSE transport.

Using with MCP Clients

This service implements the Model Context Protocol (MCP) and can be used with any MCP-compatible client. The service exposes two tools:

  1. virtual_tryon - Performs virtual try-on by swapping clothing in the model image
  2. recommend_outfits - Recommends outfits with fabric materials and prices

These tools can be accessed through the MCP interface when connecting to the service.

Testing

A test script is provided to verify that the service is working correctly:

python test_fastmcp_service.py

This script will test all endpoints and display the results.

Client Example

An example client is provided in fastmcp_client_example.py to demonstrate how to use the service from another Python application with FastMCP:

python fastmcp_client_example.py

Troubleshooting

If you encounter a 401 Unauthorized error when using the virtual try-on feature, check the following:

  1. Ensure your API key is correct and active
  2. Verify that your API key has the necessary permissions for the image generation API
  3. Check if the API endpoint or authentication method has changed
  4. Confirm that you have network connectivity to the ARK API endpoint

The service logs detailed information about API requests and responses, which can help diagnose issues.