WM StudioDocs
ToolsWorkflowsChangelogGitHub
  • Introduction
  • Getting started
  • Configuration
  • Tool index
Reference

Configuration

Environment variables, endpoints, models, and deployment hooks for the WM Studio MCP.

Environment

All configuration is driven by environment variables. Copy .env.example →.env and set the values below.

VariableRequiredDescriptionExample
WMSTUDIO_API_URLrequiredWM Studio REST base URL the MCP delegates job submission to.https://wm.studio
FAL_KEYrequiredfal.ai API key used by image/video/3D providers.fal-...
JWT_SECRETrequiredSigning key for MCP access tokens. 32+ random bytes in production.$(openssl rand -base64 32)
MCP_BASE_URLrequiredPublic URL of this MCP service. Used for OAuth redirects and metadata.https://your-fly-app.fly.dev
SUPABASE_URLrequiredSupabase project URL (same as the WM Studio app).—
SUPABASE_ANON_KEYrequiredSupabase anon key for the user-login bridge.—
REDIS_URLrequiredRedis URL — required in production for OAuth state, jobs, rate limits.redis://localhost:6379
ENVIRONMENToptionalSet to `production` to enforce HTTPS.—
ENFORCE_HTTPSoptionalForce HTTPS even outside production.—

Authentication

The MCP validates Authorization: Bearer <JWT> withaud=wmstudio-mcp. OAuth 2.1 + PKCE bridges to Supabase as the IdP. The server holds PKCE state in Redis under mcp:oauth:* with a short TTL.

bash
# Mint a dev JWT (uses .env JWT_SECRET)
PYTHONPATH=. python -c "from src.auth import create_test_token; print(create_test_token())"

# Use it
curl -H "Authorization: Bearer $TOKEN" "$MCP_BASE_URL/mcp/"
Never log tokens
Authorization headers must never be logged. Structured logging in src/server.pyintentionally omits them.

Models

Tool calls accept a model argument keyed to the provider catalogue. The enabled set is driven by your fal.ai workspace and the WM Studio rate-card. Common ids:

  • Image: openai/gpt-image-2, fal-ai/flux-2-pro, fal-ai/nano-banana-pro, fal-ai/recraft, gemini
  • Video: fal-ai/kling-video/v2.5-turbo/pro/text-to-video, fal-ai/kling-video/v2.5-turbo/pro/image-to-video, fal-ai/sora-2/text-to-video/pro, fal-ai/wan, fal-ai/minimax, fal-ai/bytedance
  • Enhance: topazlabs/video (Video Enhance), built-in upscaler (Upscale Image)

Pass unsupported_model? See errors. The ground truth is src/app/[locale]/dashboard/creative-studio/static-models.ts.

Endpoints

MethodPathDescription
POST/mcp/Streamable HTTP MCP endpoint (tools, resources).
GET/.well-known/oauth-authorization-serverOAuth 2.1 metadata.
GET/.well-known/oauth-protected-resourceResource metadata.
GET/oauth/authorizeAuthorization endpoint (server-held PKCE).
POST/oauth/tokenToken endpoint.
GET/oauth/idp-callbackSupabase IdP callback.
POST/oauth/registerDynamic client registration.
GET/healthLiveness probe.
POST/webhooks/jobsInbound webhook from provider workers (fal.ai callbacks, internal renderers).

Rate limits

Rate-limiting middleware is backed by Redis (src/rate_limiter.py). Per-user windows are applied to /oauth/* and tool execution. Reject responses include standard Retry-After hints.

Deployment

Fly.io and Railway are supported out-of-the-box.

fly launch --no-deploy
fly secrets set JWT_SECRET="$(openssl rand -base64 32)"
fly secrets set WMSTUDIO_API_URL="https://wm.studio"
fly secrets set FAL_KEY="fal-..."
fly secrets set SUPABASE_URL="https://xxx.supabase.co"
fly secrets set SUPABASE_ANON_KEY="your-anon-key"
fly secrets set REDIS_URL="redis://..."
fly secrets set MCP_BASE_URL="https://your-fly-app.fly.dev"
fly secrets set ENVIRONMENT="production"
fly deploy
On this page
  • Environment
  • Authentication
  • Models
  • Endpoints
  • Rate limits
  • Deployment
WM Studio MCP — v2.0.0
Docs home