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
- Free tier: 10 minutes/day, 3 concurrent browsers
- Paid tier: 10 hours/month, then $0.09/browser hour
- Automatically available on Workers
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
-
Free Tier:
- 10 minutes/day
- 3 concurrent browsers
- Perfect for personal use
-
Paid Tier:
- 10 hours/month included
- Then $0.09/browser hour
- Auto-scales
Workers
-
Free Tier:
- 100,000 requests/day
- 10ms CPU time per request
- More than enough for most users
-
Paid Tier ($5/month):
- 10 million requests/month
- 50ms CPU time per request
- Better for teams
- 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
Browser Launch Fails
Check logs:- Browser Rendering API quota exceeded � Upgrade plan
- Timeout too short � Increase
BROWSER_TIMEOUT - Cold start delay � Normal, wait and retry
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