Excalidraw MCP Server

Excalidraw MCP Server

A Model Context Protocol server that enables LLMs to create, modify and manipulate Excalidraw diagrams through a structured API, supporting element creation, styling, organization, and scene management.

Category
访问服务器

README

Excalidraw MCP Server: Powerful Drawing API for LLM Integration

A comprehensive Model Context Protocol (MCP) server that enables seamless interaction with Excalidraw diagrams and drawings. This server provides LLMs (Large Language Models) with the ability to create, modify, query, and manipulate Excalidraw drawings through a structured, developer‑friendly API.

Features

  • Full Excalidraw Element Control
    Create, update, delete, and query any Excalidraw element (rectangle, ellipse, diamond, text, arrow, etc.), including support for:
    • position (x, y)
    • dimensions (width, height)
    • styling (backgroundColor, strokeColor, strokeWidth, roughness, opacity)
    • text (text, fontSize, fontFamily)
    • line geometry (points)
    • locking (locked flag)
  • Advanced Element Manipulation
    Group, ungroup, align, distribute, lock, and unlock elements.
  • Scene & AppState Management
    • Track and modify scene‑level state: theme, viewBackgroundColor, viewport (scroll & zoom), selectedElements, groups.
    • Retrieve library of all elements or individual scene properties.
  • Save Scene
    Export the current scene (elements + appState) to a .excalidraw file on disk.
  • Resource Management
    Access and modify scene information, element library, theme, and raw element data.
  • Easy Integration
    Compatible with Claude Desktop, Cursor, and any other LLM platforms that support MCP.
  • Docker Support
    Simple containerized deployment for zero‑dependency installs.

API Tools Reference

Element Creation and Modification

create_element

Create a new Excalidraw element.

  • Input
    {
      "type": "<element type>",
      "x": <number>,
      "y": <number>,
      "width": <number, optional>,
      "height": <number, optional>,
      "points": [{"x":<number>,"y":<number>}],
      "backgroundColor": "<hex>",
      "strokeColor": "<hex>",
      "strokeWidth": <number>,
      "roughness": <number>,
      "opacity": <01>,
      "text": "<string>",
      "fontSize": <number>,
      "fontFamily": "<string>",
      "locked": <boolean>
    }
    
  • Output
    { "id": "<generated‑id>", "type": "<element type>", "created": true }
    

update_element

Update properties of an existing element.

  • Input
    {
      "id": "<element id>",
    }
    
  • Output
    { "id": "<element id>", "updated": true, "version": <new‑version‑number> }
    

delete_element

Remove an element from the scene.

  • Input
    { "id": "<element id>" }
    
  • Output
    { "id": "<element id>", "deleted": true }
    

query_elements

List elements matching optional filters.

  • Input
    {
      "type": "<element type>",        
      "filter": { "<prop>": <value> }  
    }
    
  • Output
    [ { /* element objects */ }]
    

Resource Management

get_resource

Retrieve scene or library information.

  • Input
    { "resource": "scene"|"library"|"theme"|"elements" }
    
  • Output
    • scene{ theme, viewport: {x,y,zoom}, selectedElements: […] }
    • library/elements{ elements: [ … ] }
    • theme{ theme: "light"|"dark" }

Element Organization

group_elements / ungroup_elements

Group or ungroup element collections.

  • Input
    { "elementIds": ["id1","id2",] }
    { "groupId": "<group id>" }
    
  • Output
    { "groupId": "<new‑id>", "elementIds": [], "ungrouped": true? }
    

align_elements

Align multiple elements to specified edge or center.

  • Input
    { "elementIds": [], "alignment": "left"|"center"|"right"|"top"|"middle"|"bottom" }
    
  • Output
    { aligned: true, elementIds: […], alignment: "<alignment>" }

distribute_elements

Evenly space elements horizontally or vertically.

  • Input
    { "elementIds": [], "direction": "horizontal"|"vertical" }
    
  • Output
    { distributed: true, elementIds: […], direction: "<direction>" }

lock_elements / unlock_elements

Prevent or allow editing of elements.

  • Input
    { "elementIds": [] }
    
  • Output
    { locked: true|false, elementIds: […] }

Scene Management

save_scene

Export current scene (elements + appState) to a .excalidraw file.

  • Input
    { "filename": "<optional, must end with .excalidraw>" }
    
  • Output
    Scene saved successfully to <filename> or error message.

Integration Examples

Claude Desktop

"mcpServers": {
  "excalidraw": {
    "command": "node",
    "args": ["src/index.js"],
    "env": {
      "LOG_LEVEL": "info",
      "DEBUG": "false"
    }
  }
}

Cursor

Create .cursor/mcp.json:

{
  "mcpServers": {
    "excalidraw": {
      "command": "node",
      "args": ["/absolute/path/to/mcp_excalidraw/src/index.js"],
      "env": { "LOG_LEVEL": "info", "DEBUG": "false" }
    }
  }
}

Docker

docker run -i --rm mcp/excalidraw

Or in MCP config:

"mcpServers": {
  "excalidraw": {
    "command": "docker",
    "args": ["run", "-i", "--rm", "mcp/excalidraw"],
    "env": { "LOG_LEVEL": "info", "DEBUG": "false" }
  }
}

Installation Guide

# Install dependencies
npm install

# Run development server
npm start

Docker

docker build -t mcp/excalidraw .
docker run -i --rm mcp/excalidraw

Configuration Options

Set via environment variables in .env or your container:

  • LOG_LEVEL — logging level (default: "info")
  • DEBUG — debug mode ("true"/"false", default: "false")
  • DEFAULT_THEME — default UI theme ("light"/"dark", default: "light")

Usage Examples

Create & Lock a Rectangle

{"type":"rectangle","x":50,"y":50,"width":100,"height":80,"backgroundColor":"#f3f3f3","strokeColor":"#333","locked":true}

{ "id":"abc123","type":"rectangle","created":true }

{"elementIds":["abc123"]}

Save Scene to File

{"filename":"my_drawing.excalidraw"}

"Scene saved successfully to my_drawing.excalidraw"

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选