A
securityA
licenseA
qualityProvides HTML file preview and analysis capabilities. This server enables capturing full-page screenshots of local HTML files and analyzing their structure.
Last updated -
2
8
JavaScript
MIT License
该项目提供了一个 MCP(模块化通信协议)服务器,旨在捕获屏幕截图并方便其他进程或 AI 助手使用,主要通过将屏幕截图保存到客户端(主机)指定的文件路径来实现。
测试证明,直接解读 AI 助手通过 MCP 发送的截图图像数据并不可靠。此服务器采用了更稳健的工作流程,专注于文件路径:
推荐的工作流程(WSL 主机 -> Windows Server):
save_screenshot_to_host_workspace
工具,并提供其WSL 工作区路径作为参数。\\wsl$\Distro\path
)。"success"
或"failed:..."
。替代工作流程(常规):
take_screenshot_and_return_path
,可选择指定文件名。images/
目录。该服务器提供以下工具,按推荐用途排序:
save_screenshot_to_host_workspace(host_workspace_path: str, name: str = "workspace_screenshot.jpg")
host_workspace_path
(str):主机工作区的绝对 WSL 路径(例如, /home/user/project
)。name
( str ,可选):文件名。默认为workspace_screenshot.jpg
。str
- "success"
或"failed: [error message]"
。take_screenshot_and_return_path(name: str = "latest_screenshot.jpg")
images/
目录,并返回绝对路径(通常是 Windows 路径)。当调用者需要该路径进行外部处理时,此功能非常有用。name
( str ,可选):文件名。默认为latest_screenshot.jpg
。str
- 绝对路径或"failed: [error message]"
。take_screenshot_path(path: str = "./", name: str = "screenshot.jpg")
path
(str, 可选): 目标目录(Windows 或 UNC 路径)。默认为服务器的工作目录。name
( str ,可选):文件名。默认为screenshot.jpg
。str
- "success"
或"failed: [error message]"
。uv
安装:mcp[cli]>=1.4.1
、 pyautogui
和Pillow
。该服务器通常由MCP 主机根据其配置启动。
关键点:要捕获Windows 屏幕,此screenshot.py
服务器必须直接在 Windows 上运行。
推荐的 WSL2 主机 -> Windows Server 设置:
screenshot-server
项目文件夹放在您的Windows 文件系统上(例如, C:\Users\YourUser\projects\screenshot-server
)。uv
和项目依赖项( uv sync ...
)。mcp_settings.json
(或等效文件):/home/user/current_project
)。use_mcp_tool
在Screenshot-server
上调用save_screenshot_to_host_workspace
,并传递host_workspace_path="/home/user/current_project"
以及可选的name
。"success"
。/home/user/current_project/workspace_screenshot.jpg
(或指定的名称)。use_mcp_tool
调用图像分析服务器/工具(也在 WSL 中运行),传递 WSL 路径/home/user/current_project/workspace_screenshot.jpg
。screenshot.py
:核心 MCP 服务器脚本。README.md
:此文档文件。pyproject.toml
: uv
的项目定义和依赖项。uv.lock
:依赖锁文件。.gitignore
:Git 忽略配置。.python-version
:(可选)Python 版本说明符。server.log
:服务器生成的日志文件。images/
: take_screenshot_and_return_path
的默认目录。This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
捕获屏幕截图并将其保存到客户端应用程序指定的文件路径,主要是为了方便在 WSL 环境中运行的 AI 助手进行屏幕截图分析。
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/KunihiroS/screenshot-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server