mirror of
https://github.com/penpot/penpot.git
synced 2026-11-19 16:40:38 +00:00
Plugins and the MCP could not learn which Penpot instance they run on, so agents guessed the domain when they wrote links to files. Add penpot.location with the instance base URL (baseUrl), the URL of the current screen (href) and its query params (params). It works in the dashboard and the workspace and requires content:read. Params that carry secrets (share-id, the MCP authorize params, and any key ending in token, secret or password) are left out, and href is rebuilt from the remaining params so it never carries one. The MCP instructions tell agents to use href instead of building links. The plugin API test suite checks location against the open file, and its API surface is regenerated from the current types. Closes #13013 AI-assisted-by: claude-opus-5-5
Penpot plugin-types
The @penpot/plugin-types package provides TypeScript type definitions for the Penpot Plugin API, making it easier to develop plugins for the Penpot design platform with full type safety and IDE support. It streamlines the development process by ensuring that your code is well-typed and less prone to errors.
Getting started
Installation
To add penpot's plugin-types to your project, use the following command:
npm install @penpot/plugin-types
Configuration
To ensure the typings work correctly in your project, update your tsconfig.json as follows:
"typeRoots": [
"./node_modules/@types",
"./node_modules/@penpot"
],
"types": ["plugin-types"],
Learn more
For more information on how to build plugins using the Penpot PLugin API, refer to the official documentation. You can also explore practical examples in the samples repository to see real-world implementations.