mirror of
https://github.com/penpot/penpot-mcp.git
synced 2026-04-25 11:18:37 +00:00
WebSocket Connection Setup
This document explains how to test the basic WebSocket connection between the MCP server and the Penpot plugin.
Architecture Overview
The system consists of two main components:
-
MCP Server (
mcp-server/):- Runs as an MCP server (stdio transport)
- Runs a WebSocket server on port 8080
- Basic WebSocket connection handling (protocol to be defined later)
-
Penpot Plugin (
penpot-plugin/):- Contains a "Connect to MCP server" button in the UI
- Establishes WebSocket connection to
ws://localhost:8080 - Basic connection status feedback
Testing the Connection
Step 1: Start the MCP Server
cd mcp-server
npm run build
npm start
The server will output:
Penpot MCP Server started successfully
WebSocket server is listening on ws://localhost:8080
Step 2: Build and Run the Plugin
cd penpot-plugin
npm run build
npm run dev
Step 3: Load Plugin in Penpot
- Open Penpot in your browser
- Navigate to a design file
- Go to Plugins menu
- Load the plugin using the development URL (typically
http://localhost:4400/manifest.json)
Step 4: Test the Connection
- In the plugin UI, click "Connect to MCP server"
- The connection status should change from "Not connected" to "Connected to MCP server"
- Check the browser's developer console for WebSocket connection logs
- Check the MCP server terminal for WebSocket connection messages
Languages
TypeScript
72.8%
HTML
17.3%
Python
8%
JavaScript
1.8%