Step-by-step: connect an AI agent to open-source Penpot with MCP, give feedback as design comments, build tokens and ship a redesign that isn't AI slop.
Kamlesh PaulLead Software Developer12 min read
If you ask an AI to "make my website look modern", you get the same thing everybody gets: a purple gradient, glass cards and a "Build the future" hero. That's AI slop. The AI isn't bad at design. It just has no context, and you have no way to point at what you mean.
In this tutorial you'll set up a workflow that fixes both problems. Your AI agent works directly on a real design file in Penpot, the open-source design tool, and you give feedback the way you would to a human designer: by leaving comments on the canvas.
I used exactly these steps to redesign this blog: home page, eight inner pages, design tokens, dark mode and the final code. You'll see my real results along the way.

By the end you'll have:
you AI agent Penpot file
│ leave comments on canvas ────────────────────────────▶ │
│ "fix the comments" ──────▶ reads comments + shapes ◀── │
│ edits a copy of the board ─▶│
│ review the copy ◀───────── exports a screenshot │
│ more comments ... │
│ "build it" ──────────────▶ maps tokens → CSS, writes codeThe AI never designs in a vacuum. It always works on your file, with your content, and you steer it with comments.
https://design.penpot.app/mcp/stream?userToken=YOUR_MCP_KEY--scope user keeps the key in your user config, not in your project repo:claude mcp add --scope user --transport http penpot "https://design.penpot.app/mcp/stream?userToken=YOUR_MCP_KEY"The MCP plugin runs inside your Penpot browser tab and only works on the page that's open. Keep that tab open while the AI works.
Treat the key like a password. Anyone with it can reach your files while MCP is on. If it ever leaks, regenerate it on the same screen. That revokes the old key straight away.
This is the step that prevents slop. The AI needs your design and your content to work from, not a blank canvas.
Create a Penpot file with one board per screen size, for example:
Home / Desktop 1440 (1440px wide)Home / Mobile 390 (390px wide)Use your real headline, real photo, real article titles and real images. If rebuilding it by hand is too slow, ask the agent to do it from your live page or your code:
Recreate my current home page in this Penpot file as a 1440px desktop board.
Use my real text and images from <your site or repo>. Use flex layouts and
name every layer properly. Don't redesign anything yet.
My experience: Everything that came later kept my "Lead Software Developer" title, my real articles and my real topics, because they were already on the canvas. When I skipped this step and asked from chat only, I rejected seven mockups in a row.
Before any changes, make sure the connection works:
Check my open Penpot file. List the pages and boards, and describe each section you see.You should get back your pages, boards and sections (header, hero, posts, footer). If you get an error about the plugin tab, click the Penpot tab to wake it up and try again.
My experience: The agent also pointed out two things I hadn't asked about: a faint gray box behind the card text, and a footer wider than the content column. Small details like that are a good sign it's reading the real file.
This is the core of the workflow. Don't describe changes in chat.
I added comments in Penpot. Read all of them and fix each one on a copy of
the board, so I can compare. Keep my real content. Show me a screenshot when done.Each comment has a position on the canvas, so the AI can find the exact shape under the pin. Under the hood, reading every comment looks like this in Penpot's plugin API:
for (const meta of penpotUtils.getPages()) {
const page = penpotUtils.getPageById(meta.id)
const threads = await page.findCommentThreads({ onlyYours: false, showResolved: false })
for (const t of threads) {
const comments = await t.findComments()
console.log(meta.name, t.seqNumber, t.position, comments.map((c) => c.content))
}
}Tips for good comments
My experience: These are my real first four comments, typos included:
- "these icons no looking in correct positions" → four mismatched 16px icons became matching 36px buttons, aligned with the CTAs
- "can we make image bigger and more appealing" → avatar 112px → 168px, with a ring and a soft glow
- "change this posts layout" → stacked rows became a large featured post plus a 2-column grid

Picking is much easier than describing taste. Ask for several different layouts, not one design in several colors:
Design 4 completely different home page variants from scratch, next to my board.
Rules: use my real content and images, use a consistent icon set, no purple
gradients, no glassmorphism, no stock phrases. Each variant must have a
different layout, not just different colors.The "rules" part matters. Without it, you'll often get one layout repainted four times.
My experience: My first variant request came back as four recolors of the same page, so I stopped it and asked for a "complete revamp, fresh look, use icons". The second round gave four real layouts (the image at the top of this article). I picked the first one and asked the AI to delete the rest.
Once you've picked a direction, turn it into a design system. This is what makes every later change cheap:
Keep only this variant. Create design tokens for it: a core set (colors,
spacing, radius, font sizes and weights, typography styles), plus light and
dark semantic color sets with Light/Dark themes. Link every shape on the board
to the tokens. Then create the matching mobile board (390px) using the same tokens.What you should get:
color.bg, color.surface, color.text, color.primary and color.border, defined once for light and once for darkMy experience: I ended up with 85 core tokens, 21 semantic colors for each theme, 9 typography styles, 24 library colors and 10 components (buttons, badges, cards, search, footer). Every fill, stroke, corner radius and text style on both boards was linked to a token.
With tokens in place, brand changes are one prompt. Start with color options:
Make 4 color variants of this board next to it so I can compare. Keep the layout.
When you've picked one, have the AI change the tokens, not the shapes:
Use the green version. Update the tokens (not individual shapes) so the
desktop and mobile boards both change. Also reduce the corner radius.My experience: One prompt changed both boards. Buttons went from 12–14px corners to 8px, cards from 16–18px to 10px, the featured card from 24px to 12px and the photo from 36px to 16px. I only had to say "reduce radius".
Do a second comment round. Two things are easy to miss:
For animation comments, make the element a component and write the animation
spec in its component note (timing, easing, delays, reduced-motion behavior),
so I can build it in CSS later.My experience: My second round had five comments. Two were "add animation on this" on the floating badges. The AI wrote this spec into the component notes, and it became the CSS almost word for word:
translateY 0 → -8px → 0, 4s ease-in-out, infinite. Fade and slide in on load. Second badge out of phase by 2s. Disabled under prefers-reduced-motion.
Another comment was "this follow is not looking good in dark mode". The real cause was the dark
placeholdertoken being too close to the background, so fixing that one token fixed every shape using it.

Now use the home page as the reference for everything else:
Design the other pages to match the home page: <list your pages>. Reuse the
header, footer component, card styles and tokens. Use my real copy from the
existing pages. Build one page at a time and show me a screenshot of each."One page at a time" is important, because long requests can time out. Leave comments on these pages too, and repeat Step 4 until you're happy.
My experience: This gave me eight boards: Articles, Article, Topics, a single topic, Tags, About, Contact and 404. The AI pulled the real text from my existing pages, so nothing was lorem ipsum.

Because the design has tokens, the handoff is a mapping, not a guess:
Implement this design in my codebase. Map the Penpot tokens to my CSS
variables first (light and dark), then build each page. Check every page in a
real browser at desktop and mobile width, in light and dark mode.The token mapping ends up looking like this:
:root {
--background: #f6faf8; /* color.bg → emerald.25 */
--primary: #059669; /* color.primary → emerald.600 */
--accent: #ecfdf5; /* color.primarySoft */
--radius: 0.5rem; /* radius.lg = 8px */
}
.dark {
--background: #0b1120; /* navy.950 */
--primary: #34d399; /* emerald.400 */
}My experience: Checking in a real browser caught three things the design didn't show: a topic card overflowing on mobile, a "#" heading anchor that had always been visible, and stray backticks around inline code.
All the prompts from this tutorial in one place:
# Check the connection
Check my open Penpot file. List the pages and boards, and describe each section you see.
# Fix feedback
I added comments in Penpot. Read all of them and fix each one on a copy of
the board, so I can compare. Keep my real content. Show me a screenshot when done.
# Variants
Design 4 completely different variants from scratch. Use my real content and a
consistent icon set. No purple gradients, no glassmorphism. Different layouts,
not different colors.
# Tokens
Create core, light and dark design tokens with Light/Dark themes, and link
every shape to them. Then create the 390px mobile board with the same tokens.
# Brand change
Update the tokens (not individual shapes) to <your change>.
# More pages
Design <page> to match the home page. Reuse the header, footer, cards and tokens.
# Code
Map the Penpot tokens to my CSS variables, build each page, and check them in a
real browser at desktop and mobile width, in light and dark mode.| Problem | Fix |
|---|---|
| The agent says the Penpot plugin tab looks suspended | Click the Penpot tab to wake it and retry. If MCP disconnected, use File → MCP Server → Connect again. |
| Long requests time out | Ask for one page or one board at a time. |
| Switching Light/Dark in Penpot drops every token link on a board | Switch back to Light before asking the AI to fix anything, and ask it to re-link tokens if shapes stop updating. |
| You changed a token's value but shapes didn't update | Ask the AI to apply the token to the linked shapes again. |
| A request is blocked by Penpot's firewall | Shell one-liners such as downloading a script and piping it into a shell can trigger it. Use harmless sample code in mockups. |
| The headline wraps after linking typography tokens | The token can switch your font to Google's Inter, which runs slightly wider. Check headlines after linking type tokens. |
| Color previews don't follow token changes | Recolored copies lose their token links. Only use them to choose, then change the real tokens. |
The trick isn't a better prompt. It's giving the AI your real design to work on and a way for you to point. Penpot comments do the pointing, MCP gives the AI hands on the file, and tokens make every later change one prompt instead of an afternoon.
Start small: put one page in Penpot, leave three comments and ask the AI to fix them. Once you've seen it work, do the variants, then the tokens, then the code.