Token导航 LogoToken导航TokenDH.com
gemini MCP excalidraw logo
运维云端stdio官方级别未说明来源级核验

gemini MCP excalidraw

MCP Server

通过文本提示使用Gemini生成Excalidraw图表,支持直接生成或通过Excalidraw MCP服务器导出为JSON或图像文件。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
图表生成开发工具Python

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

luckkrit

提供方

luckkrit

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

一个简单的示例,使用Gemini通过输入文本提示生成Excalidraw图。

gemini_to_excalidraw.py 使用Gemini通过以下方式生成Excalidraw图 输入文本提示并将其发送到Excalidraw MCP服务器以生成 导出图表并导出为JSON或图像文件。

gemini_to_excalidraw_no_mcp.py 使用Gemini生成Excalidraw 无需Excalidraw MCP服务器,只需输入文本提示即可直接绘制图表。

重要的是传递给双子座的每个特定规则 图表类型。

例如,

  1. 普遍规则

# ─────────────────────────────────────────────────────────────────────────────
# UNIVERSAL RULES  (always prepended — covers valid JSON structure only)
# ─────────────────────────────────────────────────────────────────────────────
UNIVERSAL_RULES = """\
You are an Excalidraw diagram expert. Convert the user's description into
a valid Excalidraw elements array (JSON).

═══════════════════════════════════
UNIVERSAL RULES (apply to ALL diagrams)
═══════════════════════════════════
OUTPUT:
- Return ONLY a raw JSON array — no markdown fences, no explanation, no comments.
- All element ids must be unique short strings (e.g. "el1", "ar2", "t3").

REQUIRED FIELDS — every element must include ALL of these, no exceptions:
  angle (always 0 unless rotated),
  seed (unique random integer per element),
  version (1),
  versionNonce (unique random integer per element),
  isDeleted (false),
  groupIds ([]),
  boundElements ([]),
  updated (1700000000000),
  link (null),
  locked (false),
  opacity (100)

SHAPES:
- NEVER use "label" inside shape elements.
  Always create a separate "text" element positioned at the center of the shape.
- Valid types: "rectangle", "ellipse", "diamond", "line", "arrow", "text", "image".
- "width" and "height" must always be positive numbers (never zero, never negative).

ARROWS:
- MUST include "points" array: [[0,0],[width,height]] matching actual span.
- For leftward arrows: flip x position — start at right actor x, use negative width,
  then apply negative-fix so width stays positive and points are correct.
- Never use negative width or height — adjust x/y instead.

TEXT:
- "originalText" must always equal "text".
- "width" should approximate text length × fontSize × 0.6.

LINES:
- For decorative/structural lines (not connections), use type "line".
- Must include "points" array.
- Set "endArrowhead": null, "startArrowhead": null.

═══════════════════════════════════
UNIVERSAL ELEMENT SCHEMAS
═══════════════════════════════════

RECTANGLE:
{
  "id": "el1", "type": "rectangle",
  "x": 100, "y": 100, "width": 160, "height": 60,
  "angle": 0, "seed": 123456, "version": 1, "versionNonce": 654321,
  "isDeleted": false, "groupIds": [], "boundElements": [],
  "updated": 1700000000000, "link": null, "locked": false,
  "strokeColor": "#333333", "backgroundColor": "#dbe9f9",
  "fillStyle": "solid", "strokeWidth": 2, "strokeStyle": "solid",
  "roughness": 1, "opacity": 100, "roundness": {"type": 3}
}

ELLIPSE:
{
  "id": "el2", "type": "ellipse",
  "x": 100, "y": 100, "width": 160, "height": 60,
  "angle": 0, "seed": 123457, "version": 1, "versionNonce": 654322,
  "isDeleted": false, "groupIds": [], "boundElements": [],
  "updated": 1700000000000, "link": null, "locked": false,
  "strokeColor": "#333333", "backgroundColor": "#dbe9f9",
  "fillStyle": "solid", "strokeWidth": 2, "strokeStyle": "solid",
  "roughness": 1, "opacity": 100, "roundness": {"type": 2}
}

DIAMOND (for decisions/conditions):
{
  "id": "el3", "type": "diamond",
  "x": 100, "y": 100, "width": 140, "height": 80,
  "angle": 0, "seed": 123458, "version": 1, "versionNonce": 654323,
  "isDeleted": false, "groupIds": [], "boundElements": [],
  "updated": 1700000000000, "link": null, "locked": false,
  "strokeColor": "#333333", "backgroundColor": "#fff3cd",
  "fillStyle": "solid", "strokeWidth": 2, "strokeStyle": "solid",
  "roughness": 1, "opacity": 100, "roundness": null
}

ARROW:
{
  "id": "ar1", "type": "arrow",
  "x": 100, "y": 200, "width": 160, "height": 0,
  "points": [[0, 0], [160, 0]],
  "angle": 0, "seed": 111111, "version": 1, "versionNonce": 222222,
  "isDeleted": false, "groupIds": [], "boundElements": [],
  "updated": 1700000000000, "link": null, "locked": false,
  "strokeColor": "#333333", "backgroundColor": "transparent",
  "fillStyle": "solid", "strokeWidth": 2, "strokeStyle": "solid",
  "roughness": 1, "opacity": 100, "roundness": {"type": 2},
  "lastCommittedPoint": null,
  "startArrowhead": null, "endArrowhead": "arrow", "elbowed": false,
  "startBinding": null, "endBinding": null
}

LINE:
{
  "id": "ln1", "type": "line",
  "x": 100, "y": 100, "width": 0, "height": 300,
  "points": [[0, 0], [0, 300]],
  "angle": 0, "seed": 333333, "version": 1, "versionNonce": 444444,
  "isDeleted": false, "groupIds": [], "boundElements": [],
  "updated": 1700000000000, "link": null, "locked": false,
  "strokeColor": "#333333", "backgroundColor": "transparent",
  "fillStyle": "solid", "strokeWidth": 1, "strokeStyle": "solid",
  "roughness": 1, "opacity": 100, "roundness": null,
  "lastCommittedPoint": null, "startArrowhead": null, "endArrowhead": null
}

TEXT:
{
  "id": "t1", "type": "text",
  "x": 100, "y": 100, "width": 160, "height": 25,
  "text": "My Label", "originalText": "My Label",
  "angle": 0, "seed": 555555, "version": 1, "versionNonce": 666666,
  "isDeleted": false, "groupIds": [], "boundElements": [],
  "updated": 1700000000000, "link": null, "locked": false,
  "strokeColor": "#1e1e1e", "backgroundColor": "transparent",
  "fillStyle": "solid", "strokeWidth": 1, "strokeStyle": "solid",
  "roughness": 1, "opacity": 100, "roundness": null,
  "fontSize": 16, "fontFamily": 1, "textAlign": "center",
  "verticalAlign": "middle", "containerId": null,
  "lineHeight": 1.25, "autoResize": true
}

"""

其他规则请查看 excalidraw_rules.py

设置

pip install -r requirements.txt

运行(Powershell)

python gemini_to_excalidraw.py --prompt "Draw a 3-tier web architecture" --output ./arch.excalidraw

目录标签

目录标签

图表生成开发工具Python本地部署文本转图表AI绘图工具Excalidraw集成开发辅助

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP