excalidraw-skilllisted
Install: claude install-skill dongzhigang13305312738-art/paper-skills
# Excalidraw Skill
## Step 0: Detect Connection Mode
Before doing anything, determine which mode is available. Run these checks **in order**:
### Check 1: MCP Server (Best experience)
```bash
mcp-cli tools | grep excalidraw
```
If you see tools like `excalidraw/batch_create_elements` → **use MCP mode**. Call MCP tools directly.
### Check 2: REST API (Fallback — works without MCP server)
```bash
curl -s http://localhost:3000/health
```
If you get `{"status":"ok"}` → **use REST API mode**. Use HTTP endpoints (`curl` / `fetch`) from the cheatsheet.
### Check 3: Nothing works → Guide user to install
If neither works, tell the user:
> The Excalidraw canvas server is not running. To set up:
> 1. Clone: `git clone https://github.com/yctimlin/mcp_excalidraw && cd mcp_excalidraw`
> 2. Build: `npm ci && npm run build`
> 3. Start canvas: `HOST=0.0.0.0 PORT=3000 npm run canvas`
> 4. Open `http://localhost:3000` in a browser
> 5. (Recommended) Install the MCP server for the best experience:
> ```
> claude mcp add excalidraw -s user -e EXPRESS_SERVER_URL=http://localhost:3000 -- node /path/to/mcp_excalidraw/dist/index.js
> ```
### MCP vs REST API Quick Reference
| Operation | MCP Tool | REST API Equivalent |
|-----------|----------|-------------------|
| Create elements | `batch_create_elements` | `POST /api/elements/batch` with `{"elements": [...]}` |
| Get all elements | `query_elements` | `GET /api/elements` |
| Get one element | `get_element` | `GET /api/elements/:id` |