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(透過區域網路提供頁面並回傳 QR code,方便觸控繪製)、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 分

    請在儲存庫或註冊中心條目中宣告授權條款。