Pablo Alba 73e7815817
🐛 Make execute_code wait for save before success (#13027)
* 🐛 Make execute_code wait for save before success

* 🐛 Address review feedback on waitForSave

Reject with an Error carrying a `code`: save-timeout, rolled-back,
save-retrying, or the failure code (save-failed by default). Lower the
default timeout from 90s to 60s, leaving room for the 30s layout wait
and the code under the MCP tool timeout.

When persistence is already in error at the start of the wait, keep the
stored failure code, and tell a failure Penpot keeps retrying apart from
one that needs the file reopened.

Share timeout validation with waitForLayoutUpdate through
app.plugins.utils, and make reject-not-valid reject with an Error, which
also fixes the string rejections of connectLibrary, restore, remove,
pin, export, findVersions and saveVersion.

The MCP execute_code handler now waits for the save only when the
workspace is ready, like the layout wait, so dashboard calls no longer
fail on a save error from an earlier file.

Move the waitForSave tests to frontend-tests.plugins, add tests for the
error codes, the retrying state and a failure during the wait, and add
plugin API suite and MCP handler tests. Update the docs, CHANGELOG and
the generated API files.

AI-assisted-by: claude-opus-5-5
2026-11-17 22:35:37 +01:00
..
2026-04-20 19:37:02 +02:00
2026-02-04 12:22:36 +01:00
2026-06-30 16:15:30 +02:00

Penpot MCP Server

A Model Context Protocol (MCP) server that provides Penpot integration capabilities for AI clients supporting the model context protocol (MCP).

Setup

  1. Install Dependencies

     pnpm install
    
  2. Build the Project

     pnpm run build
    
  3. 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.