mirror of
https://github.com/penpot/penpot.git
synced 2026-11-12 13:00:37 +00:00
* 🐛 Fix plugin component lookups for missing and deleted components Shape.component() threw "Assert failed: (uuid? id)" on a copy whose library is not available, because the head lookup returns a pair with a nil component and the proxy was built anyway. It now returns null. Shape.componentRoot() built its proxy with the component's file and main page, so a copy on another page or file than its main got a shape that pointed at nothing, and a copy of a missing library threw. It now resolves the root on the shape's own file and page, like componentHead(). LibraryComponent.mainInstance() returned a proxy for the root kept in a deleted component's objects, which is on no page, so every field read empty and parent threw. It now returns null for a deleted component. * 📚 Fix the variant example in the MCP instructions The createVariantContainer example called penpot.currentPage.findAllShapes and Shape.isMainComponent, which do not exist, so running it as written failed. Use penpotUtils.findShapes with isComponentMainInstance instead.
Penpot MCP Server
A Model Context Protocol (MCP) server that provides Penpot integration capabilities for AI clients supporting the model context protocol (MCP).
Setup
-
Install Dependencies
pnpm install -
Build the Project
pnpm run build -
Run the Server
pnpm run start
Penpot Plugin API REPL
The MCP server includes a REPL interface for testing Penpot Plugin API calls. To use it, connect to the URL reported at startup.