Carton
Imports local Next.js components or routes into editable Carton artboards by deriving App Router/Pages Router routes from filenames and serving a temporary copy.
Imports local React components into editable Carton artboards via import_component, rendering them through the project's Vite setup.
Loads a matching story from a local storybook-static build or sibling .stories module to import component variants into editable artboards.
Uses a local Vite project configuration and CSS imports to render React components for import into editable Carton artboards.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.

Carton is a local Linux design tool built around real HTML, CSS, and SVG layers. You can open it as a desktop app to arrange artboards, edit styles, manage CSS tokens, and pin comments, while agents like Claude Code or Codex read and write the exact same workspace over MCP.
Everything lives in a local SQLite database on your machine. You do not need a cloud account or a hosted backend, and carton mcp still works headlessly when the editor window is closed.
Paper and Paper MCP compatibility
Carton implements the 41 tool names and input schemas from Paper MCP (src/catalog.json), so existing prompts, skills, and agent workflows written for Paper work locally out of the box. On top of that base surface, Carton adds 6 tools for workflows that usually take too many round trips:
Capability | Details |
Compatible MCP tools (41) | Files, folders, pages, artboards, HTML/CSS writing, style updates, text edits, tokens, comments, JSX export, screenshots, PNG/PDF export |
Batch manifests ( | Build and update multiple boards from HTML templates, shared CSS, data, and locale/state/viewport matrices, with Chromium layout linting and cached exports |
Live web import ( | Capture a running local or remote route across multiple viewports and interactive states into editable layers |
Component import ( | Render local React/Vite, Storybook, or Next.js components directly into editable artboards |
Active tab capture ( | Pull an open page or selector from an agent-controlled Chromium DevTools port, CLI, or Playwright script |
Vector & asset helpers | Update individual SVG attributes by node ID ( |
Related MCP server: figsnap-mcp
Quick start
Requirements
Carton targets Linux and needs:
Node.js 22.13 or newer and npm
System Chromium or Google Chrome (used for rendering, linting, and imports)
Fontconfig and FFmpeg
Poppler (
pdftotext) if you run the PDF export testsOptional: system Electron (falls back to a dedicated Chromium
--appwindow if Electron is absent)
Install and run from source
git clone https://github.com/fbal98/carton.git
cd carton
npm ci
npm test
npm startInstall the user-local carton CLI shim (~/.local/bin/carton) and Linux .desktop entry:
npm run install:desktopRun npm run install:desktop again if you move the checkout. You can override executable paths with CARTON_ELECTRON or CARTON_CHROMIUM when needed.
If you prefer running Carton in a regular browser tab or exposing its Streamable HTTP MCP endpoint over loopback:
node bin/carton.js serveThis prints the local editor URL (with the session bearer token in the URL fragment) and the /mcp HTTP endpoint. Set CARTON_PORT to pin a fixed port.
Connect an MCP client
Open Carton and click Connect MCP in the top bar to copy a ready-to-paste stdio configuration. With ~/.local/bin on your PATH, any MCP client can connect using:
{
"mcpServers": {
"carton": {
"command": "carton",
"args": ["mcp"]
}
}
}For Claude Code or Codex CLI:
# Claude Code
claude mcp add carton -- carton mcp
# Codex CLI
codex mcp add carton -- carton mcpThis repository also includes a checked-in .codex/config.toml that connects carton mcp and enables the main design, import, sync, and vector tools.
When the editor is open, carton mcp relays calls to it so changes appear live on the canvas. When no editor is running, carton mcp operates directly on the SQLite workspace database, and the editor picks up the changes the next time it opens. Set CARTON_HEADLESS=0 if you want calls to require a running editor window.
Try the included example
The repo ships a synthetic two-board example under examples/pricing/ (styles.css, billing.html, and mobile-card.html).
Once your MCP client is connected, ask your agent:
Call
get_basic_info, then runsync_boardson/absolute/path/to/carton/examples/pricing/boards.jsonand open the result in Carton.
Carton will resolve the shared stylesheet and CSS custom properties, create the Billing · Desktop and Billing · Mobile artboards, run Chromium layout and contrast checks on both viewports, and export PNGs plus a combined PDF.
Workflows
Design a UI with an agent
Start a session with an agent connected to Carton and ask for a screen, for example: "Create a settings screen on the current canvas, draw an editable SVG icon for each section, and show me the result."
create_artboardacceptshtmldirectly so a screen can be built in one call, orhtmlPathfor larger markup on disk.write_htmlandcreate_artboardaccept<style>blocks,classattributes, and shared stylesheets (cssorcssPath). Carton resolves specificity,!important, and@mediaat the board's width and stores inline styles so the canvas, exports, andget_jsxmatch.:rootcustom properties are copied where used. Pseudo-classes such as:hover, pseudo-elements, and@keyframesare reported inwarnings.dirandlangattributes are preserved on layers and inget_jsx.Local images work via
src="file:///abs/path.png"orinsert_image, keeping raw image bytes out of the model context.update_vector_attributesedits SVG shapes in place without replacing their layer ID (for example{"stroke":"#237960","d":"M2 12L8 18L22 3"}).get_screenshotcaps inline images near 1.15 megapixels for vision models. Passoutput: "file"for full-scale PNGs orregionto crop a specific area.Call
finish_working_on_nodeswhen done to clear the editing indicator on the canvas.
Sync boards from a manifest
sync_boards builds or updates an entire page from a JSON manifest listing shared stylesheets, HTML templates, and board definitions. Templates support {{data}}, {{#lists}}, and {{> partials}}. Board variants can expand over locales, states, and viewports, such as "expand": {"locale": ["en", "ar"], "state": ["full", "empty"]}, and Arabic or other RTL locales automatically set dir="rtl".
{
"css": ["styles.css"],
"boards": [
{ "name": "Welcome", "width": 390, "height": 844, "template": "screen.html" }
]
}Only boards whose source changed are rewritten. Unchanged chains of
layer-nameattributes keep their layer IDs so comment threads stay pinned (a thread on a removed layer moves to the nearest kept ancestor).Boards edited manually on the canvas since their last sync are reported as
conflictand skipped unlessonConflictisoverwriteorfork. One undo reverts a full sync.Changed boards are linted in Chromium at their own viewport for clipped or overflowing text, layers extending past the board edge, overlapping text, WCAG contrast, and RTL issues. Full findings go to
lint.json, and inline crops cover only flagged regions.Exports write one PNG per board (3x up to 600px wide, otherwise 2x) and one combined PDF, cached by board content.
Import a component from source
Call import_component with an absolute componentPath, or with projectDir plus a relative path. The source project must live on the same machine with its dependencies installed.
{
"projectDir": "/work/shop",
"componentPath": "src/components/PricingCard.tsx",
"props": { "plan": "Pro" },
"viewports": [{ "width": 1440, "height": 900 }, { "width": 390, "height": 844 }]
}React and Vite: uses the project's Vite config and CSS imports. Pass
exportName,wrapperPath(a default-exported provider), orstylesfor isolated mounts.Storybook: loads a matching story from a local
storybook-staticbuild or a sibling.storiesmodule, withstoryselecting a variant.Next.js: derives App Router or Pages Router routes from filenames and serves them in a temporary copy. Pass
routefor dynamic paths (such as/products/42) and a CSSselectorto isolate one component inside a page layout.
Import a running web app
Call import_url with any URL to capture a 1440x900 viewport into the active page, or pass selector, readySelector, viewports, and multi-state states with browser steps (click, fill, press, select, check, hover, waitFor, wait, goto, scroll, evaluate). You can also pass Playwright storageState, cookies, headers, locale, timezoneId, and colorScheme.
{
"url": "http://localhost:3000/menu",
"name": "Menu",
"storageState": "/work/shop/.auth/guest.json",
"viewports": [{ "width": 390, "height": 844 }],
"states": [
{ "name": "Browsing" },
{
"name": "Cart open",
"steps": [
{ "action": "click", "selector": "text=Add to cart" },
{ "action": "click", "selector": "role=button[name=\"Cart\"]" }
]
}
]
}You can also trigger this from the desktop UI via Import URL. Carton embeds available images and web fonts, converts form values to static layers, falls back to image layers for <canvas>, <video>, <iframe>, or unsupported SVG features, and reports the sampled pixel difference between the source page and the imported artboard. One undo removes the entire import.
Capture from an open browser or Playwright
When an agent already controls Chromium on a DevTools port, call capture_element with debugPort, a CSS selector, and optional targetId or targetUrl. Carton leaves the tab open in its current state.
From the terminal:
carton capture --cdp 9222 --url /checkout --selector mainFrom a Playwright script or test:
import { captureToCarton } from "/path/to/carton/src/capture.js";
await page.getByRole("button", { name: "Checkout" }).click();
await captureToCarton(page, { fileId, pageId, name: "Checkout · Mobile", selector: "main" });Use the desktop editor
Open Carton from your applications menu or run carton app.
Drag layers on the canvas to move them, and drag the bottom-right handle to resize.
Shortcuts:
Vselect,Hpan,Aartboard,Rrectangle,Ttext,Ppen path (Enterfinishes a path),1fit page.Scroll to pan and hold
Ctrlwhile scrolling to zoom around the cursor.Drag rows in Layers to reorder, or hold
Shifton drop to nest a layer.Double-click a page name to rename or reorder it. Use the workspace menu to create, move, rename, archive, and restore files and folders.
The Design inspector includes three procedural shader effects powered by
@paper-design/shaders(@paper-design/shaders-reactin JSX output).
Storage and security
Workspaces are stored in
$XDG_DATA_HOME/carton/workspace.sqlite(default~/.local/share/carton/workspace.sqlite), with exports written to the adjacentexports/folder. SetCARTON_HOMEon both the editor and CLI to isolate a separate workspace.SQLite transactions serialize concurrent edits between the editor and MCP clients. Carton keeps 50 diff-based undo steps across restarts and deduplicates stored images and fonts by SHA-256 (
carton-asset:<sha256>).Connect only MCP clients you trust, and use
import_componentonly on trusted local projects because it runs project code. Review imported URLs and exports before sharing them. SeeSECURITY.mdfor reporting vulnerabilities and redaction details.
Contributing
Bug reports, Linux packaging fixes, editor improvements, and MCP tests are all welcome. Read CONTRIBUTING.md for setup instructions, project layout, and pull request guidelines. Participation is governed by the CODE_OF_CONDUCT.md.
License
Carton is released under the MIT License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read and write shared BitsWeave context, projects, tasks, and work sessions through MCP.
Design canvas for agents: create, edit, render and export Figma-shaped designs over MCP.
Give every project one workspace for its files, its team, and its AI agents.
Start and manage Reason cloud coding agents, projects and sessions from any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to directly view, understand, and modify local Sketch/Figma design files, including writing code, applying semantic edits, and exporting assets, all through a local MCP server without uploading data.MIT
- AlicenseAqualityDmaintenanceEnables coding agents to interact with the currently open Figma file via local MCP tools, including reading the design, extracting nodes as PNG, React, HTML or CSS, editing the canvas when permitted, and sharing saved component sets.3957 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables ChatGPT and other MCP clients to browse, search, edit and upload files, run commands and interactive terminals, inspect Git history and worktrees, dispatch coding agents, and install composable plugins within locally registered workspaces. Requests execute under the user's own machine with per-request approval or auto-approval, keeping files, tasks and results local unless explicitly returned.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables local MCP-capable assistants to connect to Figma Desktop to read documents, pages, and selections, edit native layers and components, and export PNG/SVG across multiple files without Figma API keys.2MIT