OAuth Setup Guide
This guide explains how to set up OAuth authentication for the Figma Console MCP server, allowing users to authenticate with their own Figma accounts.Overview
OAuth authentication enables:- ✅ Per-user authentication - Each user authenticates with their own Figma account
- ✅ Secure token storage - Tokens stored securely in Cloudflare Workers KV (encrypted at rest)
- ✅ No credential sharing - No need to share personal access tokens
- ✅ Browser-based flow - Seamless authentication experience
- ✅ Automatic token management - Tokens managed transparently
Architecture
For Server Administrators
Step 1: Create a Figma OAuth App
- Go to Figma Developers
- Click “My Apps” → “Create new app”
-
Fill in app details:
- App name:
Figma Console MCP(or your preferred name) - App description:
AI-powered Figma debugging and design system tools - App website:
https://github.com/southleft/figma-console-mcp
- App name:
-
Add Redirect URL:
Replace
figma-console-mcp.southleft.comwith your actual deployment URL. -
Save and copy:
- ✅ Client ID (public)
- ✅ Client Secret (private - only shown once!)
Step 2: Configure Cloudflare Secrets
Set the OAuth credentials as Cloudflare Workers secrets:Step 3: Deploy Your MCP Server
- Go to Workers & Pages → figma-console-mcp
- Navigate to Settings → Variables
- Add encrypted environment variables:
FIGMA_OAUTH_CLIENT_IDFIGMA_OAUTH_CLIENT_SECRET
Step 4: Verify Configuration
Check your deployment’s health endpoint:For End Users
Installation
Users simply connect to your remote MCP server - no OAuth setup needed on their end!Authentication Flow
- First API Call: When a user calls a Figma API tool for the first time, they’ll receive an error with an authentication URL
- Browser Opens: Their browser automatically opens the Figma OAuth page
- User Authorizes: User logs in with Figma and authorizes the app
- Success: Browser shows success message and closes automatically
- All Set: Subsequent API calls work seamlessly with their personal token
Example User Experience
Security Considerations
Token Storage
- Tokens stored in Cloudflare Workers KV (encrypted at rest)
- Scoped per-session (not shared between users)
- Automatically cleaned up when tokens expire (90-day TTL)
OAuth Scopes
Currently requesting:file_content:read- Read access to Figma file contentlibrary_content:read- Read access to library/component contentfile_variables:read- Read access to design variables (for Enterprise accounts)
Token Refresh
- ✅ Automatic token refresh implemented
- Tokens are automatically refreshed when expired using the refresh token
- Users only need to re-authenticate if refresh fails or after extended inactivity
Best Practices
✅ DO:- Keep Client Secret confidential
- Use HTTPS for all OAuth callbacks
- Rotate secrets periodically
- Monitor OAuth usage via Figma dashboard
- Commit secrets to version control
- Share Client Secret publicly
- Use OAuth for untrusted deployments
Troubleshooting
”OAuth not configured” Error
Symptom: Users seeOAuth not configured error
Solution: Ensure FIGMA_OAUTH_CLIENT_ID and FIGMA_OAUTH_CLIENT_SECRET are set in Cloudflare Workers secrets
”Invalid redirect_uri” Error
Symptom: OAuth callback fails with redirect URI mismatch Solution: Ensure redirect URL in Figma app settings exactly matches your deployment URL:Token Expired
Symptom: Users see “Token expired. Please re-authenticate.” Solution: User needs to call any Figma API tool to trigger re-authentication flowDebugging OAuth Flow
Enable debug logging:Migration from Personal Access Tokens
If you’re currently usingFIGMA_ACCESS_TOKEN (deprecated):
- Set up OAuth as described above
- Keep
FIGMA_ACCESS_TOKENfor backward compatibility - New users will automatically use OAuth
- Existing token-based users can continue until tokens expire
- Eventually remove
FIGMA_ACCESS_TOKENwhen all users migrated
OAuth App Settings
Scopes Requested
file_content:read- Read Figma file contentlibrary_content:read- Read library/component datafile_variables:read- Read design variables (Enterprise)
Webhook Configuration (Optional)
Future enhancement: Set up webhooks for token revocation notificationsSupport
- Documentation: https://github.com/southleft/figma-console-mcp
- Issues: https://github.com/southleft/figma-console-mcp/issues
- Figma OAuth Docs: https://www.figma.com/developers/api#oauth2