How We Use Excalidraw MCP with Claude for Better Design

Published:

Updated:

excalidraw mcp with claude

Disclaimer

As an affiliate, we may earn a commission from qualifying purchases. We get commissions for purchases made through links on this website from Amazon and other third parties.

Can a text prompt become a clear, hand-drawn system diagram in minutes? That question drove us to explore the community-driven yctimlin/mcp_excalidraw repository and the power of AI-assisted diagramming.

We built a workflow that pairs the repository’s robust framework with claude code to translate intent into canvas actions. Using the Model Context Protocol, we bridge text prompts and visual elements to speed creation.

Our iterative design loop helps us refine ideas faster. We now produce architecture diagrams roughly four times quicker than manual drawing. This keeps a consistent, hand-drawn aesthetic across docs and prototypes.

In this guide, we explain how integration of excalidraw mcp with claude lets teams convert technical requirements into clear visuals. Expect practical steps, examples, and tips to improve documentation and design efficiency.

Key Takeaways

  • We use the community repo and Model Context Protocol to connect prompts to the canvas.
  • claude code helps convert intent into structured visual elements.
  • Iterative workflows yield architecture visuals at about 4x manual speed.
  • The approach preserves a consistent hand-drawn look across projects.
  • The guide shows practical steps to improve diagramming and documentation.

Understanding the Power of Excalidraw MCP with Claude

We connect language models to live canvases so teams can turn specs into clear visuals fast.

What is the Model Context Protocol?

The model context protocol acts as a standardized interface that links AI models to external tools and data sources. It gives us a predictable way to send commands and read state from an interactive canvas.

Our preferred community mcp server keeps the canvas persistent. That means design changes stay live and synced, not locked to one-shot exports.

Benefits of Visual AI

AI agents can perform element-level CRUD so we edit shapes, text, and layout programmatically. This cuts manual steps and lowers cognitive load for developers.

Because the protocol supports 26 distinct apps and tools, our agent can handle complex interactions that go beyond simple image generation. The result is faster iteration and more consistent diagrams that match technical specs.

  • Universal standard lets models interact with external software.
  • Stateful model context enables multi-step canvas workflows.
  • Community server offers fine-grained control over diagrams.

Why We Prefer the Community Version for Design

We choose the community server when iterative control and persistence matter most.

The community version supports full element-level CRUD, so we can add, edit, and remove shapes one by one. This granular control makes complex architecture diagrams easier to manage.

Real-time WebSocket updates keep our local canvas synced to the AI’s current state. That prevents conflicts and saves time during multi-step edits.

Persistent live canvas means our work stays intact across prompts. We no longer lose context between sessions, which lets us refine each element until it’s right.

  • Iterative refinement for perfect placement and labels.
  • 13 extra tools beyond the official build, giving us 26 tools total for layout and automation.
  • Community-driven flexibility for diverse project needs.
FeatureCommunity VersionOfficial Implementation
Element-level CRUDFull supportLimited / one-shot
Real-time syncWebSocket updatesBatch updates
Toolset size26 tools13 tools
Canvas persistencePersistent live canvasEphemeral outputs

Preparing Your Local Environment

We start by verifying node versions, network bindings, and repository config to avoid common setup errors.

System Requirements

First, ensure your system runs Node.js version 18 or higher. This keeps dependencies compatible and avoids runtime surprises.

Clone the community repository and set up environment variables before you launch anything. Missing vars are a frequent cause of failures.

Initialize packages using npm ci and run the build command to prepare distribution files. That gives us a clean, repeatable build output.

  • Run the canvas and the mcp server in separate terminal processes to keep logs clear and performance steady.
  • By default the canvas binds to 127.0.0.1 — this is important for local security and should be reviewed during network setup.
  • Maintain a clean working environment to reduce conflicts when running multiple node-based tools.
ItemActionWhy it matters
Node versionInstall 18+Compatibility for all server deps
Buildnpm ci & buildGenerates stable distribution files
NetworkBind to 127.0.0.1Local access and safer development

Note: Proper setup is essential for the excalidraw mcp to function in our local workflow. When these steps are done, we can move on to launching the canvas server with confidence.

Starting the Canvas Server

We start the canvas server locally so the live web view reflects every AI edit in real time.

To run the canvas on our machine we use a simple terminal command. Execute PORT=3000 npm run canvas to launch the server on port 3000.

Alternatively, we deploy a containerized instance using Docker. The image is ghcr.io/yctimlin/mcp_excalidraw-canvas:latest, which helps us keep environments consistent across team machines.

Open http://127.0.0.1:3000 in your browser to view the live canvas. Every team user can watch the agent draw and review updates in real time.

Remember that the server stores elements in memory. Restarting the process clears the current canvas state, so we keep the process running during active sessions.

  • Start the canvas first so the mcp server can connect reliably.
  • Use Docker when we want repeatable runs across systems.
  • Verify the canvas is active before connecting clients to avoid sync errors.

For related tooling and deployment tips, see our guide on 3D modeling and animation tools.

Configuring Claude Desktop for Seamless Integration

A small JSON change registers our custom server and exposes new drawing tools in the UI.

Locating Config Files

On macOS the desktop config lives at ~/Library/Application Support/Claude/claude_desktop_config.json.

Open that file in a plain text editor so we can add a new entry for our connector.

Adding Custom Connectors

Inside the JSON we add an mcpServers object. Each server entry must include a command, args, and environment block.

Use the absolute path to the node executable and point it at dist/index.js. For example: /usr/local/bin/node /full/path/dist/index.js.

Set EXPRESS_SERVER_URL to the running canvas server, typically http://127.0.0.1:3000.

  • Confirm the path values and arg list so the system can run the code correctly.
  • Keep the config files under version control or a safe backup.
  • Restart the desktop app to apply the integration and enable the new tools in the interface.
SettingValueWhy
Config fileclaude_desktop_config.jsonRegisters mcpservers
Commandnode /full/path/dist/index.jsStarts the connector
Env varEXPRESS_SERVER_URL=http://127.0.0.1:3000Connects to canvas server

Setting Up the MCP Server in Cursor

We keep project-level server configuration close to the code to simplify team workflows.

We register the connector in the .cursor/mcp.json file at the project root. The entry mirrors the desktop config structure so EXPRESS_SERVER_URL points at the running canvas.

Use a relative node command that targets dist/index.js from the project root. Add the required args and environment variables so every teammate runs the same setup.

This project-scoped approach keeps our config and mcpservers scoped per project. It makes the system predictable and easy to reproduce across machines.

  • Place .cursor/mcp.json in the root so the editor discovers the server automatically.
  • Define command, args, and EXPRESS_SERVER_URL relative to the project path.
  • Verify the integration by checking status in the Cursor MCP management interface.

When the file is correct, we can run the command and the server will accept connections. This lets us manage canvas elements directly from our project editor during development.

Registering the Tool with Claude Code

We register the MCP connector so our agent can reach the canvas and act.

First, we add the mcp entry in the CLI using the following command pattern: claude mcp add –scope user. The CLI accepts either a Docker run string or a local node path as the primary argument.

When we pass the Docker command, include the container options and expose the canvas URL in the args block. For a local run, give the absolute path to dist/index.js so the tool starts reliably.

We verify registration by running claude mcp list. That command checks health and reports active mcpservers. A healthy entry means the agent can access the full suite of 26 design tools.

  • Register using the add command and the correct args.
  • Verify with claude mcp list to confirm health.
  • Invoke the skill using /excalidraw-skill to drive structured workflows.
ActionCLI ExampleWhy
Add serverclaude mcp add –scope user [docker|node path]Registers connector
Check healthclaude mcp listVerifies active mcpservers
Invoke skill/excalidraw-skillEnables agent workflows

Exploring the Full Suite of MCP Tools

A well-lit workspace showcasing an array of MCP canvas tools. In the foreground, a sleek digital tablet displaying an Excalidraw interface, surrounded by stylus pens and colorful markers. The middle layer features a modern desk with a laptop open to a design application, alongside reference materials and a notepad filled with sketches. In the background, a blurred window reveals a bright, sunny day outside, creating an inviting atmosphere. The overall mood is one of creativity and productivity, emphasizing collaboration and innovation in design. Soft natural lighting enhances the vibrant colors of the tools. The image is captured from a slightly elevated angle, focusing on the workspace’s dynamic layout.

A rich suite of functions gives us fine control over elements, layout, and viewport framing on the live canvas.

Element CRUD Operations

We use a set of element-level commands to create, read, update, and delete shapes and labels. The agent calls describe_scene and get_canvas_screenshot to inspect the current state before changing anything.

Why it matters: precise CRUD keeps each diagram accurate and preserves important data as we iterate.

Layout Control Tools

Layout helpers like align_elements and distribute_elements let the agent rearrange groups automatically. These tools speed up tidy layouts across complex diagrams.

We can apply spacing, snapping, and alignment rules so visuals stay consistent across pages and exports.

Viewport Management

Viewport commands such as set_viewport allow camera control. The agent can zoom to fit, center on element IDs, or pan to an area of interest.

File I/O tools—export_scene and import_scene—help us persist and restore whole scenes and related data for later review.

  • We use the full toolset to perform accurate element CRUD and keep diagrams clear.
  • Layout tools automate alignment and distribution to improve visual quality.
  • Viewport control ensures every area of the canvas is framed for the user.
  • Export and import preserve design data so we can save, share, and restore scenes.
  • Combined into a single skill, these tools let our agent handle demanding design tasks.
CategoryKey CommandsBenefit
Element CRUDdescribe_scene, update_elementAccuracy and traceable edits
Layoutalign_elements, distribute_elementsConsistent, tidy diagrams
Viewport & File I/Oset_viewport, export_scene, import_sceneFocused views and persistent data

Leveraging Scene Awareness for Iterative Refinement

Scene awareness gives our agents the context they need to refine an architecture diagram step by step.

We use the describe_scene tool to return a structured text view of the canvas. That text tells the agent what elements exist, their labels, and basic layout. This lets the agent decide targeted edits instead of guessing.

The get_canvas_screenshot tool lets the agent “see” the board. By combining text and image feedback, the agent closes the gap between intent and visual result.

Our refinement follows a simple draw-look-adjust loop. The agent reads the prompt to create the first pass. Then it describes the scene, inspects a screenshot, and corrects placement, labels, and flow.

  • We use scene awareness to enable iterative edits that improve layout and clarity.
  • Describe_scene helps analyze the canvas so agents make logical changes to flow.
  • Screenshots let the agent fix spacing and alignment on complex architecture diagrams.
  • This skill-driven loop is the most reliable way to get precise results from the mcp connector.

By letting the agent interpret what it drew, we maintain consistent visuals across projects. The result is cleaner diagrams and a faster path from prompt to polished architecture.

Using the Design Guide for Better Visuals

Before the agent starts drawing, we consult a compact design guide that sets color, spacing, and sizing rules.

We use the read_diagram_guide tool to give the agent clear rules for layout and palette choice. This helps the agent interpret a text prompt into consistent visuals.

The guide lists sizing rules, spacing patterns, and preferred color palettes. It also flags common anti-patterns that weaken a diagram’s clarity.

By consulting this guide before each run, our skill produces diagrams that match our style and stakeholder needs. The result is more professional output and fewer revisions.

When the agent follows these standards, complex prompts turn into readable diagrams faster. We preserve clarity across multiple pages and exports.

  • Guide enforces color, spacing, and sizing rules.
  • Agent avoids anti-patterns that reduce legibility.
  • Consulting the guide improves the final result and consistency.
  • The tool is crucial for turning text prompts into usable visuals.
AspectWhat the Guide ProvidesBenefit
ColorApproved palettes and contrast rulesAccessible, branded visuals
Sizing & SpacingFont sizes, margins, element spacingConsistent hierarchy and legibility
LayoutPatterns for flow, alignment, groupingClear information architecture
Anti-patternsCommon pitfalls to avoidFewer confusing diagrams, better reviews

Managing Canvas States with Snapshots

Snapshots let us capture a complete canvas state at a moment in time, so we can experiment freely without fear.

We use the snapshot_scene tool to save the current canvas under a clear, unique name. Each snapshot stores layout, labels, and element metadata so our work is preserved.

The restore_snapshot command is a true safety net. If an iterative edit produces a poor result, the agent can roll the scene back instantly. This keeps long-running sessions safe when we try alternate flows.

Snapshots also let us export data for long-term storage and version control. That exported package contains the scene JSON and assets so teams can track history and audit changes later.

  • We take snapshots before major edits to preserve progress.
  • restore_snapshot is an essential skill for the agent during risky changes.
  • Saved snapshots protect design data across iterations and team reviews.
  • This workflow scales for large projects and complex canvas states.
ActionToolBenefit
Save pointsnapshot_sceneProtects progress
Revertrestore_snapshotQuick recovery of result
ArchiveexportVersion control & backups

Exporting and Importing Your Diagrams

A close-up view of a large, blank canvas positioned on an easel in a bright, well-lit studio. The canvas is perfectly white, symbolizing the beginning of a creative process. Surrounding the canvas are various art supplies—paintbrushes, tubes of paint, and sketchbooks, organized neatly on a wooden table. In the soft background, large windows let in natural light, casting gentle shadows across the room. Include hints of colorful paint splashes on the floor, suggesting recent creative activity. The atmosphere is inspiring and calm, evoking a sense of potential and innovation. The image should be captured with a shallow depth of field, bringing focus to the canvas while softly blurring the art supplies in the foreground, creating a serene and inviting workspace vibe.

Exporting scenes into JSON files gives us portable, editable snapshots of our work.

We use export_scene and import_scene to save and load full .excalidraw JSON files. Exporting creates a clean file that stores element geometry, labels, and metadata.

For collaboration, export_to_excalidraw_url encrypts and uploads the scene so we get a shareable link. That link is a quick way to hand a result to teammates for review or feedback.

Maintaining a library of reusable snippets helps us speed future diagrams. We store files by component type so refactors are as simple as clearing the canvas and importing the desired state.

  • Export JSON files to preserve design work and team sharing.
  • Import files to restore a previous state or extend an existing diagram.
  • Use encrypted upload links for secure team collaboration.
ActionToolBenefit
Save sceneexport_sceneReliable file backup of layout and metadata
Shareexport_to_excalidraw_urlEncrypted link for secure collaboration
Restore or refactorimport_sceneQuickly rebuild canvas from a stored file

Troubleshooting Common Connection Issues

Connection failures often trace back to mismatched URLs or port bindings between services.

We start by confirming that the EXPRESS_SERVER_URL points exactly at the running canvas endpoint. If that value is wrong, the connector will not reach the board and the integration will fail.

Next, we ensure the canvas is active on the expected port before we launch the mcp server. Check the health endpoint at http://127.0.0.1:3000/health to confirm the server is responding.

Resolving Network Conflicts

When the mcp server runs inside Docker, name resolution can cause conflicts. We switch host mapping to host.docker.internal so the container can see the host canvas.

If the canvas does not update, verify that ENABLE_CANVAS_SYNC is set to true. Also check the config files to ensure the command, args, and absolute paths match your system version and the local node runtime.

  • Use the browser to open the canvas URL and confirm the web view loads for each user.
  • Run the health check to validate the server and confirm the expected result.
  • Review mcpservers entries in CLI or project config to ensure registration succeeded.

IssueCheckFix
Unreachable canvasEXPRESS_SERVER_URLCorrect URL and port
Container can’t reach hostDNS / host mappingUse host.docker.internal
No updatesENABLE_CANVAS_SYNC envSet to true
Registration failedmcpservers listVerify args and command paths

Implementing the Agent Skill for Advanced Workflows

We designed a skill that sequences commands so our agent can build and refine diagrams autonomously.

Our excalidraw-skill provides a structured playbook for drawing, refining, and exporting architecture diagrams. It bundles helper scripts for health checks, CRUD operations, and batch import tasks. This makes repetitive work predictable and fast.

The skill respects the EXPRESS_SERVER_URL environment variable, so the same setup runs across any project or server. That portability helps teams reproduce results without extra config.

As a bridge between the agent and the MCP server, the skill simplifies complex flows. It exposes a clear command sequence that the agent follows to avoid race conditions and ensure consistent state.

  • We implement the skill to streamline advanced workflows and speed architecture iterations.
  • Helper scripts automate canvas health checks and element-level management.
  • The system works well alongside our node-based server and common dev tools.
  • For reusable examples and extra skills, see awesome agent skills.
FeatureBenefitWhy it matters
Health check scriptsReliable runsPrevents failed commands
CRUD helpersSafe editsTraceable element changes
Batch importFast setupQuickly create new diagrams

Best Practices for Complex Architecture Diagrams

Complex systems demand a repeatable pattern for diagrams so teams avoid guesswork.

We keep a library of element JSON snippets to ensure consistent symbols and labels across a large project. Reusable snippets speed drawing and make each architecture diagram match our style guide.

Automated smoke tests run on node deployments. These tests create, update, and delete known elements so we verify the system behaves as expected before a review.

Clear snapshot naming helps us track versions. We use predictable names that include project, date, and intent so any user can restore or audit a state fast.

Layout patterns are non-negotiable. We follow flow rules so a browser user can read left-to-right and trace the system flow without confusion.

  • Maintain a reusable element library for fast, consistent diagrams.
  • Use automated tests to validate canvas operations across the project life cycle.
  • Save regular exports to files to protect work and enable version control.
  • Drive placement and flow using claude code to keep edits precise and repeatable.
ActionWhyBenefit
Reusable snippetsStandardize elementsFaster, consistent output
Smoke testsValidate create/update/deleteFewer regressions
Snapshot namingTrack statesEasy rollback

Elevating Your Design Potential with AI

We now harness an AI-driven sketch pipeline that turns a short prompt into a clear system layout in minutes.

By integrating the excalidraw mcp into our workflow, we significantly elevated design potential and efficiency. We use claude code to generate high-quality diagrams so our agents handle complex tasks with ease.

Combining advanced tools and the excalidraw skill transformed how we approach visual documentation. Our iterative prompt-driven loop keeps each diagram accurate and visually appealing.

We encourage teams to explore these apps and this version of the workflow. Using this agent-driven approach, we push the boundaries of AI-assisted design and keep improving results.

About the author

Latest Posts