Can See

io.github.HurleySk由 GitHub 帳號 HurleySk 發布v0.4.0更新於 Oct 24, 2026

Let AI agents see and interact with terminal/CLI apps via PNG screenshots

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,在虛擬終端機中啟動終端機/CLI 應用程式,讓助理以 PNG 截圖查看畫面、讀取輸出並送出按鍵進行操作。

可以做什麼
在虛擬終端機工作階段中啟動 CLI 應用程式,並可列出、關閉單一或全部工作階段,查看程序狀態與結束碼。將終端機截取為 PNG 圖片,支援指定區域、依文字定位區域,以及與基準比較的差異圖。以純文字讀取可見緩衝區或回捲內容,並查詢儲存格的字元、顏色與屬性。等待指定文字出現、輸出閒置、某位置出現指定顏色或程序結束。送出按鍵與文字和應用程式互動。錄製影格並產生動畫 GIF。
適用情境
適合偵錯 TUI 應用程式、互動式 CLI 精靈,或任何視覺終端機輸出(顏色、版面、游標位置)比純文字更重要的情境。讓助理看到使用者所看到的畫面,並逐步完成互動式提示。
執行需求
以 npm 套件 can-see 透過 stdio 在本機執行(npx -y can-see 或全域安裝)。需要 Node.js,且需在本機編譯 node-canvas 與 node-pty,因此要安裝建置工具:Windows 上的 Visual Studio Build Tools、macOS 上的 Xcode Command Line Tools、Linux 上的 Cairo/Pango 開發函式庫。選用環境變數 DEFAULT_COLS、DEFAULT_ROWS 與 IDLE_TIMEOUT_MS 可調整終端機尺寸與閒置自動關閉。
安裝前請注意
launch 工具可啟動任意 CLI 程式,並接受 env 選項為其設定環境變數,send_keys/send_text 會操作這些程式,因此助理可以在你的機器上執行命令並改變狀態。工作階段會一直保留,直到被關閉或超過 IDLE_TIMEOUT_MS;用完請關閉。截圖與錄影可能擷取到敏感的終端機內容。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Can See,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

can-see

[npm version] [npm downloads] [license] [node]

MCP server that lets AI agents see and interact with terminal/CLI applications through virtual terminals and PNG screenshots.

Built for Claude Code and any MCP-compatible agent.

Why?

Some things are easier to show than describe. When debugging a TUI app, an interactive CLI wizard, or anything with visual terminal output, can-see lets the agent see exactly what you see — colors, layout, cursor position, and all.

How it works

  1. Launch a CLI app in a virtual terminal (node-pty + @xterm/headless)
  2. Screenshot the terminal as a PNG image (rendered via node-canvas)
  3. Send keys/text to interact with the app
  4. Screenshot again to see the result
  5. Close the session when done

Installation

bash
npm install -g can-see

Prerequisites

can-see depends on node-canvas (Cairo) and node-pty, which require native compilation. Most systems will need:

  • Windows: Visual Studio Build Tools (C++ workload) — npm install --global windows-build-tools or install from Visual Studio Installer
  • macOS: Xcode Command Line Tools — xcode-select --install
  • Linux: sudo apt install build-essential libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev

Configuration

Claude Code

Add to your project's .mcp.json:

json
{  "mcpServers": {    "can-see": {      "command": "npx",      "args": ["-y", "can-see"]    }  }}

Or if installed globally:

json
{  "mcpServers": {    "can-see": {      "command": "can-see"    }  }}

Other MCP clients

can-see uses stdio transport. Point your MCP client at the can-see binary or npx -y can-see.

Tools

ToolDescription
launchStart a CLI app in a virtual terminal. Returns a sessionId. Accepts optional env to set environment variables.
screenshotCapture the terminal as a PNG image.
screenshot_regionCapture a specific rectangular area of the terminal.
screenshot_text_regionFind text in the viewport and capture the surrounding area as a PNG.
capture_baselineSnapshot terminal state for later diff comparison.
diff_screenshotCompare current state against baseline with highlighted changes.
get_cell_infoQuery character, colors, and attributes at specific cell(s). Supports compact mode for reduced output.
read_textRead the terminal buffer as plain text.
read_scrollbackRead text that scrolled above the visible viewport.
wait_for_textWait until specific text appears in the terminal buffer.
wait_for_idleWait until terminal output has been stable for a given duration. Supports stableMs for content-comparison mode (for apps with timers/spinners), excludeRows to ignore specific rows, and excludePattern (regex) for dynamic row exclusion.
wait_for_colorWait until a specific color appears at a position.
wait_for_exitWait until the process exits and return its exit code and signal.
start_recordingBegin capturing frames for an animated GIF.
stop_recordingStop recording and return the animated GIF with metadata (frameCount, durationMs). Auto-trims frames or saves to file if GIF exceeds inline size limit.
send_keysSend keystrokes (e.g., Enter, Ctrl+C, ['Down', 'Down', 'Enter']).
send_textType a string of text into the app.
get_process_statusGet process status — distinguish "app is idle" from "app has exited". Returns PID, running state, exit code.
list_sessionsList all active terminal sessions.
closeKill the app and clean up. Always close when done.
close_allKill all active sessions at once. Useful for cleanup between test runs.

Supported keys

Enter, Tab, Escape, Backspace, Space, Up, Down, Left, Right, Home, End, Delete, PageUp, PageDown, Ctrl+A through Ctrl+Z.

Environment variables

VariableDefaultDescription
DEFAULT_COLS120Terminal width in columns
DEFAULT_ROWS30Terminal height in rows
IDLE_TIMEOUT_MS300000Auto-close idle sessions after this many ms (5 min)

Example usage

From an MCP-connected agent:

Agent: I'll launch your app to see what's happening.→ launch("node", ["app.js"])  → sessionId: "abc-123"
Agent: Let me wait for the app to start.→ wait_for_text("abc-123", "Ready")  → Found "Ready" after 1200ms
Agent: Let me read the current output.→ read_text("abc-123")  → "Welcome to MyApp\nReady\n> "
Agent: I can see the prompt. Let me select option 2.→ send_keys("abc-123", ["Down", "Enter"])
Agent: Waiting for the screen to settle.→ wait_for_idle("abc-123")  → Terminal idle for 520ms
Agent: Let me check the result.→ screenshot("abc-123")  → [PNG image showing result]
Agent: Done, closing the session.→ close("abc-123")

Changelog

0.5.0

New tools:

  • wait_for_exit — wait for process exit, get exit code and signal
  • close_all — kill all active sessions at once
  • get_process_status — distinguish "app is idle" from "app has exited"
  • screenshot_text_region — find text in viewport, capture surrounding area as PNG

Enhancements:

  • launch accepts env parameter for custom environment variables
  • wait_for_idle supports excludePattern (regex) for dynamic row exclusion in stableMs mode
  • stop_recording returns frameCount and durationMs metadata alongside GIF
  • get_cell_info supports compact option for reduced output ({char, fg, bold} only)

Bug fixes:

  • Fixed wait_for_text and wait_for_color race condition where text/color present in the final buffer was missed when the process exited simultaneously
  • Added mutual exclusion validation when both stableMs and idleMs are passed to wait_for_idle

License

MIT

來源:README.md,提交 98dd50b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分