Get Design Context
get_design_contextFetches design context for a Figma node, returning reference code, assets, screenshot, and variables for Flutter, HTML, or React design-to-code workflows.
Instructions
Get design context for a Figma node — the primary tool for design-to-code workflows. Returns reference code (Flutter widgets for Flutter projects, HTML + Tailwind for static sites, React + Tailwind otherwise), the assets it uses, a screenshot and the variables in the node. The code must be adapted to the target project. Use the nodeId parameter to specify a node id; from a URL like https://figma.com/design/:fileKey/:fileName?node-id=1-2 the node id is 1:2. With no nodeId the current selection in Figma is used. Large nodes return metadata instead of code unless forceCode is set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | React and HTML: draw the node as a web page that fills the viewport, never narrower than the design, with full-width sections stretching (default: frames 768 or more wide). | |
| nodeId | No | The ID of the node, eg. "123:456" or "123-456" (instance ids like "I1:2;3:4" work too). Omit it to use the current selection in Figma. | |
| screen | No | Draw the node as a phone screen that fills the screen and scrolls when tall (default: portrait frames 300-480 wide). | |
| fileKey | No | The key of the Figma file. Accepted for compatibility; the file open in Figma Desktop is always used. | |
| assetsDir | No | Folder of the asset files in the code. Flutter default: the svg/png/images folders of the project's pubspec.yaml, else assets/figma. React default: public/figma (static/figma for SvelteKit), loaded by URL (/figma/name.svg). HTML default: assets/figma, relative to the page. | |
| forceCode | No | Always return code, even for very large nodes. | |
| framework | No | Code to generate: react, html or flutter. Default: from clientFrameworks / clientLanguages, else FIGMA_LOCAL_MCP_FRAMEWORK, else flutter when the project has a pubspec.yaml, html for a static site (index.html without package.json), else react. | |
| screenUtil | No | Flutter: write lengths with flutter_screenutil (.w, .h, .r, .sp) so the layout scales from the design size (default: when the project's pubspec.yaml depends on flutter_screenutil). | |
| skillNames | No | Accepted for compatibility (logging only). | |
| clientLanguages | No | Comma separated languages of the client, e.g. "dart" (picks the framework). | |
| clientFrameworks | No | Comma separated frameworks of the client, e.g. "flutter" (picks the framework). | |
| excludeScreenshot | No | Leave the screenshot out of the response. | |
| disableCodeConnect | No | Draw mapped components from their layers instead of naming the code component. |