Provides full programmatic access to self-hosted Penpot instances, allowing for the creation and modification of UI components, management of design systems, and export of frames as SVG or PNG.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Penpot MCP ServerExport the 'Login Screen' frame from my Dashboard project as an SVG"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Penpot MCP Server
AI-powered design tool access for self-hosted Penpot via Model Context Protocol.
What is this?
An MCP server that gives AI agents (like Claude Code, Cursor, or any MCP-compatible client) full programmatic access to your self-hosted Penpot instance. AI can read, create, modify, and export design elements — from rectangles and text to full UI components — all through natural language.
Think of it as the bridge between your AI assistant and your design tool.
Problems it solves
Problem | Solution |
Manual design work | AI creates UI components, layouts, and prototypes directly in Penpot |
No programmatic API for Penpot | 66 tools covering projects, shapes, text, exports, comments, and more |
Design-to-code gap | Generate CSS from any shape, export to SVG/PNG, extract design tokens |
Repetitive tasks | Batch operations — rename shapes, update colors, create variants |
Design system maintenance | Read/write components, colors, typographies programmatically |
Architecture
Dual-access strategy:
Reads go directly to PostgreSQL via
asyncpg— fast and reliableWrites go through Penpot's RPC API via
httpx— ensures proper change tracking and undo historyExports use Penpot's built-in exporter (headless Chromium) for pixel-perfect SVG/PNG output
Tech Stack
Component | Technology | Purpose |
Language | Python 3.13 | Runtime |
MCP SDK | Protocol handling, tool registration | |
Database | Direct PostgreSQL access | |
HTTP Client | Penpot RPC API calls | |
Validation | Automatic parameter validation | |
Package Manager | Fast Python dependency management | |
Container | Docker | Deployment alongside Penpot |
Quick Start
Prerequisites
Self-hosted Penpot running via Docker Compose (official guide)
Docker and Docker Compose v2 installed
Access tokens enabled in your Penpot instance (see Enable Access Tokens)
Option A: Automated Setup
The script will guide you through configuration, build the Docker image, and start the server.
Option B: Manual Setup
1. Clone the repository
2. Create your configuration
Edit .env with your Penpot details:
3. Add the MCP service to your Penpot Docker stack
Add the penpot-mcp service definition to your existing Penpot docker-compose.yml. See docker-compose.penpot.yml for the complete service definition to copy.
4. Build and start
5. Verify it's running
You should see a JSON response with the server capabilities.
Connect to Claude Code
Add this to your project's .mcp.json file (or ~/.claude.json for global access):
Restart Claude Code. You should see 66 tools from the penpot server listed when you run /mcp.
Example prompts
Once connected, you can ask Claude things like:
"List my Penpot projects"
"Create a login form with email/password fields and a submit button"
"Export the Login Card frame as SVG"
"What colors are defined in the design system?"
"Add a comment at position (100, 200) saying 'Review this layout'"
Tools Overview
The server provides 66 tools across 11 categories. See TOOLS.md for the complete reference with all parameters.
Category | Count | Examples |
Projects & Teams | 4 |
|
File Operations | 9 |
|
Shape Reading | 6 |
|
Components & Tokens | 4 |
|
Comments | 6 |
|
Media & Fonts | 3 |
|
Database & Advanced | 3 |
|
Snapshots | 2 |
|
Export | 2 |
|
Shape Creation | 8 |
|
Shape Modification | 12 |
|
Text Operations | 5 |
|
Advanced Analysis | 2 |
|
Configuration Reference
All settings are via environment variables. See .env.example for a template.
Variable | Default | Description |
|
| Internal Penpot URL (Docker network) |
|
| Public URL where you access Penpot in browser |
| — | API access token (preferred auth method) |
| — | Penpot login email (fallback auth) |
| — | Penpot login password (fallback auth) |
|
| PostgreSQL host |
|
| PostgreSQL port |
|
| Database name |
|
| Database user |
| — | Database password |
|
| MCP server bind address |
|
| MCP server port |
|
| Log level (debug/info/warning/error) |
Enable Access Tokens
Penpot requires a feature flag to enable API access tokens.
1. Update your Penpot .env file
Add enable-access-tokens to your PENPOT_FLAGS:
2. Restart Penpot
3. Create a token
Open Penpot in your browser
Click your avatar (bottom-left) → Access Tokens
Click "Generate new token"
Give it a name (e.g., "MCP Server")
Copy the token and paste it into your
.envasPENPOT_ACCESS_TOKEN
Penpot Docker Integration
The MCP server runs as a Docker container alongside your existing Penpot stack. You need to add it to your Penpot docker-compose.yml.
See docker-compose.penpot.yml for the exact service definition to add. The key points:
It connects to the
penpotDocker network (same as other Penpot services)It depends on
penpot-postgres(with health check) andpenpot-backendIt exposes port
8787on localhost only (127.0.0.1:8787:8787)Environment variables reference Docker internal hostnames
Development
Running locally (outside Docker)
For local development, point PENPOT_DB_HOST and PENPOT_DB_PORT to your host-mapped PostgreSQL port, and PENPOT_BASE_URL to http://localhost:9001.
Running tests
Project structure
License
This project is licensed under the Apache License 2.0.
Acknowledgments
Penpot — The open-source design platform
Model Context Protocol — The protocol standard
FastMCP — Python MCP SDK