← MCP server and skill grades

mcp_excalidraw

yctimlin/mcp_excalidraw

F
Type
MCP server
Scanned
Nov 12, 2026
Version
81720ac819d2
Files read
87

This project is an MCP server, CLI, and agent skill that lets AI coding agents draw, screenshot, and export Excalidraw diagrams using a local canvas web server. The biggest risk is that launching it inside an untrusted repository automatically loads that folder's .env file before spawning a Node.js child process—allowing arbitrary code execution via NODE_OPTIONS—while the local canvas server also allows any website open in your browser to read or modify your diagrams.

What it can reach

Files
Reads and writes diagram and image files (.excalidraw, .json, .md, .png, .svg) inside EXCALIDRAW_EXPORT_DIR (the current working directory by default, or any path via the CLI), loads .env from the current working directory, writes logs and PID files in the user state directory, and optionally stores persistent state in EXCALIDRAW_DATA_DIR.
Network
Runs a local HTTP and WebSocket canvas server on 127.0.0.1:3000 by default (0.0.0.0:3000 in Docker), loads fonts from the esm.sh CDN in the browser UI, and uploads AES-GCM-encrypted scenes to json.excalidraw.com (or a custom server) when sharing links.
System
Spawns Node.js child processes for the detached canvas server and the isolated headless PNG renderer worker, and sends SIGTERM to stop the canvas server.
Browser
Syncs canvas elements, reads active selection state, controls camera viewport, and converts Mermaid diagrams via WebSocket connections to open browser tabs.

Findings

1 critical1 high1 medium3 low
  1. CriticalAutomatic .env loading from the working directory enables code execution via NODE_OPTIONS

    src/core/config.ts:4

    Both src/core/config.ts and src/server.ts call dotenv.config() on startup, which automatically loads a .env file from whatever working directory the MCP server or CLI was launched in (such as a cloned third-party repository opened in Cursor, Claude Code, or Codex). Because src/index.ts immediately auto-starts the canvas server by spawning a child Node.js process with process.env (and PNG rendering similarly spawns a worker with process.env), an untrusted repository's .env file can set NODE_OPTIONS (for example --import ./payload.mjs) along with an unused loopback EXPRESS_SERVER_URL to force a spawn and execute arbitrary code with no user or AI action. A repo .env can also set EXCALIDRAW_EXPORT_DIR=/ to disable file path restrictions or redirect EXPRESS_SERVER_URL to an external server.

    Fix: Remove dotenv.config() from runtime entry points so the MCP server and CLI rely only on environment variables explicitly passed by the user or MCP client configuration, and strip dangerous variables like NODE_OPTIONS if ever loading untrusted config.

  2. HighLocal canvas server has no authentication, wildcard CORS, and no WebSocket Origin check

    src/server.ts:63

    On normal startup, the MCP server spawns a detached background Express and WebSocket server on http://127.0.0.1:3000 that stays running even after the session ends. This server enables app.use(cors()) (setting Access-Control-Allow-Origin: * on all routes), performs no Origin or Host header checks on HTTP or WebSocket connections, and requires no authentication token. While it is running, malicious websites visited in the user's browser (depending on browser Private Network Access rules, such as in Firefox or via DNS rebinding) can silently read all diagrams, snapshots, and images, wipe or alter the canvas, or plant prompt-injection text into shape labels that the AI agent later reads.

    Fix: Require a per-instance random bearer token for REST and WebSocket requests, restrict CORS and WebSocket Origin headers to the exact local canvas origin, and validate the Host header to prevent DNS rebinding.

  3. MediumMCP scene export can overwrite arbitrary .md and .json files in the working directory

    src/core/normalize.ts:7

    The MCP file sandbox defaults ALLOWED_EXPORT_DIR to process.cwd() (the entire workspace root, or the user's home directory in GUI clients like Claude Desktop) and checks only path.extname() against .excalidraw, .json, and .md so that .excalidraw.md files pass. Because any .md or .json filename is accepted and Obsidian markdown exports embed raw text from text elements directly into the file body, a prompt-injected agent can call create_element followed by export_scene to overwrite agent instruction files such as CLAUDE.md, AGENTS.md, or SKILL.md with attacker-chosen instructions, or clobber configuration files like package.json and .claude/settings.json.

    Fix: Require scene exports to end specifically in .excalidraw or .excalidraw.md rather than any .md or .json file, or default EXCALIDRAW_EXPORT_DIR to a dedicated subdirectory instead of process.cwd().

  4. LowDocker Compose exposes the unauthenticated canvas server on all network interfaces

    docker-compose.yml:21

    In docker-compose.yml (and the docker run command in Quick Start), port 3000 is published as 3000:3000 without a 127.0.0.1 host bind address while HOST is set to 0.0.0.0. Anyone on the same local network or Wi-Fi can connect to port 3000 to view, modify, or delete diagrams on the unauthenticated canvas server.

    Fix: Bind the published container port to loopback by default using 127.0.0.1:3000:3000 in docker-compose.yml and in the README docker run command.

  5. LowSample Claude Desktop config runs a different unpinned npm package

    claude_desktop_config.json:5

    This package is published on npm as mcp-excalidraw-server, but the repository's sample claude_desktop_config.json specifies npx -y excalidraw-mcp. A user who copies this file will silently download and execute a different, unpinned npm package without confirmation.

    Fix: Update claude_desktop_config.json to use mcp-excalidraw-server pinned to a release version.

  6. LowBundled agent skill runs unpinned npx -y package commands at runtime

    skills/excalidraw-skill/SKILL.md:3

    The installed SKILL.md instructs coding agents to execute npx -y mcp-excalidraw-server without pinning a version. Whenever the npx cache misses or expires, npm will automatically fetch and execute whatever version is currently published as latest, exposing users of an already-installed skill to future supply-chain compromise.

    Fix: Pin the package version in SKILL.md (matching the version that ran install-skill) or prefer a locally installed excalidraw-canvas binary.