Arc

v0.15.2
io.github.hudsonkit/arc Checked 2 days ago Published 3 days ago

Author, validate, lay out, render, and diff architecture diagrams as code.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

arc_live_serve

Start a loopback push stream (SSE, WebSocket and RPC).

ParameterTypeDescription
stream *string
portinteger

arc_live_apply

Atomically apply a v1 command envelope to the local push stream.

ParameterTypeDescription
envelope

arc_live_read

Read the current command stream state.

open_live_diagram

Open an idle architecture view in the Hudson Kit Arc studio. Open the returned liveUrl once; use begin_live_diagram_work before doing diagram work, update_live_diagram for full revisions, and finish_live_diagram_work when that work ends. Keep stable node IDs for continuous motion. Connection identity comes from MCP initialization; optional agent labels are caller-declared.

ParameterTypeDescription
diagram *objectValid ArcDiagramData JSON
agentobjectOptional display identity for this session; preserves the actual MCP client name, version, and connection ID
baseUrlstringStudio base URL (default: ARC_EDITOR_URL or http://localhost:5188)
titlestringHuman-readable title for the live architecture

open_architecture_review

Open a saved architecture review with a baseline diagram and a concrete review question. The liveUrl is a read capability; keep the returned resumeToken private so a later MCP connection can resume after disconnect or restart. Revisions, findings, decisions, and open questions persist atomically in ARC_REVIEW_DIR. Use begin_live_diagram_work, update_live_diagram, and finish_live_diagram_work for declared work; use update_architecture_review for evidence. Requires configured durable storage.

ParameterTypeDescription
diagram *objectInitial baseline ArcDiagramData JSON
question *stringThe concrete architecture question this review will answer
title *string
agentobject
baseUrlstring
repositoryobject

update_architecture_review

Publish review evidence. Only supplied fields are replaced; omitted fields are preserved. Findings must have stable unique IDs, a severity, and source references (use an empty sources array when evidence is not yet available). Arrays replace their previous contents, and an empty summary clears it. During declared work this renews its five-minute lease. Saved completed reviews are read-only.

ParameterTypeDescription
sessionId *string
decisionsarray
findingsarray
openQuestionsarray
summarystring

resume_architecture_review

Resume a saved review using its private author capability after the previous MCP owner disconnects. A live owner cannot be displaced. Restored in-progress work is interrupted; declare new work explicitly. Completed reviews remain read-only and can be reopened for viewing. This connection supplies its actual MCP identity; optional agent labels are caller-declared, as when opening a review. Omit agent to use only the new connection identity. Completed artifacts keep their final author unchanged. A new relay may return a new liveUrl.

ParameterTypeDescription
resumeToken *string
sessionId *string
agentobjectOptional caller-declared display identity for the resumed author; preserves actual MCP client name, version, and connection ID
baseUrlstring

revoke_architecture_review_share

Invalidate the current review viewing link and disconnect its viewers. Returns a replacement liveUrl and streamUrl. This rotates only the read capability; the private author resumeToken remains valid. Only the owning MCP connection may revoke a share.

ParameterTypeDescription
sessionId *string
baseUrlstring

begin_live_diagram_work

Declare diagram work before doing it, with a concise summary and optional scope (default canvas). Target existing node IDs or a canvas region where new boxes will appear. Returns workId; always finish that ID with finish_live_diagram_work when done. Only one work item may be active per session. Valid diagram updates renew its five-minute lease; expiry or disconnect interrupts it instead of claiming success.

ParameterTypeDescription
sessionId *stringLive diagram or architecture review opened or resumed on this connection
summary *stringWhat diagram work you are about to perform; concise, honest, and specific
scopeCanvas, 1–200 unique existing node IDs, or finite canvas coordinates for a planned region

finish_live_diagram_work

Finish the active declared diagram work using its workId. Leaves the view idle and reusable for the next begin/update/finish cycle. Stale, expired, or already finished work IDs are rejected. Use end_live_diagram only when the entire diagram session is complete.

ParameterTypeDescription
sessionId *stringLive diagram or architecture review opened or resumed on this connection
workId *stringCurrent workId returned by begin_live_diagram_work
messagestringShort note describing the actual result

update_live_diagram

Publish the next full diagram revision. Preserve node IDs for smooth moves and use new IDs for new nodes. During declared work this renews its five-minute lease and preserves its scope; otherwise the view stays idle. Invalid diagrams leave the previous revision intact. Only this MCP connection can update its sessions.

ParameterTypeDescription
diagram *objectNext complete ArcDiagramData JSON
sessionId *stringLive diagram or architecture review opened or resumed on this connection
messagestringShort description of the current architecture change

end_live_diagram

Mark the entire live architecture session complete, also completing any active declared work. For a reusable idle view use finish_live_diagram_work instead. Ordinary diagrams expire after disconnect; saved architecture reviews remain durable and read-only. Open a new session to continue after ending.

ParameterTypeDescription
sessionId *stringLive diagram or architecture review opened or resumed on this connection
messagestringShort completion note

validate_diagram

Validate an ArcDiagramData document. Returns coded diagnostics — consume by `code`, apply one `supportedFixes` entry, re-validate. `ok` is false while any error-severity diagnostic remains.

ParameterTypeDescription
diagram *objectArc diagram JSON object or JSON string
severitystringFilter returned diagnostics by severity (default: all)

diff_diagram

Structural diff of two Arc diagrams. Returns a DiagramDelta — added/removed/moved/changed nodes, connector adds/removes/changes (keyed by connector id or from→to), connectorStyles and groups deltas, layoutChanged. Feed it to <ArcDiagram data={head} delta={delta} /> for a diff render.

ParameterTypeDescription
base *objectBase ArcDiagramData JSON object or JSON string
head *objectHead ArcDiagramData JSON object or JSON string

auto_layout

Run Arc auto-layout on a diagram. Pass a full diagram or minimal input (nodeData + connectors + connectorStyles).

ParameterTypeDescription
input *objectFull ArcDiagramData or AutoDiagramInput (nodeData, connectors, connectorStyles)

render_ascii

Render an Arc diagram as monospace ASCII/Unicode box art.

ParameterTypeDescription
diagram *objectValid ArcDiagramData JSON
charsetstringCharacter set (default: unicode)
maxWidthintegerMax output width in characters

render_svg

Render an Arc diagram as deterministic SVG markup using the package export path.

ParameterTypeDescription
diagram *objectValid ArcDiagramData JSON
animateFlowsbooleanEmbed SMIL flow animation in the SVG (default: true; ignored when flowTime is set)
backgroundColorstringCSS background color (defaults to the theme canvas)
flowTimenumberRender flow markers at this route second (disables SMIL animation)
includeGridbooleanRender the diagram grid (default: branded themes on, others off)
modestringColor mode; defaults to the theme default
paddingnumberPadding around the export bounds in px (default: 20)
themestringArc theme id: default, warm, cool, mono, engineering, workbench, tactical, command, spacex, claude, codex, or inherit

render_png

Render an Arc diagram as a PNG via an installed Chrome/Chromium binary. Returns MCP image content plus render metadata. Set ARC_CHROME if Chrome is not on PATH.

ParameterTypeDescription
diagram *objectValid ArcDiagramData JSON
backgroundColorstringCSS background color (defaults to the theme canvas)
flowTimenumberFlow route second to freeze into the PNG (default: 0)
includeGridbooleanRender the diagram grid (default: branded themes on, others off)
modestringColor mode; defaults to the theme default
paddingnumberPadding around the export bounds in px (default: 20)
scalenumberRaster scale factor (default: 2, max: 4)
themestringArc theme id: default, warm, cool, mono, engineering, workbench, tactical, command, spacex, claude, codex, or inherit

render_animation

Render diagram flows as a GIF or MP4 artifact. Uses deterministic frame captures through Chrome plus ffmpeg; requires an `output` path because video payloads are too large for MCP text.

ParameterTypeDescription
diagram *objectValid ArcDiagramData JSON
output *stringDestination file path for the GIF or MP4
backgroundColorstringCSS background color (defaults to the theme canvas)
durationnumberSeconds to render (default: one full flow cycle)
formatstringOutput format; inferred from `output` extension when omitted
fpsnumberFrames per second (default: 12 for GIF, 30 for MP4)
includeGridbooleanRender the diagram grid (default: branded themes on, others off)
modestringColor mode; defaults to the theme default
paddingnumberPadding around the export bounds in px (default: 20)
scalenumberRaster scale factor (default: 2, max: 4)
themestringArc theme id: default, warm, cool, mono, engineering, workbench, tactical, command, spacex, claude, codex, or inherit

render_html

Render an Arc diagram as a React component snippet, iframe embed, or standalone HTML page.

ParameterTypeDescription
diagram *objectValid ArcDiagramData JSON
backgroundColorstringCSS background color for format=html (defaults to the theme canvas)
baseUrlstringStudio base URL for format=iframe (default: ARC_EDITOR_URL or http://localhost:5188)
componentNamestringComponent function name for format=component (default: ArcDiagramExample)
dataNamestringDiagram const name for format=component (default: diagram)
formatstringOutput format: component (TSX), iframe (embed tag), or html (standalone SVG page). Default: html
heightIframe height in px or CSS percentage
includeGridbooleanRender the diagram grid for format=html (default: branded themes on, others off)
interactivebooleanWhether the React component is interactive
modestringColor mode; defaults to the theme default
paddingnumberPadding around the export bounds in px for format=html (default: 20)
sessionIdstringSession id for format=iframe URLs (generated if omitted)
themestringArc theme id: default, warm, cool, mono, engineering, workbench, tactical, command, spacex, claude, codex, or inherit
titlestringHTML document title or iframe title
widthIframe width in px or CSS percentage

diagram_to_typescript

Convert a valid Arc diagram JSON into a TypeScript module that exports ArcDiagramData.

ParameterTypeDescription
diagram *objectValid ArcDiagramData JSON
exportNamestringConst name (default: diagram)

editor_handoff

Build URLs to open a diagram in the Arc studio. Returns a hash-based editor URL and showcase link.

ParameterTypeDescription
diagram *objectValid ArcDiagramData JSON
baseUrlstringStudio base URL (default: ARC_EDITOR_URL or http://localhost:5188)
sessionIdstringSession id (generated if omitted)
viewstringGuided view id to start on (data.views[].id) — deep-links the player chapter