convert-figma-to-code
Convert Figma design layers to production-ready code blocks for websites, layouts, and themes using the Flowbite UI framework and Tailwind CSS.
Instructions
Converts a Figma layer to a code block
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| figmaNodeUrl | Yes | The URL of the Figma node to convert |
Implementation Reference
- src/index.ts:675-703 (registration)MCP tool registration for 'convert-figma-to-code' with schema definition and handler functionserver.tool( 'convert-figma-to-code', 'Converts a Figma layer to a code block', { figmaNodeUrl: z.string().describe('The URL of the Figma node to convert'), }, async ({ figmaNodeUrl }): Promise<CallToolResult> => { try { return { content: [ { type: 'text', text: `Code block converted`, }, ], }; } catch (error) { console.error(`Error converting Figma node to code: ${error}`); return { content: [ { type: 'text', text: `Error converting Figma node to code: ${error}`, }, ], } } } );
- src/index.ts:678-680 (schema)Zod schema definition for the figmaNodeUrl parameter{ figmaNodeUrl: z.string().describe('The URL of the Figma node to convert'), },
- src/index.ts:681-702 (handler)Handler function that processes the convert-figma-to-code request (currently a stub implementation)async ({ figmaNodeUrl }): Promise<CallToolResult> => { try { return { content: [ { type: 'text', text: `Code block converted`, }, ], }; } catch (error) { console.error(`Error converting Figma node to code: ${error}`); return { content: [ { type: 'text', text: `Error converting Figma node to code: ${error}`, }, ], } } }