MCP Server Documentation

Connect AI assistants to MerchLoom for automated batch image processing.

MerchLoom exposes an MCP (Model Context Protocol) server that lets AI assistants — Claude, ChatGPT, Cursor, and any MCP-compatible client — process images on your behalf. Remove backgrounds, AI-edit with natural language prompts, and upscale product photos at scale, all through conversational AI.

Endpoint

URL: https://api.merchloom.ai/mcp/

Transport: Streamable HTTP (MCP specification)

Authentication

Two authentication methods are supported:

API Key (Cursor, custom clients)

Generate an API key in your Profile page. Include it as a Bearer token in every request:

Authorization: Bearer ml_live_...

OAuth 2.1 (Claude Desktop, ChatGPT)

Claude Desktop and ChatGPT use OAuth 2.1 with PKCE for automatic authentication. When you add MerchLoom as a connection, the client handles the OAuth flow — you just log in and approve access.

Discovery: https://api.merchloom.ai/.well-known/oauth-protected-resource

Authorization: https://api.merchloom.ai/auth/mcp/authorize

Token: https://api.merchloom.ai/auth/mcp/token

Registration: https://api.merchloom.ai/auth/mcp/register

PKCE: Required (S256 only)

Scope: mcp:tools

Available Services

ServiceIDCostDescription
Background Removalbg_remove$0.08/imgRemove backgrounds, output transparent PNG. Multiple AI models for different product types.
AI Editingedit_ai$0.12–0.32/imgPrompt-driven editing: reframe to any aspect ratio, place products in scenes, change colors, extend canvas, swap backgrounds. Multi-image fusion mode: $0.30–0.60/img.
AI Upscalingupscale$0.08/MP1x–200x upscaling with AI detail enhancement. Per-megapixel pricing — remove backgrounds first to shrink images and save up to 87%.

Pipeline steps are auto-ordered for cost optimization: bg_remove (early) → edit_ai (middle) → upscale (middle).

List rates at 1 credit = $1. Credit packs bring effective prices 15–33% lower — see pricing.

MCP Tools (14)

The MCP server exposes 14 tools, split into read-only queries and mutating actions.

Read-Only

ToolDescription
recommend_pipelineGet service catalog, costs, settings, and pipeline planning guide. Call this first.
list_servicesList services with IDs, costs, settings schemas, and ordering categories.
estimate_costEstimate credits for a job given file count, operations, and average dimensions.
get_credit_balanceCheck your available credit balance.
get_job_statusPoll job progress — status, percentage, ETA, current pipeline step.
get_resultsGet download URLs for completed job files (valid for 1 hour).
get_recent_jobsList recent jobs, optionally filtered by status.
download_resultDownload a specific result file. Returns image data directly through the API.

Mutating

ToolDescription
configure_pipelineValidate and auto-order pipeline steps. Returns pipeline dict for submit_job.
get_upload_urlGet a signed upload URL for one file. Returns file_key for submit_job.
get_upload_urlsBatch: get signed upload URLs for multiple files in one call. Returns file_keys + a parallel bash script.
submit_jobSubmit images for processing. Returns job_id for tracking.
cancel_jobCancel a running or queued job. Unprocessed file credits are refunded.
retry_jobRetry a failed job.

Typical Workflow

1. recommend_pipeline(use_case="product photos for Amazon")

2. configure_pipeline(steps=[{"operation": "bg_remove"}, {"operation": "upscale"}])

3. estimate_cost(file_count=50, operations=["bg_remove", "upscale"])

4. get_credit_balance()

5. submit_job(pipeline=..., file_urls=["https://..."])

6. get_job_status(job_id=...) // poll every 10-15 seconds

7. get_results(job_id=...) // when status == "completed"

8. Download files from returned URLs

File Input Methods

MethodWhen to UseHow
file_urlsImages accessible via public HTTPS URLsPass URLs directly to submit_job
file_keysLocal files or large images (>2MB)Call get_upload_url → PUT bytes → pass file_key to submit_job
file_imagesTiny images only (<2KB after base64)Pass base64 strings to submit_job

Limits & Polling

  • Maximum 200 files per job via MCP
  • Upload URLs expire in 5 minutes
  • Result download URLs expire in 1 hour
  • Poll get_job_status every 10–15 seconds (not more frequently)
  • Job statuses: pending → processing → completed | failed | cancelled

Credits

  • 1 MerchLoom Credit (MC) = $1 USD
  • Each service has a per-file cost (see services table above)
  • Multi-step pipelines: cost = sum of all step costs × file count
  • Credits are reserved on submit, refunded on cancel for unprocessed files
  • Purchase credits to start processing (1 MC = $1 USD)

View pricing plans →

Example Use Cases

Clean product photos for Amazon

Remove backgrounds and upscale 50 product images. Background removal runs first to shrink file sizes, saving up to 87% on upscaling costs.

configure_pipeline(steps=[{"operation": "bg_remove"}, {"operation": "upscale"}])

submit_job(pipeline=..., file_urls=[...])

Reframe products to square for Instagram

AI extends backgrounds naturally to fit 1:1 aspect ratio — no cropping, no distortion.

configure_pipeline(steps=[{"operation": "edit_ai", "settings": {"prompt": "Extend canvas to square 1:1. Preserve subject exactly.", "aspect_ratio": "1:1"}}])

Scene placement for Shopify

Place products on lifestyle backgrounds and upscale for web.

configure_pipeline(steps=[

{"operation": "edit_ai", "settings": {"prompt": "Place product on a marble countertop with natural light."}},

{"operation": "upscale"}

])

Quick Setup

Claude Code (recommended)

Claude Code has full bash access — upload and download files directly via curl. The fastest way to process images at scale.

  1. Generate an API key in your Profile page
  2. Run:
    claude mcp add merchloom -- npx -y mcp-remote \ https://api.merchloom.ai/mcp/ \ --header "Authorization:Bearer YOUR_KEY"
  3. Or use OAuth (opens browser to log in):
    claude mcp add merchloom -- npx -y mcp-remote \ https://api.merchloom.ai/mcp/
  4. Start using: "Remove backgrounds from all images in ~/products/"

Cursor

  1. Generate an API key in your MerchLoom profile
  2. In Cursor settings, add MCP server with URL: https://api.merchloom.ai/mcp/ and your API key as Bearer token

Other MCP Clients

Any MCP client with bash/shell access can use MerchLoom. Connect via https://api.merchloom.ai/mcp/ with OAuth 2.1 or API key Bearer token. The client needs network access to api.merchloom.ai for file uploads and downloads.

Support

Questions or issues? Contact us at support@merchloom.ai.