excalidraw-diagram-agent
Generates editable Excalidraw diagram files from natural language descriptions of systems and architectures.
README
Built as a portfolio project proving MCP breadth beyond data-query tools: this server takes a described system and produces a real, editable diagram file — not a data lookup, a generative/creative tool exposed the same way as the data-query MCP server in this portfolio.
excalidraw-diagram-agent
An MCP server that turns a described system into a real, editable
.excalidraw diagram file. Describe an architecture in Claude Desktop
("draw me a diagram of a client talking to an API gateway, which routes to
an auth service and an order service, both writing to Postgres") and get
back a file you can open and keep editing in Excalidraw.
What's here
layout.py— a simple layered graph layout (no external graph library): positions nodes left-to-right by distance from a root, stacked vertically within each layer.excalidraw_gen.py— builds valid.excalidrawJSON: rectangles with properly bound text labels (they move together in the editor) and arrows with realstartBinding/endBinding(they stay attached when you drag a box) — not just static lines dropped at fixed coordinates.server.py— the MCP server, one tool:generate_diagram(title, nodes, edges).requirements.txt— one dependency, pinned.
1. Setup
cd excalidraw-diagram-agent
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
2. Test it standalone (no Claude needed yet)
python3 -c "
from server import generate_diagram
print(generate_diagram(
title='Order Processing System',
nodes=[
{'id': 'client', 'label': 'Web Client'},
{'id': 'gateway', 'label': 'API Gateway'},
{'id': 'auth', 'label': 'Auth Service'},
{'id': 'orders', 'label': 'Order Service'},
{'id': 'db', 'label': 'Postgres DB'},
],
edges=[
{'from': 'client', 'to': 'gateway'},
{'from': 'gateway', 'to': 'auth'},
{'from': 'gateway', 'to': 'orders'},
{'from': 'auth', 'to': 'db'},
{'from': 'orders', 'to': 'db'},
],
))
"
Should print a confirmation with the file path. Open the generated file at
excalidraw.com (File > Open, or just drag the .excalidraw file onto
the page) to see the actual diagram.
3. Connect it to Claude Desktop
Same pattern as the rental-data MCP server (project 1) — add a second
entry to the same config file, ~/Library/Application Support/Claude/claude_desktop_config.json,
alongside your existing mcpServers block:
"diagram-agent": {
"command": "/absolute/path/to/excalidraw-diagram-agent/venv/bin/python3",
"args": ["/absolute/path/to/excalidraw-diagram-agent/server.py"]
}
(Both servers can live in the same mcpServers object — don't replace
rental-data, add diagram-agent next to it.) Fully quit and reopen
Claude Desktop, then check Settings > Developer to confirm both show as
running.
4. Demo prompts
- "Draw me a diagram of a typical 3-tier web app: client, API server, database"
- "Diagram a CI/CD pipeline: developer pushes to Git, triggers a build, runs tests, then deploys to staging and production"
- "Show me an event-driven architecture with a producer, a message queue, and two consumers"
Claude will figure out the nodes and edges from your description and call the tool — you're not writing the JSON yourself, that's the point. Open the resulting file at excalidraw.com to show it's a real, editable diagram, not a static image.
Architecture notes
- Why a real Excalidraw file, not just a picture: an LLM could
describe a diagram in words, or even generate an SVG. Producing an
actual
.excalidrawfile with correct element bindings means the output is a genuine editable artifact — drag a box, the arrows and label follow. That's a meaningfully different (and harder) target than a static image. - Layout: intentionally simple (layered left-to-right) rather than a general-purpose graph layout library — sufficient for the kind of system/architecture diagrams this tool is aimed at, and keeps the dependency list at just the MCP SDK.
- Validation:
server.pychecks that every edge references a real node id before generating anything, returning a clear error instead of producing a broken file.
Repo structure
excalidraw-diagram-agent/
├── README.md
├── requirements.txt
├── layout.py
├── excalidraw_gen.py
├── server.py
└── outputs/ (generated .excalidraw files, gitignored)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。