Draw2agent

io.github.zero-abd由 GitHub 账号 zero-abd 发布v1.3.4更新于 Oct 24, 2026

Draw on your website, let your AI agent see it. Visual context for code generation via MCP.

已验证STDIO仅桌面浏览器自动化开发者工具

概览

AI 生成的概览

让助手打开本地开发页面并叠加绘图层,然后读取你的标注、截图和 DOM 数据来进行代码修改。

可以做什么
Draw2agent 会代理你本机的 localhost 开发服务器,并注入一层透明的 Excalidraw 画布,让你在运行中的页面上画圈、箭头和文字。工具包括 launch_canvas、launch_ipad_canvas(通过局域网提供页面并返回二维码,便于触屏绘制)、launch_scratch(空白白板,用于画草图),以及 get_drawing_state,用于返回最近一次的截图、DOM 节点和标注。启动类工具会一直阻塞,直到你提交绘制内容。
适用场景
当你不想用文字描述,而是想直接指向运行中网页的某个元素时适用,例如界面修复、布局反馈,或先画一个草图让助手实现。
运行要求
以 npm 包 draw2agent 通过 stdio 在本地运行,通常用 npx 启动,因此需要 Node.js。它需要一个本地开发服务器作为代理目标;iPad/手机模式要求手机与电脑处于同一 Wi-Fi 网络。未声明任何账号、API 密钥或环境变量。
安装前请注意
该服务器会代理你的本地开发页面,并截取截图和 DOM 内容传给 IDE 助手,因此不要在包含敏感数据的页面上绘制。局域网模式会把被代理的页面暴露给同一网络中的其他设备。仅支持桌面端,不提供网页版。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Draw2agent,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

draw2agent ✏️

[npm version] [mcp-registry]

Draw on your website. Your AI agent sees it.

draw2agent is an MCP server that lets you draw annotations directly on top of your local dev page. When you submit, your IDE agent receives a screenshot, structured DOM data, and annotation context to make precise code edits.

👉 Try it out at: draw2agent.vercel.app

Demo

[draw2agent demo video]

Quick Start

1. Add to your IDE (one-time)

Cursor (~/.cursor/mcp.json):

json
{  "mcpServers": {    "draw2agent": {      "command": "npx",      "args": ["-y", "draw2agent@latest"]    }  }}

2. Use it

Tell your agent:

"Use draw2agent to fix the navbar"

  1. 🌐 Agent opens your browser with drawing tools on your page
  2. ✏️ Draw circles, arrows, text directly on your website
  3. 📸 Click Submit
  4. 🤖 Agent reads the visual context and applies code changes

How It Works

Your Dev Page (proxied)├── Your original page content└── Excalidraw overlay (transparent, on top)    ├── Draw mode: annotate directly on the page    ├── Select mode: interact with the page normally (Esc)    └── Submit: screenshot + DOM + annotations → agent

Tools

The MCP server exposes the following tools:

ToolDescription
launch_canvasOpens your dev page with the drawing overlay
launch_ipad_canvasServes the page on your LAN and returns a QR code for drawing from iPad/mobile
launch_scratchOpens a standalone Excalidraw whiteboard for freehand sketching
get_drawing_stateReturns screenshot, DOM nodes, and annotations for the current state

launch_canvas

The core tool — proxies your localhost dev server and injects an Excalidraw overlay. Draw annotations directly on your running app, then submit to send visual context to your agent. The tool blocks until you submit.

launch_ipad_canvas

Same as launch_canvas, but serves the proxy on your computer's local network (LAN) address. Automatically opens a new browser tab on your computer with a QR code. Scan it from your iPad or phone — connected to the same Wi-Fi network — to draw annotations with touch. Perfect for whiteboard-style feedback sessions. No internet tunnel required, so it's fast and reliable.

launch_scratch

Opens a blank Excalidraw whiteboard — no target URL needed. Sketch UI mockups, wireframes, or diagrams from scratch. Your agent receives the drawing and implements the design.

get_drawing_state

Returns the last captured drawing state (screenshot, DOM nodes, annotations) without launching a new session. Useful for re-fetching context.

Releasing

Publishing to npm is automated via GitHub Actions (.github/workflows/publish.yml). To cut a release, just bump the version and push to main:

bash
npm version patch   # or minor / major — updates package.jsongit push origin main

When package.json's version changes on main, the workflow builds the server + overlay and publishes the new version to npm. You can also trigger it manually from the Actions tab (e.g. to publish the current version).

One-time setup: npm Trusted Publishing

The workflow authenticates with npm via OIDC — no NPM_TOKEN secret needed. Configure the trusted publisher once:

  1. Go to npmjs.com/package/draw2agent → Settings → Trusted Publisher.
  2. Choose GitHub Actions and enter:
    • Organization or user: zero-abd
    • Repository: draw2agent
    • Workflow filename: publish.yml
  3. Save.

This also satisfies npm's 2FA requirement, so publishing works even with account 2FA enabled. (Alternative: create an npm Granular Access Token with publish rights, add it as the NPM_TOKEN repo secret, and set NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} on the publish step instead.)

License

MIT

来源:README.md,提交 f5b0d57

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.3.4最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。