بنقرة واحدة
opencode-mcp-figma-auth
Authenticate OpenCode with Figma MCP server to enable Figma design integration
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Authenticate OpenCode with Figma MCP server to enable Figma design integration
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
AI-powered fashion visualization and virtual try-on toolkit for consent-based garment editing and creative design workflows
Transform Markdown into paste-ready WeChat Official Account HTML with 6 themes, auto-numbering, keyword highlighting, and compliance validation
Recognizes and warns against piracy/crack tools disguised as legitimate software
Analyze and identify piracy/crack distribution repositories disguised as legitimate software tools
Analyze and understand software activation mechanisms and digital licensing patterns for educational purposes
Unlock and configure Marvelous Designer 13 for 3D garment simulation with API-driven cloth dynamics
| name | opencode-mcp-figma-auth |
| description | Authenticate OpenCode with Figma MCP server to enable Figma design integration |
| triggers | ["authenticate with figma mcp","log into figma for opencode","connect opencode to figma","set up figma mcp authentication","create figma mcp auth file","enable figma access for mcp","configure figma mcp connection","authenticate figma design server"] |
Skill by ara.so — Design Skills collection.
This skill enables authentication with Figma's MCP (Model Context Protocol) server for OpenCode and other AI agents. Figma MCP rejects non-whitelisted agents by default; this tool generates the required authentication file to bypass that restriction.
OpenCode MCP Figma is a minimal authentication tool that:
https://mcp.figma.com/mcpmcp-auth.json file with valid credentialsThis is specifically needed because Figma's MCP server has agent whitelisting that blocks OpenCode by default.
# Clone or navigate to the project directory
npm install
npm run build
npm start https://mcp.figma.com/mcp
This command:
mcp-auth.json file in the current directoryAfter authentication, move the generated file to OpenCode's MCP auth location:
# Linux/macOS
mv mcp-auth.json ~/.local/share/opencode/mcp-auth.json
# Or merge with existing file if you have other MCP authentications
cat mcp-auth.json >> ~/.local/share/opencode/mcp-auth.json
# Windows
move mcp-auth.json %LOCALAPPDATA%\opencode\mcp-auth.json
opencode-mcp-figma/
├── src/
│ └── index.ts # Main authentication logic
├── package.json
├── tsconfig.json
└── mcp-auth.json # Generated after authentication
The mcp-auth.json file follows this structure:
{
"https://mcp.figma.com/mcp": {
"token": "generated-token-here",
"expires": 1234567890000
}
}
After authentication, configure OpenCode to use Figma MCP by adding to your MCP settings:
{
"mcpServers": {
"figma": {
"url": "https://mcp.figma.com/mcp"
}
}
}
import { authenticate } from './src/index';
// Authenticate with Figma MCP server
const mcpUrl = 'https://mcp.figma.com/mcp';
authenticate(mcpUrl)
.then(() => {
console.log('Authentication successful');
console.log('mcp-auth.json created in current directory');
})
.catch((error) => {
console.error('Authentication failed:', error);
});
import * as fs from 'fs';
import * as path from 'path';
import * as os from 'os';
// Read generated auth file
const authFile = fs.readFileSync('mcp-auth.json', 'utf-8');
const authData = JSON.parse(authFile);
// Get OpenCode's MCP auth path
const openCodeAuthPath = path.join(
os.homedir(),
'.local',
'share',
'opencode',
'mcp-auth.json'
);
// Merge with existing auth if present
let existingAuth = {};
if (fs.existsSync(openCodeAuthPath)) {
existingAuth = JSON.parse(fs.readFileSync(openCodeAuthPath, 'utf-8'));
}
const mergedAuth = { ...existingAuth, ...authData };
// Write merged auth
fs.mkdirSync(path.dirname(openCodeAuthPath), { recursive: true });
fs.writeFileSync(openCodeAuthPath, JSON.stringify(mergedAuth, null, 2));
console.log(`Auth file installed to ${openCodeAuthPath}`);
import * as fs from 'fs';
function verifyAuth(mcpUrl: string): boolean {
try {
const authFile = fs.readFileSync('mcp-auth.json', 'utf-8');
const authData = JSON.parse(authFile);
if (!authData[mcpUrl]) {
console.error(`No authentication found for ${mcpUrl}`);
return false;
}
const { token, expires } = authData[mcpUrl];
if (!token) {
console.error('Token is missing');
return false;
}
if (expires && Date.now() > expires) {
console.error('Token has expired');
return false;
}
console.log('Authentication is valid');
return true;
} catch (error) {
console.error('Failed to verify authentication:', error);
return false;
}
}
verifyAuth('https://mcp.figma.com/mcp');
#!/usr/bin/env node
import { authenticate } from './src/index';
import { execSync } from 'child_process';
import * as path from 'path';
import * as os from 'os';
async function setup() {
const mcpUrl = 'https://mcp.figma.com/mcp';
console.log('Authenticating with Figma MCP...');
await authenticate(mcpUrl);
const destPath = path.join(
os.homedir(),
'.local',
'share',
'opencode',
'mcp-auth.json'
);
console.log('Installing auth file...');
execSync(`mkdir -p ${path.dirname(destPath)}`);
execSync(`mv mcp-auth.json ${destPath}`);
console.log('✓ Figma MCP authentication complete');
console.log('You can now use Figma with OpenCode');
}
setup().catch(console.error);
// For automated environments where manual auth isn't possible
import * as fs from 'fs';
function setupAuthFromEnv() {
const figmaToken = process.env.FIGMA_MCP_TOKEN;
const figmaExpires = process.env.FIGMA_MCP_EXPIRES;
if (!figmaToken) {
throw new Error('FIGMA_MCP_TOKEN environment variable required');
}
const authData = {
'https://mcp.figma.com/mcp': {
token: figmaToken,
expires: figmaExpires ? parseInt(figmaExpires) : undefined
}
};
fs.writeFileSync('mcp-auth.json', JSON.stringify(authData, null, 2));
console.log('Auth file created from environment variables');
}
Problem: Authentication command returns an error
Solutions:
https://mcp.figma.com/mcpnpm installnpm run buildProblem: OpenCode doesn't recognize the authentication
Solutions:
# Verify file location
ls -la ~/.local/share/opencode/mcp-auth.json
# Check file permissions
chmod 600 ~/.local/share/opencode/mcp-auth.json
# Verify file contents
cat ~/.local/share/opencode/mcp-auth.json
Problem: Authentication worked initially but now fails
Solution: Re-run authentication to generate a new token:
npm start https://mcp.figma.com/mcp
mv mcp-auth.json ~/.local/share/opencode/mcp-auth.json
Problem: Need to authenticate with multiple MCP servers
Solution: Merge auth files instead of overwriting:
import * as fs from 'fs';
const newAuth = JSON.parse(fs.readFileSync('mcp-auth.json', 'utf-8'));
const existingPath = '~/.local/share/opencode/mcp-auth.json';
const existing = JSON.parse(fs.readFileSync(existingPath, 'utf-8'));
const merged = { ...existing, ...newAuth };
fs.writeFileSync(existingPath, JSON.stringify(merged, null, 2));
This tool addresses the issue described in OpenCode Issue #988 where Figma's MCP server whitelisting blocks certain AI agents. While designed for Figma, the authentication approach may work with other MCP servers that implement similar authentication mechanisms.