clothing-servermcp
v1.0.7
Published
A virtual try-on service using FastMCP framework
Downloads
592
Maintainers
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
- Virtual Try-On: Upload clothing and model images to generate a try-on result
- 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 fastmcpAlternative installation using uv (recommended):
uv pip install requests fastmcpOption 2: Using Installation Scripts (Windows)
For Windows users, you can use the provided installation scripts:
In Command Prompt:
install.batIn PowerShell:
.\install.ps1Set API Key
Set your ARK API Key as an environment variable:
export ARK_API_KEY=your_api_key_hereOn Windows (Command Prompt):
set ARK_API_KEY=your_api_key_hereOn Windows (PowerShell):
$env:ARK_API_KEY="your_api_key_here"Or you can pass it as a parameter in the API request.
Usage
Running with npx (Recommended)
To run the service directly with npx:
npx clothing-servermcpThis will automatically download and run the latest version of the service.
Running locally
Start the service:
python clothing_mcp_server.pyThe 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:
virtual_tryon- Performs virtual try-on by swapping clothing in the model imagerecommend_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.pyThis 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.pyTroubleshooting
If you encounter a 401 Unauthorized error when using the virtual try-on feature, check the following:
- Ensure your API key is correct and active
- Verify that your API key has the necessary permissions for the image generation API
- Check if the API endpoint or authentication method has changed
- 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.
