Skip to main content

Self-Hosting Guide

Deploy your own instance of Figma Console MCP on Cloudflare Workers.

Why Self-Host?

Use the public server (https://figma-console-mcp.southleft.com) for most use cases. Self-host when:
  • You need guaranteed uptime/SLA
  • You want custom rate limits
  • You need enterprise security/compliance
  • You want to modify the code
  • You’re processing sensitive design data

Quick Deploy

Deploy to Workers Or via CLI:

Prerequisites

  1. Cloudflare Account (free or paid)
  2. Wrangler CLI (installed automatically via npm install)
    • Cloudflare’s deployment tool
  3. Browser Rendering API Access (required for cloud-mode console/screenshot/navigate tools)
    • Free tier: 10 minutes/day, 3 concurrent browsers
    • Paid tier: 10 hours/month, then $0.09/browser hour
    • Automatically available on Workers
  4. Figma OAuth App (for per-user authentication)

Step-by-Step Deployment

1. Clone and Install

2. Authenticate Wrangler

This opens a browser to authenticate with Cloudflare.

3. Configure Your Deployment

Edit wrangler.jsonc (optional):

4. Set Environment Variables

Required: Figma Access Token

Get your token at: https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens

Optional: Custom Configuration

5. Build and Deploy

Expected output:

6. Test Your Deployment

7. Configure Your MCP Client

Update your AI client config to use your instance: Claude Desktop:
Important: Replace <your-subdomain> with your actual Cloudflare Workers subdomain.

Custom Domain (Optional)

1. Add Custom Domain in Cloudflare Dashboard

  1. Go to Workers & Pages � figma-console-mcp
  2. Click “Custom Domains”
  3. Click “Add Custom Domain”
  4. Enter your domain (e.g., mcp.example.com)
  5. Cloudflare handles DNS automatically

2. Update MCP Client Config


Environment Configuration

All Available Secrets

Set these via npx wrangler secret put SECRET_NAME:

Setting Secrets

Viewing Secrets

Deleting Secrets


Monitoring & Logs

Real-Time Logs

Analytics

View analytics in Cloudflare Dashboard:
  1. Go to Workers & Pages � figma-console-mcp
  2. Click “Analytics” tab
  3. See:
    • Request count
    • Error rate
    • CPU time used
    • Duration percentiles

Costs

Browser Rendering API

The cloud-mode console/screenshot/navigate tools launch a headless browser via Cloudflare’s Browser Rendering API.
  • Free Tier: 10 minutes/day, 3 concurrent browsers
  • Paid Tier: 10 hours/month included, then $0.09/browser hour

Workers + Durable Objects

The deployment also uses Workers, two Durable Object classes (the MCP session and the plugin relay), and two KV namespaces for OAuth state.
  • Workers Free Tier: 100,000 requests/day — fine for personal use.
  • Workers Paid Tier ($5/month): 10 million requests/month, plus Durable Objects + KV included.
Estimated monthly cost for typical usage:
  • Solo developer: $0 (free tier)
  • Small team (5 people): $5–15/month
  • Medium team (20 people): $20–50/month

Updating Your Deployment

Update Code

Rollback to Previous Version

View Deployment History


Security Best Practices

1. Protect Your Secrets

  •  Use wrangler secret put (encrypted at rest)
  • L Don’t commit secrets to git
  • L Don’t put secrets in wrangler.jsonc

2. Token Permissions

  • Use a dedicated Figma access token for the MCP
  • Scope token to minimum required permissions
  • Rotate tokens periodically

3. Rate Limiting (Advanced)

For rate limiting, use Cloudflare’s built-in Rate Limiting rules:
  1. Go to Cloudflare Dashboard → SecurityWAFRate limiting rules
  2. Create a rule to limit requests per IP (e.g., 100 requests/minute)
  3. Apply to your worker’s route
Alternatively, use Cloudflare’s Rate Limiting binding for programmatic control - see Cloudflare Rate Limiting docs.

4. Access Control (Advanced)

Add authentication:
Then set the API key:

Troubleshooting

Deployment Fails

Error: “Authentication required”
Error: “Browser Rendering not enabled”
  1. Go to Cloudflare Dashboard
  2. Workers & Pages → Settings
  3. Enable Browser Rendering
  4. Try deploying again
Error: OAuth secrets missing
  1. Confirm wrangler secret list shows both FIGMA_OAUTH_CLIENT_ID and FIGMA_OAUTH_CLIENT_SECRET
  2. If missing, set them via wrangler secret put FIGMA_OAUTH_CLIENT_ID and re-deploy

Browser Launch Fails

Check logs:
Common issues:
  • Browser Rendering API quota exceeded → Upgrade plan
  • KV namespace IDs mismatch — verify wrangler.jsonc against your account’s KV bindings
  • Cold start delay — normal, wait and retry
  • Plugin relay disconnected — Cloud Mode users need to re-pair the Desktop Bridge plugin

High Costs

Check usage:
Reduce costs:
  • Implement request caching
  • Add rate limiting
  • Reduce browser timeout
  • Close browser sessions faster

Advanced Configuration

Custom Worker Name

Multiple Environments

Production:
Staging:
Configure in wrangler.jsonc:

Durable Objects (Persistent Sessions)

For multi-user sessions, enable Durable Objects:

CI/CD Integration

GitHub Actions

Create .github/workflows/deploy.yml:
Set secrets in GitHub:
  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_ACCOUNT_ID

Support

For self-hosting issues: For Cloudflare-specific issues: