Skip to content

Repository files navigation

English | 한국어 | 日本語

mcp-scapple

npm version

An MCP (Model Context Protocol) server for reading, writing, and rendering Scapple (.scap) files. Scapple is a brainstorming tool by Literature & Latte that stores diagrams as XML. This server enables AI assistants to work with Scapple files directly.

Features

  • read-scapple: Parse a .scap file into structured JSON with notes, background shapes, note styles, and connections
  • write-scapple: Create a .scap file from structured note data with automatic bidirectional connection management
  • text-to-scapple: Convert indented text, bullet lists, or numbered lists into Scapple diagrams with automatic layout and optional themed rendering
  • scapple-to-image: Render a .scap file to PNG with full theme support (background, colors, fonts, shadows, patterns)

Examples

You can use natural language to create and render diagrams:

"Make a brainstorm diagram about mobile app development with branches for design, backend, and testing"

Default theme

"Render that diagram with a dark theme - navy background, dot pattern, no shadows"

Dark theme

Theme Options

The scapple-to-image and text-to-scapple tools accept an optional theme parameter with the following properties. All properties are optional - when omitted, values from the .scap file's settings are used first, then the defaults below.

Canvas

PropertyTypeDefaultDescription
backgroundColorstring#ffffffCanvas background color (hex)
backgroundPatternstringnonePattern type: none, dots, grid, lines
patternColorstring#ccccccPattern color (hex)

Notes

PropertyTypeDefaultDescription
strokeColorstring#ccccccNote border color (hex)
strokeWidthnumber1Note border width
borderRadiusnumber8Rounded note corner radius
shadowColorstring#00000033Shadow color (hex with alpha)
shadowEnabledbooleantrueEnable/disable shadow
defaultFillstringnoneDefault note fill color (hex)
defaultBorderstringNoneDefault border style: Rounded, Square, Cloud, None

Text

PropertyTypeDefaultDescription
defaultFontstringHelveticaDefault font family
defaultFontSizenumber12Default font size
defaultTextColorstring#000000Default text color (hex)
defaultAlignmentstringCenterDefault text alignment: Left, Center, Right
noteXPaddingnumber8Horizontal padding inside notes

Connections

PropertyTypeDefaultDescription
lineColorstring#666666Connection line color (hex)
lineWidthnumber1Connection line width
arrowColorstring#666666Arrow color (hex)

Scapple File Settings

When rendering a .scap file, the following settings are read from the file and used as theme defaults (overridden by explicit theme parameters):

  • BackgroundColorbackgroundColor
  • DefaultTextColordefaultTextColor
  • DefaultFont (UISettings) → defaultFont
  • NoteXPadding (UISettings) → noteXPadding

Per-note appearance settings (border color, weight, text color, fill, font, bold/italic) always take precedence over theme defaults.

Components

PathDescription
src/index.tsMCP server entrypoint
src/types.tsTypeScript type definitions
src/errors.tsCustom error class hierarchy
src/lib/parser.ts.scap XML to ScappleDocument parser
src/lib/builder.tsScappleDocument to .scap XML builder
src/lib/renderer.tsSVG/PNG rendering pipeline
src/lib/layout.tsText-to-diagram automatic layout
src/lib/svg/SVG generation modules (shapes, connections, text, defs)
src/tools/MCP tool handlers
examples/Rendered samples

Requirements

  • Node.js 18+
  • npm

Usage

Configure in Claude Code

claude mcp add --transport stdio --scope user scapple -- npx -y @binaryloader/mcp-scapple

Tool Usage

read-scapple - Read a Scapple file:

filePath: "/path/to/diagram.scap"

write-scapple - Create a Scapple file:

filePath: "/path/to/output.scap"
document: { notes: [{ x: 100, y: 100, text: "Hello" }] }

text-to-scapple - Convert text to diagram:

text: "Root Topic\n Branch A\n Leaf 1\n Branch B"
filePath: "/path/to/output.scap"
renderImage: true

scapple-to-image - Render to PNG:

filePath: "/path/to/diagram.scap"
scale: 2
theme: { backgroundColor: "#1a1a2e", backgroundPattern: "dots", shadowEnabled: false }

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

MCP server for reading, writing, and rendering Scapple (.scap) files

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages