Design to Code: Paper + Claude Code via MCP¶
| Category | AI Agents & MCP |
| Status | ๐ก Partially completed |
| Repo | nextwork-design-to-code-paper-plus-claude-code-via-mcp |
| Original NextWork guide | nextwork.ai |
Learning project
Practice work following a NextWork guide, separate from my production projects.
๐ NextWork learning project. This is a practice project I built while working through NextWork's Design to Code: Paper + Claude Code via MCP guide. It is part of my Learning portfolio and is fully separate from my production projects.
Category: Learning โบ AI Agents & MCP
Status: ๐ก Partially completed
Overview¶
The idea is that a design and its code can talk to each other through a tool connection. I wrote the other end of that connection (a canvas that Claude Code can read, write and look at), then let Claude Code do the design, the research, the code generation and the critique.
Summary¶
Claude Code designed and coded a dashboard over MCP, using a small design canvas server I wrote in place of the Paper desktop app. The canvas server speaks MCP over stdio and has tools to read the canvas, add, update and remove elements, and take a screenshot. In four headless Claude Code sessions: it built an 'AI Trends Dashboard' layout with 64 element calls and checked it by screenshot; it researched current AI trend figures on the web (search plus 11 page fetches, with a source on the canvas for each number) and wrote them onto the canvas; it generated a Vite, React and Tailwind project from the canvas, which builds cleanly; and, as a senior-designer red pen, it listed 8 problems and fixed 4 of them directly on the canvas (including a layout overflow that clipped the fourth card). Partial: the design surface is my own canvas server rather than Paper, and I haven't independently re-checked the web figures Claude cited.
The checks behind this are in docs/verification.txt.
Skills & tools¶
MCP (stdio JSON-RPC), Claude Code, React, Tailwind CSS, Vite, Design review
What I built¶
canvas_mcp.py: my MCP server. Elements live incanvas.jsonand render to HTML; tools arecanvas_get,canvas_add,canvas_update,canvas_remove,canvas_titleandcanvas_screenshot(returns an image). It refuses duplicate ids, unknown parents and unsafe tags.test_canvas_mcp.pydrives it over stdio.mcp.example.json: how Claude Code is pointed at it.prompts/: my four prompts (layout, populate with researched data, generate the React project, red-pen review).docs/session-log.mdshows every tool call and reply.snapshots/anddocs/canvas-*.png: the canvas after each stage (layout, populated, after the red pen).REVIEW.mdis Claude's critique with the element ids it changed.app/: the React + Tailwind project Claude Code generated (data insrc/data.js).
How to run¶
python3 test_canvas_mcp.py
cd app && npm ci && npm run build
# claude --mcp-config mcp.example.json (edit the paths first)
Verification¶
I ran the verification command on 2026-12-03. The full output is in docs/verification.txt.
/workspace/nextwork-portfolio/.venv/bin/python test_canvas_mcp.py | grep -q 'CANVAS MCP OK' && (cd app && npm ci --silent > /dev/null 2>&1 && npm run build 2>&1 | tail -2 | grep -q built) && echo DESIGN OK
Notes¶
The generated app uses the canvas's pixel bar heights, so bars aren't proportional to their values; Claude flagged this and kept the design as drawn. The red pen left four problems unfixed because they need a content decision from me (mixed units in the Change column, one scale for different measures, a wrapping label, tight bar labels).
What isn't done, and why¶
No Paper desktop app or Paper's MCP server: the design surface is my own small canvas server, so it isn't a real design tool. The dashboard figures were researched by Claude Code from web pages it opened; I haven't re-verified them.
Original project: https://nextwork.ai/projects/c824d8fa-c5fe-58d7-96b0-6b955d6274e2 ยท Part of my NextWork Learning portfolio (hub).
Verification output¶
From docs/verification.txt:
$ /workspace/nextwork-portfolio/.venv/bin/python test_canvas_mcp.py | grep -q 'CANVAS MCP OK' && (cd app && npm ci --silent > /dev/null 2>&1 && npm run build 2>&1 | tail -2 | grep -q built) && echo DESIGN OK
DESIGN OK
[exit code 0]