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
Prerequisites
-
Cloudflare Account (free or paid)
- Sign up at https://dash.cloudflare.com/sign-up
-
Wrangler CLI (installed automatically via
npm install)- Cloudflare’s deployment tool
-
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
-
Figma OAuth App (for per-user authentication)
- Create one at https://www.figma.com/developers/apps
- Set
FIGMA_OAUTH_CLIENT_IDandFIGMA_OAUTH_CLIENT_SECRETas Wrangler secrets
Step-by-Step Deployment
1. Clone and Install
2. Authenticate Wrangler
3. Configure Your Deployment
Editwrangler.jsonc (optional):
4. Set Environment Variables
Required: Figma Access Token
Optional: Custom Configuration
5. Build and Deploy
6. Test Your Deployment
7. Configure Your MCP Client
Update your AI client config to use your instance: Claude Desktop:<your-subdomain> with your actual Cloudflare Workers subdomain.
Custom Domain (Optional)
1. Add Custom Domain in Cloudflare Dashboard
- Go to Workers & Pages � figma-console-mcp
- Click “Custom Domains”
- Click “Add Custom Domain”
- Enter your domain (e.g.,
mcp.example.com) - Cloudflare handles DNS automatically
2. Update MCP Client Config
Environment Configuration
All Available Secrets
Set these vianpx wrangler secret put SECRET_NAME:
| Secret | Required | Default | Description |
|---|---|---|---|
FIGMA_ACCESS_TOKEN | Yes | - | Your Figma API token |
LOG_LEVEL | No | info | Logging verbosity (trace/debug/info/warn/error/fatal) |
BROWSER_TIMEOUT | No | 120000 | Browser operation timeout (ms) |
MAX_CONSOLE_LOGS | No | 1000 | Max console logs to buffer |
Setting Secrets
Viewing Secrets
Deleting Secrets
Monitoring & Logs
Real-Time Logs
Analytics
View analytics in Cloudflare Dashboard:- Go to Workers & Pages � figma-console-mcp
- Click “Analytics” tab
- 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.
- 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:- Go to Cloudflare Dashboard → Security → WAF → Rate limiting rules
- Create a rule to limit requests per IP (e.g., 100 requests/minute)
- Apply to your worker’s route
4. Access Control (Advanced)
Add authentication:Troubleshooting
Deployment Fails
Error: “Authentication required”- Go to Cloudflare Dashboard
- Workers & Pages → Settings
- Enable Browser Rendering
- Try deploying again
- Confirm
wrangler secret listshows bothFIGMA_OAUTH_CLIENT_IDandFIGMA_OAUTH_CLIENT_SECRET - If missing, set them via
wrangler secret put FIGMA_OAUTH_CLIENT_IDand re-deploy
Browser Launch Fails
Check logs:- Browser Rendering API quota exceeded → Upgrade plan
- KV namespace IDs mismatch — verify
wrangler.jsoncagainst 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:- Implement request caching
- Add rate limiting
- Reduce browser timeout
- Close browser sessions faster
Advanced Configuration
Custom Worker Name
Multiple Environments
Production:wrangler.jsonc:
Durable Objects (Persistent Sessions)
For multi-user sessions, enable Durable Objects:CI/CD Integration
GitHub Actions
Create.github/workflows/deploy.yml:
CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_ID