WinSight MCP
mcp名称:io.github。TheoEwzZer/winsight
Windows屏幕捕获MCP服务器——让Claude Code看到您的Windows桌面。
WinSight是一个 主控程序 允许Claude Code捕获您的屏幕、管理窗口和在windows上启动应用程序的服务器。
特性
- 截图 全屏、特定区域或特定窗口
- 窗口捕获 使用Win32
PrintWindowAPI-捕获真实的窗口内容,即使它位于其他窗口后面 - 列出并检查 打开窗口和监视器(标题、位置、大小、状态、分辨率)
- 控制窗口 --移动、调整大小、最小化、最大化、恢复和聚焦
- 发射 应用程序并等待其窗口
需求
- Windows 10/11
- Python 3.10+
快速开始
选项1:uvx(推荐)
无需安装--直接运行:
{
"mcpServers": {
"winsight": {
"command": "uvx",
"args": ["winsight-mcp"]
}
}
}将此添加到您的项目 .mcp.json 或 ~/.claude/claude_desktop_config.json.
选项2:pip安装
pip install winsight-mcp然后配置:
{
"mcpServers": {
"winsight": {
"command": "winsight-mcp"
}
}
}选项3:来源
git clone https://github.com/TheoEwzZer/WinSight-MCP.git
cd WinSight-MCP
uv sync{
"mcpServers": {
"winsight": {
"command": "uv",
"args": ["--directory", "/path/to/WinSight-MCP", "run", "winsight-mcp"]
}
}
}工具
截图
| 工具 | 说明 |
|---|---|
take_screenshot | 捕获全屏或特定监视器 |
screenshot_window | 按标题捕获特定窗口(即使在其他窗口后面也有效) |
screenshot_region | 捕捉屏幕的矩形区域 |
窗口管理
| 工具 | 说明 |
|---|---|
list_windows | 列出所有带有可选标题过滤器的可见窗口 |
get_window_info | 获取窗口的详细信息(位置、大小、状态) |
focus_window | 把窗户带到前台 |
resize_window | 将窗口调整为特定尺寸 |
move_window | 将窗口移动到特定位置 |
minimize_window | 将窗口最小化到任务栏 |
maximize_window | 最大化窗口以填充屏幕 |
restore_window | 将最小化或最大化窗口恢复到正常状态 |
wait_for_window | 等待窗口出现(带超时的自适应轮询) |
系统
| 工具 | 说明 |
|---|---|
list_monitors | 列出所有具有分辨率、位置和主标志的监视器 |
open_application | 启动应用程序,并可选择等待其窗口 |
例子
连接MCP服务器后,您可以向Claude Code询问以下问题:
- “截取我的屏幕截图”
- “列出所有打开的窗口”
- “捕获记事本窗口”
- “打开计算器并截图”
- “聚焦Chrome窗口”
- “将应用程序窗口大小调整为800x600并截图”
- “将窗口移到左上角”
- “我有什么显示器?”
测试
该项目有112个测试,涵盖所有模块。测试使用Win32 API的模拟,因此它们可以在任何平台上运行。
运行测试
uv run pytest测试结构
tests/
conftest.py # Shared fixtures and Win32 stubs
test_types.py # TypedDict definitions validation
test_screenshot.py # Screen/region/window capture (mss, Win32 DC)
test_window_manager.py # Window listing, find, focus, resize, move, min/max/restore
test_process_manager.py # Application launch and window polling
test_server.py # MCP tool registration and integration添加测试
- 在匹配中加入新的测试
test_.py文件 - 使用来自的共享装置
conftest.py(sample_window_info,mcp_server,fake_png_bytes) - 模拟Win32 API
@patch("winsight_mcp..win32gui")--永远不要在测试中调用真正的Win32函数 - 对于服务器集成测试,请使用
_call调用工具和_text提取字符串结果
许可证
麻省理工学院
