Product area: Dev Mode API / MCP Server (get_design_context tool)
Severity: Medium — causes incorrect code generation that can silently introduce wrong components/props
Summary: The get_design_context tool fails to read variant property overrides on direct component instances, instead returning the component set's default variant values. Instance overrides (nested instances within other instances) read correctly. This results in generated code that omits variant props on some call sites, causing them to fall back to incorrect defaults.
Reproduction steps:
- Open Figma file with a table design containing repeated rows, where each row uses a component instance with a variant property overridden from the default.
- In our case: a
TableCellFrontSpacecomponent set has aContentvariant with valuesIcon(default) and Space. All 7 table rows in the design have Content = Space set explicitly in the Figma UI. - Call
get_design_contexton the parent frame containing the table (node3637:41031in fileNvVUoic7stnFCQxXNGr2c9).
Expected result: All 7 rows should generate code passing content="Space" to TableCellFrontSpace.
Actual result:
- Row 1 (direct instance, node ID
3637:42990— noIprefix): the generated code omits thecontentprop entirely, falling back to the default"Icon". This causes anApplicationIconto render instead of empty space. - Rows 2–7 (instance overrides, node IDs with I prefix, e.g.,
I3637:44334;3637:42928): correctly generatecontent="Space".
Generated code showing the bug:
// Component definition — note the default value "Icon"
function TableCellFrontSpace({ content = "Icon", size = "Large" }) {
if (content === "Icon") return <ApplicationIcon ... />; // WRONG for row 1
if (content === "Space") return <div className="spacer" />;
...
}
// Row 1 — direct instance (3637:42990) — BUG: content prop missing
<TableCellFrontSpace className="..." />
// Falls back to content="Icon", renders ApplicationIcon incorrectly
// Row 2 — instance override (I3637:44334;3637:42928) — CORRECT
<TableCellFrontSpace className="..." content="Space" />
Key observation: The bug correlates with node ID format. Direct instances (plain numeric IDs like 3637:42990) are affected. Instance overrides (IDs prefixed with I, like I3637:44334;3637:42928) read correctly.
Verified in the Figma UI: Selecting node 3637:42990 in the Figma desktop app confirms Content = Space in the properties panel. The MCP output is wrong.
Reproducibility:
- Confirmed with both the remote Figma MCP server (via Figma power/plugin) and the local Figma MCP server (connected to Figma desktop app). Both produce identical incorrect output, indicating the bug is in the shared API/code generation layer, not in a specific MCP server implementation.
Impact:
- Silently generates incorrect code — no error or warning is emitted
- Particularly dangerous for repeated patterns (tables, lists) where the first item renders differently from the rest
- Developers trusting the MCP output will ship UI bugs without realizing the Figma design was read incorrectly
Workaround: When a component function has variant props with defaults and some call sites omit the prop while others pass an explicit value, cross-reference with get_screenshot or the Figma UI to verify. If most instances pass the same value but one doesn't, assume the outlier is a bug in the MCP output.
Possibly related:
