agent-draw MCP Server
A TypeScript stdio MCP server that lets agents read, import, propose connections for, and apply optimistic patches to versioned agent-draw diagram documents.
README
agent-draw
An agent-first technical canvas. Humans arrange and inspect a tldraw canvas; agents read and patch a renderer-independent, versioned graph document.
Alpha: the document boundary is deliberate; the plugin SDK and compatibility guarantees are still evolving.

The first vertical slice includes:
- a tldraw-based technical canvas with API, service, database, table, file, and external-system blocks;
- inspectable table columns and semantic edges for database ownership, service reads, and foreign-key references;
- custom React node shapes with named input/output handles and typed, snapping connections;
- canonical
agent-draw/0.1JSON with stable IDs, semantic edges, named views, capabilities, and forward-compatible extensions; agent-draw-patch/0.1operations with optimistic revision checks;- build-time plugin registration with namespaced node types and declared capabilities;
- an API inspector that edits and runs HTTP requests through a guarded local capability runtime;
- JSON import/export and browser-local persistence;
- a TypeScript CLI and stdio MCP server for agent-authored reads, imports, connection proposals, and optimistic patches.
Run it
Requirements: Node 20+ and pnpm.
pnpm install
pnpm dev
Open http://127.0.0.1:4173. The canvas runtime listens only on 127.0.0.1:4174 and Vite proxies /api to it.
Use the sample picker in the header, or open a sample directly:
/?sample=system-map/?sample=agent-loop/?sample=plugin-system/?sample=openapi-projects
pnpm test
pnpm typecheck
pnpm build
Agent workflow
- Export a
.agent-draw.jsondocument from the UI or read one from the project. - Preserve IDs and unknown
extensionsfields. - Prefer a small
agent-draw-patch/0.1proposal over rewriting the full document. - Set
baseRevisionto the source document's revision. - Change semantic fields separately from layout (
setLayout). - Validate before applying. A stale patch must be regenerated against the latest revision.
See the example patch and format reference.
The CLI exposes the same model operations used by the canvas:
pnpm agent-draw validate path/to/map.agent-draw.json
pnpm agent-draw import-openapi openapi.yaml -o map.agent-draw.json
pnpm agent-draw connect map.agent-draw.json \
--source service-api/calls \
--target database-projects/query \
-o connection.agent-draw-patch.json
pnpm agent-draw apply map.agent-draw.json connection.agent-draw-patch.json --write
MCP server
pnpm mcp runs the TypeScript stdio server. Point an MCP client at the project and confine its file access with AGENT_DRAW_ROOT:
{
"mcpServers": {
"agent-draw": {
"command": "pnpm",
"args": ["--dir", "/absolute/path/to/agent-draw", "mcp"],
"env": { "AGENT_DRAW_ROOT": "/absolute/path/to/your/project" }
}
}
}
The first tool set is intentionally graph-level: read_document, list_plugins, propose_connection, apply_patch, and import_openapi. See Agent tools.
Security model
Diagram files contain capability references, never credentials. The host owns capability grants. The MVP HTTP runtime:
- supports explicit HTTP methods only;
- blocks localhost, private, link-local,
.local, embedded credentials, redirects, and non-HTTP schemes; - limits input/body sizes, response size, and duration;
- executes only after the human presses Run request.
This is a useful baseline, not a production-grade network sandbox. A deployed version should also isolate execution, resolve DNS again at connection time, add per-space allowlists, and store auditable grants.
Architecture
src/model is the source of truth. src/canvasAdapter.ts is the tldraw adapter. src/plugins contains manifests and semantic helpers. src/runtime is the browser client; server is the trusted local capability runtime.
The canvas borrows React Flow's useful interaction semantics—visible handles, compatible endpoints, and typed connections—without adopting a second scene graph. tldraw owns selection, camera, spatial transforms, and rendering. The canonical Agent Draw document owns node IDs, ports, edges, and revisions. A UI gesture is translated into the same agent-draw-patch/0.1 proposal used by the CLI and MCP server.
The plugin boundary borrows BB's useful separation between a declarative manifest, frontend surfaces, and bounded host capabilities. It intentionally does not expose the tldraw store as a plugin contract.
Configurability direction
The current blocks are in-process TypeScript plugins. The intended next step is to make most blocks declarative without weakening the canonical model:
- Block schema: manifests declare fields, ports, defaults, appearance, and compatible relationships.
- Generated inspector: the host renders ordinary field editors from that schema; plugins provide custom React panels only for genuinely specialized interactions.
- Importers and adapters: SQL/ORM/OpenAPI/repository scanners translate external systems into stable nodes and patches with provenance.
- Host capabilities: blocks reference connector or secret IDs, while the trusted host owns credentials and approves runtime actions.
- Agent tools: MCP exposes the same schema catalog and patch operations as the UI, so agent-authored diagrams remain inspectable and reviewable.
This gives common blocks a low-code path while preserving typed escape hatches for API execution, live database inspection, and other richer utilities.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。