mirror of
https://github.com/penpot/penpot.git
synced 2026-11-18 16:12:24 +00:00
* 🐛 Check Host and Origin headers in the MCP server The MCP endpoint, the REPL server and the plugin WebSocket accepted requests with any Host and Origin header, so a web page open in the user's browser could drive a local MCP server: connect as the plugin and call its tools. RequestGuard checks both headers against an allowlist and rejects other requests with HTTP 403, or WebSocket close code 1008. The list comes from PENPOT_MCP_ALLOWED_HOSTS, where "*" turns the check off. When it is unset, local mode allows only loopback names and remote mode allows any host, since remote mode relies on user tokens and has no file access. AI-assisted-by: claude-opus-5-5 * 🐛 Keep the Host and Origin check on in single-user remote mode The default allowlist followed remote mode, so a single-user server with PENPOT_MCP_REMOTE_MODE=true accepted any Host and Origin. It requires no user token either, so a web page could still drive it and run code in the user's Penpot session. The default now follows multi-user mode: single-user servers allow only loopback names, and multi-user servers, which rely on user tokens, allow any host. Startup warns when the check is off in single-user mode. PENPOT_MCP_ALLOWED_HOSTS entries with a scheme, port or path never matched, so every request failed with 403. The server now refuses to start and names the bad entry. AI-assisted-by: claude-opus-5-5
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.