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 分