Skip to content

feat: add get_screen_code MCP tool and hasCode flag#37

Merged
trmquang93 merged 3 commits intomainfrom
feat/mcp-expose-screen-source
Apr 17, 2026
Merged

feat: add get_screen_code MCP tool and hasCode flag#37
trmquang93 merged 3 commits intomainfrom
feat/mcp-expose-screen-source

Conversation

@trmquang93
Copy link
Copy Markdown
Collaborator

Summary

  • Add get_screen_code MCP tool that returns a screen's stored sourceHtml (plus figmaSource metadata) without dragging along the full screen payload.
  • Add hasCode flag to list_screens summaries so agents can discover which screens are round-trippable through get_screen_code → edit → update_screen_image.
  • Purely additive: no changes to state shape, no changes to existing tool responses.

Test plan

  • npm run lint passes
  • npm run build in mcp-server/ succeeds
  • Verified against real flow (sumary-ai-flow.drawd, 42 screens): list_screens reports hasCode correctly (20 true / 22 false); get_screen_code returns sourceHtml for code-backed screens and hasCode:false, sourceHtml:null for image-only screens; get_screen still returns sourceHtml (no regression); missing screenId throws Screen not found.

trmquang93 and others added 3 commits April 17, 2026 06:28
Expose the stored source HTML of code-generated screens through a
dedicated MCP tool, and surface a hasCode indicator in list_screens so
agents can discover which screens are round-trippable without pulling
the full screen payload.
Inline the one-use hasCode local and drop redundant `|| null` fallbacks
on sourceHtml/figmaSource (both fields are initialized to null, so the
coalesce never fires).
@trmquang93 trmquang93 merged commit 38ae0b8 into main Apr 17, 2026
1 check passed
@trmquang93 trmquang93 deleted the feat/mcp-expose-screen-source branch April 17, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant