can-see
MCP server that lets AI agents see and interact with terminal/CLI applications through virtual terminals and PNG screenshots.
README
can-see
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
- Launch a CLI app in a virtual terminal (node-pty + @xterm/headless)
- Screenshot the terminal as a PNG image (rendered via node-canvas)
- Send keys/text to interact with the app
- Screenshot again to see the result
- Close the session when done
Installation
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-toolsor 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:
{
"mcpServers": {
"can-see": {
"command": "npx",
"args": ["-y", "can-see"]
}
}
}
Or if installed globally:
{
"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
| Tool | Description |
|---|---|
launch |
Start a CLI app in a virtual terminal. Returns a sessionId. Accepts optional env to set environment variables. |
screenshot |
Capture the terminal as a PNG image. |
screenshot_region |
Capture a specific rectangular area of the terminal. |
screenshot_text_region |
Find text in the viewport and capture the surrounding area as a PNG. |
capture_baseline |
Snapshot terminal state for later diff comparison. |
diff_screenshot |
Compare current state against baseline with highlighted changes. |
get_cell_info |
Query character, colors, and attributes at specific cell(s). Supports compact mode for reduced output. |
read_text |
Read the terminal buffer as plain text. |
read_scrollback |
Read text that scrolled above the visible viewport. |
wait_for_text |
Wait until specific text appears in the terminal buffer. |
wait_for_idle |
Wait 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_color |
Wait until a specific color appears at a position. |
wait_for_exit |
Wait until the process exits and return its exit code and signal. |
start_recording |
Begin capturing frames for an animated GIF. |
stop_recording |
Stop recording and return the animated GIF with metadata (frameCount, durationMs). Auto-trims frames or saves to file if GIF exceeds inline size limit. |
send_keys |
Send keystrokes (e.g., Enter, Ctrl+C, ['Down', 'Down', 'Enter']). |
send_text |
Type a string of text into the app. |
get_process_status |
Get process status — distinguish "app is idle" from "app has exited". Returns PID, running state, exit code. |
list_sessions |
List all active terminal sessions. |
close |
Kill the app and clean up. Always close when done. |
close_all |
Kill 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
| Variable | Default | Description |
|---|---|---|
DEFAULT_COLS |
120 |
Terminal width in columns |
DEFAULT_ROWS |
30 |
Terminal height in rows |
IDLE_TIMEOUT_MS |
300000 |
Auto-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 signalclose_all— kill all active sessions at onceget_process_status— distinguish "app is idle" from "app has exited"screenshot_text_region— find text in viewport, capture surrounding area as PNG
Enhancements:
launchacceptsenvparameter for custom environment variableswait_for_idlesupportsexcludePattern(regex) for dynamic row exclusion in stableMs modestop_recordingreturnsframeCountanddurationMsmetadata alongside GIFget_cell_infosupportscompactoption for reduced output ({char, fg, bold}only)
Bug fixes:
- Fixed
wait_for_textandwait_for_colorrace condition where text/color present in the final buffer was missed when the process exited simultaneously - Added mutual exclusion validation when both
stableMsandidleMsare passed towait_for_idle
License
MIT
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。