这个实时查看器解决了在Cursor等AI工具中执行长时间命令时看不到实时输出的问题。通过WebSocket技术,您可以在浏览器中实时监控命令执行进度。
Windows用户:
# 双击运行
start-realtime-viewer.bat
# 或者手动运行
cd realtime-viewer
npm install
npm startLinux/Mac用户:
cd realtime-viewer
npm install
npm start启动后,在浏览器中访问:
http://localhost:3000
在Cursor或其他AI工具中,使用以下命令启用实时推送:
configure_realtime_viewer action=enable
或者配置自定义查看器URL:
configure_realtime_viewer action=configure viewer_url=http://localhost:3000
现在当您执行交互式命令时,输出将实时显示在Web界面中:
start_interactive_command command="nmap -sS -O 192.168.1.1"
- 📊 会话列表 - 左侧显示所有活跃的命令会话
- 📺 实时输出 - 右侧显示选中会话的实时命令输出
- 🔄 自动滚动 - 可选的自动滚动到最新输出
- 🎨 VS Code风格 - 深色主题,类似VS Code的界面
- 📱 响应式设计 - 支持不同屏幕尺寸
configure_realtime_viewer action=status
configure_realtime_viewer action=enable
configure_realtime_viewer action=disable
configure_realtime_viewer action=configure viewer_url=http://localhost:3000
start_interactive_command command="nmap -sS -p- 192.168.1.0/24"
在Web界面中实时查看扫描进度和结果。
start_interactive_command command="nikto -h http://target.com"
实时监控漏洞扫描的发现过程。
start_interactive_command command="hydra -l admin -P /usr/share/wordlists/rockyou.txt ssh://192.168.1.100"
实时查看密码破解尝试的进度。
start_interactive_command command="mysql -u root -p"
在Web界面中查看SQL查询的执行结果。
您可以通过环境变量配置MCP服务器:
# 启用实时推送(默认禁用)
set REALTIME_PUSH_ENABLED=true
# 配置查看器URL(默认 http://localhost:3000)
set REALTIME_VIEWER_URL=http://localhost:8080
# 重新启动MCP服务器
npm run build
npm start- 确保实时查看器服务器正在运行(http://localhost:3000)
- 检查防火墙设置
- 确认端口3000未被其他程序占用
- 确认已启用实时推送:
configure_realtime_viewer action=status - 检查MCP服务器日志中的错误信息
- 确认命令是通过
start_interactive_command启动的
- 对于输出量很大的命令,系统会自动缓冲输出以减少网络请求
- 可以通过清空输出按钮清理界面
- 关闭不需要的会话以释放资源
┌─────────────────┐ HTTP/WebSocket ┌──────────────────┐
│ MCP Server │ ──────────────────► │ Realtime Viewer │
│ │ │ │
│ - CommandExecutor│ │ - Express Server │
│ - RealtimePusher │ │ - WebSocket │
│ - SSH Sessions │ │ - Web Interface │
└─────────────────┘ └──────────────────┘
│ │
│ SSH │ Browser
▼ ▼
┌─────────────────┐ ┌──────────────────┐
│ Kali Linux │ │ Web Browser │
│ │ │ │
│ - Security Tools│ │ - Real-time UI │
│ - Command Line │ │ - Session Mgmt │
└─────────────────┘ └──────────────────┘
- 本地使用 - 实时查看器默认只监听localhost,不对外网开放
- 无认证 - 当前版本没有身份验证,请勿在生产环境使用
- 敏感信息 - 命令输出可能包含敏感信息,请注意保护
- 网络安全 - 如需远程访问,请配置适当的网络安全措施
- 初始版本发布
- 支持实时命令输出显示
- WebSocket通信
- 多会话管理
- VS Code风格界面