Skip to main content
Question

get_code method on MCP server does not return expected results for Android (Jetpack Compose)

  • July 23, 2025
  • 8 replies
  • 312 views

Yehor Korniienko

I’m sending a get_code request to the Figma MCP server via Cursor AI.
Here is the request body I’m using:

{ "nodeId": "XXXX:XXXX", "clientLanguages": "kotlin", "clientFrameworks": "android,compose", "clientName": "cursor" }

However, the response I receive is in JSX (JavaScript XML) format with Tailwind CSS classes, not Kotlin.
I would expect either Kotlin code (Jetpack Compose) or at least a clean JSON representation of the selected frame.

Question:
How can I retrieve Kotlin code or a raw JSON object for the selected frame?

8 replies

alongmao12
  • New Member
  • 1 reply
  • July 25, 2025

same issue for swiftui


Ihor Rudenko
  • New Member
  • 1 reply
  • July 31, 2025

the same issue


Phaioka-san
  • New Member
  • 1 reply
  • August 8, 2025

the same issue


djv
Figmate
  • Community Support
  • 5227 replies
  • August 21, 2025

Hi All, thanks for reaching out!

I passed this onto our MCP team, and they confirmed that if the component is code connected, it should return a snippet of the given language. 


Adam_Butterfield

My team also hit this same issue. We have it with common components that are used in both web and app designs. Sending requests to `get_design_context` (formerly called `get_code`) always returns the last published code, even when using `clientLanguages` and `clientFrameworks` to specify what we want returned.


djv
Figmate
  • Community Support
  • 5227 replies
  • October 23, 2025

Hi ​@Adam_Butterfield, thanks for chiming in here! 

Can you please confirm that you’ve applied Code Connect to your components to link your Figma libraries to the corresponding code components in your codebase?

If your components are code connected, we can send this over to our MCP team to investigate further. 


Adam_Butterfield

Hi ​@djv !
Yes I can confirm the connection is set up correctly. In the Figma UI we can see the code examples for web and apps. 

After experimenting a bit more, it appears that the MCP always returns the last published code snippet.

How I tested:

  • Called get_design_context, got React code returned no matter what we specify for `clientLanguages` and `clientFrameworks` (React was the last one published)
  • Unpublished React connection
  • Called get_design_context, got Compose code returned no matter what we specify for `clientLanguages` and `clientFrameworks` (it was the one published before React, and we also have iOS connected)
  • Published React connection
  • Called get_design_context, got React code returned again no matter what we specify for `clientLanguages` and `clientFrameworks

djv
Figmate
  • Community Support
  • 5227 replies
  • October 31, 2025

Hi ​@Adam_Butterfield, thanks for the additional context and so sorry for the delayed reply! 

I was out of the office when you originally replied, but I’ll pass this onto the team right now to help with their investigation. 

We appreciate your patience and understanding.