Skip to main content
Glama

Figma MCP Server

by 1yhy
file.ts767 B
/** * 根据节点名称生成文件名 */ export function generateFileName(name: string, format: string): string { // 移除不合法的文件名字符 const sanitizedName = name.replace(/[/\\?%*:|"<>]/g, '_') .replace(/\s+/g, '_') .toLowerCase(); // 如果名称已经包含扩展名,则保留原名 if (sanitizedName.includes(`.${format.toLowerCase()}`)) { return sanitizedName; } return `${sanitizedName}.${format.toLowerCase()}`; } /** * 根据节点特征选择合适的导出格式 */ export function suggestExportFormat( node: any, isSVGNode: (node: any) => boolean, ): 'PNG' | 'JPG' | 'SVG' { // SVG格式 if (isSVGNode(node)) { return 'SVG'; } return 'PNG'; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/1yhy/Figma-Context-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server