Excalidraw MCP Server
Excalidraw MCP 服务器:用于 LLM 集成的强大绘图 API
全面的模型上下文协议 (MCP) 服务器,可实现与 Excalidraw 图表和绘图的无缝交互。该服务器通过结构化、开发人员友好的 API,为 LLM(大型语言模型)提供创建、修改、查询和操作 Excalidraw 绘图的功能。
特征
完整的 Excalidraw 元素控制:创建、更新、删除和查询任何 Excalidraw 元素
高级元素操作:分组、对齐、分布、锁定和解锁元素
资源管理:访问和修改场景信息、库、主题和元素
轻松集成:可与 Claude Desktop 和其他 LLM 平台配合使用
Docker 支持:使用容器化选项进行简单部署
Related MCP server: Mermaid MCP Server
API 工具参考
元素创建和修改
创建元素
创建一个新的 Excalidraw 元素(矩形、椭圆形、菱形等)
所需输入:
type、x、y坐标可选输入:尺寸、颜色、样式属性
更新元素
通过 ID 更新现有的 Excalidraw 元素
必需输入:要更新的元素的
id可选输入:要修改的任何元素属性
删除元素
删除 Excalidraw 元素
必需输入:要删除的元素的
id
查询元素
具有可选过滤功能的查询元素
可选输入:按元素类型过滤的
type,使用键值对filter对象
资源管理
获取资源
获取特定资源,例如场景信息或所有元素
必需输入:
resource类型(场景、库、主题、元素)
元素组织
组元素
将多个元素组合在一起
必需输入:要分组的元素 ID 的
elementIds数组
取消分组元素
取消元素组组合
必填输入:要取消分组的组的
groupId
对齐元素
根据指定的对齐方式对齐多个元素
必需输入:
elementIds数组和alignment(左、中、右、上、中、下)
分发元素
在空间中均匀分布元素
必需输入:
elementIds数组和direction(水平或垂直)
锁定元素
锁定元素以防止修改
必需输入:要锁定的元素的
elementIds数组
解锁元素
解锁元素以允许修改
必需输入:要解锁的元素的
elementIds数组
与 Claude Desktop 集成
要将此服务器与 Claude Desktop 应用程序一起使用,请将以下配置添加到claude_desktop_config.json的“mcpServers”部分:
{
"mcpServers": {
"excalidraw": {
"command": "node",
"args": ["src/index.js"],
"env": {
"LOG_LEVEL": "info",
"DEBUG": "false"
}
}
}
}与 Cursor 集成
要将此服务器与 Cursor 一起使用,请在工作区中创建具有以下配置的.cursor/mcp.json文件:
{
"mcpServers": {
"excalidraw": {
"command": "node",
"args": [
"/path/to/your/directory/mcp_excalidraw/src/index.js"
],
"env": {
"LOG_LEVEL": "info",
"DEBUG": "false"
}
}
}
}请确保:
将
/path/to/your/directory替换为 mcp_excalidraw 安装的实际绝对路径如果
.cursor目录不存在,则创建它确保
index.js的路径正确且文件存在
Docker 集成
{
"mcpServers": {
"excalidraw": {
"command": "docker",
"args": ["run", "-i", "--rm", "mcp/excalidraw"],
"env": {
"LOG_LEVEL": "info",
"DEBUG": "false"
}
}
}
}安装指南
NPM 安装
# Install dependencies
npm install
# Start the server
npm startDocker 安装
# Build the Docker image
docker build -t mcp/excalidraw .
# Run the container
docker run -i --rm mcp/excalidraw配置选项
可以使用以下环境变量配置服务器:
LOG_LEVEL- 设置日志级别(默认值:“info”)DEBUG- 启用调试模式(默认值:“false”)DEFAULT_THEME- 设置默认主题(默认值:“light”)
使用示例
以下是一些如何使用 Excalidraw MCP 服务器的实际示例:
创建矩形元素
{
"type": "rectangle",
"x": 100,
"y": 100,
"width": 200,
"height": 100,
"backgroundColor": "#ffffff",
"strokeColor": "#000000",
"strokeWidth": 2,
"roughness": 1
}查询特定元素
{
"type": "rectangle",
"filter": {
"strokeColor": "#000000"
}
}对多个元素进行分组
{
"elementIds": ["elem1", "elem2", "elem3"]
}执照
此 Excalidraw MCP 服务器采用 MIT 许可证。您可以自由使用、修改和分发该软件,但须遵守 MIT 许可证的条款和条件。更多详细信息,请参阅项目存储库中的 LICENSE 文件。
Available Tools
11 toolsalign_elementsC
Align elements to a specific position
Inputs: alignment (required), elementIds (required).
create_elementC
Create a new Excalidraw element
Inputs: type (required), x (required), y (required), backgroundColor, +9 more.
delete_elementC
Delete an Excalidraw element
Inputs: id (required).
distribute_elementsD
Distribute elements evenly
Inputs: direction (required), elementIds (required).
get_resourceD
Get an Excalidraw resource
Inputs: resource (required).
group_elementsC
Group multiple elements together
Inputs: elementIds (required).
lock_elementsB
Lock elements to prevent modification
Inputs: elementIds (required).
query_elementsC
Query Excalidraw elements with optional filters
Inputs: filter, type.
ungroup_elementsB
Ungroup a group of elements
Inputs: groupId (required).
unlock_elementsB
Unlock elements to allow modification
Inputs: elementIds (required).
update_elementC
Update an existing Excalidraw element
Inputs: id (required), backgroundColor, fontFamily, fontSize, +10 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Every tool has a clearly distinct purpose focused on specific operations in Excalidraw, such as creation, deletion, alignment, distribution, grouping, locking, querying, and updating. There is no overlap or ambiguity between tools like 'create_element' and 'update_element' or 'lock_elements' and 'unlock_elements', making misselection unlikely.
All tool names follow a consistent verb_noun pattern with snake_case, such as 'create_element', 'delete_element', and 'group_elements'. The naming is predictable and readable throughout, with no deviations in style or convention.
With 11 tools, the server is well-scoped for managing Excalidraw elements, covering essential operations like CRUD, grouping, alignment, and locking. Each tool earns its place without feeling excessive or insufficient for the domain.
The tool set provides complete coverage for Excalidraw element management, including full CRUD (create, query, update, delete), lifecycle operations (lock/unlock, group/ungroup), and layout utilities (align, distribute). There are no obvious gaps that would cause agent failures in this domain.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Collaborative whiteboard MCP server — create objects, connectors, C4 diagrams, and manage boards
Immutable diagrams for AI agents: create, edit, validate and render versioned diagrams over MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that provides API functionality for creating, managing, and exporting Excalidraw drawings in various formats like SVG, PNG, and JSON.845MIT
- AlicenseNot gradedqualityNot gradedmaintenanceA server that implements the Model Context Protocol (MCP), providing an interface for LLM applications to generate mermaid.js visualizations and diagrams.MIT
- AlicenseBqualityDmaintenanceA 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.12MIT
- AlicenseAqualityCmaintenanceAn MCP server for Excalidraw diagram creation and headless rendering, enabling interactive canvas editing and automated SVG/PNG export via Playwright.41MIT