Skip to content

Instantly share code, notes, and snippets.

@AbhimanyuAryan
Created March 21, 2026 23:13
Show Gist options
  • Select an option

  • Save AbhimanyuAryan/043116a56123df0dcfd0487331483363 to your computer and use it in GitHub Desktop.

Select an option

Save AbhimanyuAryan/043116a56123df0dcfd0487331483363 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Start Excalidraw MCP Server Wrapper
# Set environment
export EXPRESS_SERVER_URL="${EXPRESS_SERVER_URL:-http://localhost:3000}"
export ENABLE_CANVAS_SYNC="${ENABLE_CANVAS_SYNC:-true}"
export PORT="${PORT:-3000}"
# Start canvas server in background
# Redirect output to log file to keep stdio clean for MCP communication
(cd $(dirname "$0") && node dist/server.js > /tmp/excalidraw-canvas.log 2>&1) &
CANVAS_PID=$!
# Wait for canvas server to initialize
sleep 3
# Set up cleanup trap
trap "kill $CANVAS_PID" EXIT
# Start MCP server
# This process will communicate via stdio with the client
cd $(dirname "$0") && node dist/index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment