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 Plugin
This project contains a Penpot plugin that accompanies the Penpot MCP server. It connects to the MCP server via WebSocket, subsequently allowing the MCP server to execute tasks in Penpot using the Plugin API.
Setup
-
Install Dependencies
pnpm install -
Build the Project
pnpm run build -
Start a Local Development Server
pnpm run startThis will start a local development server at
http://localhost:4400.