Napkin

Napkin

From thought to diagram in seconds — entirely offline.

A fast, local-first drawing and diagramming app built with Tauri and rough.js. Create system diagrams, flowcharts, sprint boards, and wireframes — with a hand-drawn feel. No accounts, no cloud, no tracking. Your data stays on your machine.

Examples

A few things you can build with Napkin.

Features

  • Instant and private — opens immediately, works offline, nothing leaves your computer
  • Hand-drawn feel — rough.js rendering gives diagrams a natural, sketchy look
  • Desktop native — built with Tauri, runs as a real app, not a browser tab
  • Simple file format.napkin files are JSON, easy to version control or script
  • AI-ready — built-in MCP server lets AI agents create and edit diagrams

Drawing

  • 13 shape types: rectangles, ellipses, triangles, diamonds, hexagons, stars, clouds, cylinders, sticky notes, lines, arrows, freehand, and text
  • Lines and arrows with direct, elbow, or curved routing
  • 7 endpoint styles (arrow, open-arrow, triangle, circle, diamond, square, none)
  • Configurable fill styles: hachure, solid, zigzag, cross-hatch, dots
  • Paste images from clipboard directly onto the canvas
  • Resize, rotate, snap, align, and style everything
  • Smart guides: alignment lines and equal-spacing indicators when dragging shapes
  • Snap to grid, object snap, and alignment hints (independently toggleable)
  • Auto-layout: grid and force-directed arrangement via context menu or MCP
  • Adjustable roughness (0 = clean, 3 = very sketchy)

Workflow

  • Multiple tabs with collection save/restore
  • Undo/redo (single undo for drag, resize, and rotate gestures), copy/paste, duplicate
  • Export to PNG or SVG
  • Presentation mode with fullscreen and pan navigation
  • Auto-save with recovery
  • Native file dialogs on desktop

Getting Started

Download the latest build for your platform from the GitHub Releases page:

  • macOS.dmg (Apple Silicon and Intel)
  • Windows.msi or .exe
  • Linux.deb or .AppImage

Want to build from source or contribute? See the Contributing Guide.

Shapes

ShapeDescription
RectangleStandard box shape
EllipseCircle or oval
TriangleEquilateral triangle
DiamondRotated square / rhombus
HexagonSix-sided polygon
StarFive-pointed star
CloudCloud shape using bezier curves
Cylinder3D cylinder (databases, storage)
Sticky NoteColored note with text
TextStandalone text label
LineLine without arrowhead
ArrowLine with arrowhead
FreehandFreeform pencil drawing

All shapes support: stroke color, fill color, fill style, opacity, rotation, roughness (0–3), and text content.

Connections

Lines and arrows can bind to shapes at 5 connection points: top, right, bottom, left, center. Bound connections follow their shapes when moved, resized, or rotated.

Routing modes

  • Direct — straight line between endpoints
  • Elbow — orthogonal segments (right angles)
  • Curved — quadratic bezier via control points

Keyboard Shortcuts

Tools

KeyToolKeyTool
VSelectLLine
RRectangleAArrow
EEllipseDFreehand
GTriangleTText
IDiamondSSticky Note
XHexagonHPan
PStarSpaceTemp pan (hold)
CCloudEscCancel / Select
YCylinder

Actions

ShortcutAction
Cmd + ZUndo
Cmd + Shift + ZRedo
Cmd + CCopy
Cmd + VPaste
Cmd + DDuplicate
Cmd + 'Toggle grid
Cmd + Shift + PPresentation mode
Cmd + dragPan canvas
DeleteDelete selected

MCP Server

Napkin includes a built-in Model Context Protocol (MCP) server that lets AI agents — like Claude — create and manipulate diagrams programmatically. The server runs locally and bridges tool calls from an AI client through to the Napkin canvas.

Architecture

The MCP server uses a bridge pattern:

  1. AI client sends JSON-RPC request to http://127.0.0.1:21420/mcp
  2. Rust (Axum) HTTP server receives the request
  3. Request is forwarded to the Svelte frontend via Tauri event
  4. Frontend executes the tool and returns results
  5. Response flows back to the AI client

MCP Setup

1. Enable the server

In Napkin, click the Settings gear icon in the header bar, then toggle Enable MCP Server. The server listens on port 21420. The setting persists across sessions.

2. Configure your AI client

For Claude Code, add to your .claude.json or project MCP settings:

{
  "mcpServers": {
    "napkin": {
      "type": "url",
      "url": "http://127.0.0.1:21420/mcp"
    }
  }
}

3. Use it

Ask Claude to "draw a diagram in Napkin" or "create a flowchart". The AI agent will use the MCP tools to create shapes, connect them, and arrange the canvas.

MCP Tool Reference

All tools are called via JSON-RPC tools/call method. 22 tools are available:

get_canvas — Get full canvas state

Returns all shapes, viewport position/zoom, and group information.

Parameters: none

list_shapes — List shapes on the canvas
ParamTypeDescription
typestring?Filter by shape type: rectangle, ellipse, triangle, diamond, hexagon, star, cloud, cylinder, sticky, line, arrow, freedraw, text
get_shape — Get a shape by ID
ParamTypeDescription
idstringShape ID (required)
create_shape — Create a new shape
ParamTypeDescription
typestringShape type (required): rectangle, ellipse, triangle, diamond, hexagon, star, cloud, cylinder, sticky, text
xnumberX position (required)
ynumberY position (required)
widthnumber?Width (default: 200)
heightnumber?Height (default: 150)
strokeColorstring?Stroke color (default: #000000)
strokeWidthnumber?Stroke width (default: 2)
fillColorstring?Fill color (default: transparent)
fillStylestring?hachure, solid, zigzag, cross-hatch, dots
strokeStylestring?solid, dashed, dotted
opacitynumber?0 to 1 (default: 1)
roughnessnumber?0 to 3 (default: 1)
rotationnumber?Degrees
textstring?Text content
fontSizenumber?Font size for text shapes (default: 20)
stickyColorstring?Sticky note background color
update_shape — Update shape properties

Pass id (required) plus any properties to change. Accepts the same optional properties as create_shape.

delete_shape — Delete a shape
ParamTypeDescription
idstringShape ID to delete (required)
create_image — Add an image to the canvas
ParamTypeDescription
urlstringHTTP/HTTPS URL or base64 data URL (required)
xnumber?X position (default: 0)
ynumber?Y position (default: 0)
widthnumber?Width (auto-calculated if omitted)
heightnumber?Height (auto-calculated if omitted)
create_connection — Connect two shapes with a line or arrow
ParamTypeDescription
fromShapeIdstringSource shape ID (required)
toShapeIdstringTarget shape ID (required)
connectionTypestring?arrow (default) or line
routingModestring?direct (default), elbow, or curved
textstring?Label text on the connection
strokeColorstring?Line color
strokeWidthnumber?Line width

Connections created with this tool are bound to their source and target shapes — they stay connected when shapes are moved, resized, or rotated.

set_viewport — Pan and zoom the canvas
ParamTypeDescription
xnumber?Pan X offset
ynumber?Pan Y offset
zoomnumber?Zoom level (0.1 to 10)
select_shapes — Select shapes by ID
ParamTypeDescription
idsstring[]Array of shape IDs (required)
batch_operations — Batch create/update/delete
ParamTypeDescription
operationsarrayArray of { action, data } objects (required)

Each operation has action ("create", "update", or "delete") and data (shape properties for create/update, or { id } for delete).

Note: Use create_connection for arrows that need to bind to shapes. Arrows created via batch_operations are positioned by coordinates but not bound.

list_tabs — List all open tabs

Parameters: none

create_tab — Create a new tab
ParamTypeDescription
titlestring?Tab title (default: "Untitled")
switch_tab — Switch to a tab
ParamTypeDescription
tabIdstringTab ID (required)
rename_tab — Rename a tab
ParamTypeDescription
tabIdstringTab ID (required)
titlestringNew title (required)
group_shapes — Group shapes together
ParamTypeDescription
idsstring[]Shape IDs to group (minimum 2, required)
ungroup — Ungroup a shape group
ParamTypeDescription
groupIdstringGroup ID (required)
clear_canvas — Clear all shapes

Parameters: none. Removes all shapes from the active canvas.

bring_to_front — Move shape to front of z-order
ParamTypeDescription
idstringShape ID (required)
send_to_back — Move shape to back of z-order
ParamTypeDescription
idstringShape ID (required)
bring_forward — Move shape one step forward in z-order
ParamTypeDescription
idstringShape ID (required)
send_backward — Move shape one step backward in z-order
ParamTypeDescription
idstringShape ID (required)
reorganize — Auto-layout shapes on the canvas
ParamTypeDescription
algorithm"grid" | "force-directed"Layout algorithm (required)
shapeIdsstring[]Shape IDs to reorganize (omit for all shapes)
paddingnumberPadding between shapes for grid layout (default: 40)
iterationsnumberIterations for force-directed layout (default: 100)
set_snap_settings — Configure snapping behavior
ParamTypeDescription
snapToGridbooleanEnable/disable snap to 20px grid
alignmentHintsbooleanEnable/disable alignment guide lines
objectSnapbooleanEnable/disable magnetic snap to aligned shapes

File Format

Napkin saves files as .napkin — plain JSON that is easy to version control, diff, and script against.

A collection file contains multiple tabs:

{
  "napkin": "1.0",
  "documents": [
    {
      "title": "Tab 1",
      "shapes": [...],
      "viewport": { "x": 0, "y": 0, "zoom": 1 },
      "metadata": { ... }
    }
  ],
  "activeDocumentIndex": 0
}

License

MIT