ClipGrab

io.github.ulebule由 GitHub 账号 ulebule 发布v0.1.0更新于 Oct 24, 2026

Save the system clipboard image to a PNG or JPG file for AI agents.

已验证STDIO仅桌面文件与存储

概览

AI 生成的概览

把系统剪贴板中的图片保存为 PNG 或 JPG 文件并返回路径,供助手打开。

可以做什么
ClipGrab 提供两个工具:save_clipboard_image 会把剪贴板图片写入磁盘并返回绝对路径,clipboard_has_image 用于判断剪贴板中是否有图片。保存工具可选传入目录、文件名和图片格式(默认 png,也可选 jpg)。默认保存到当前工作目录,文件名带时间戳。
适用场景
适合助手能读取图片文件却无法访问系统剪贴板的场景,例如把你刚复制的截图变成助手可打开的文件。它是一个单一用途的小工具,而非通用图像处理工具。
运行要求
以 stdio 方式在本地运行的进程,仅支持桌面端。需要 Python 3.10+ 以及 Pillow 和 mcp[cli],可用 uvx clipgrab-mcp 或 pip install clipgrab-mcp 运行。Linux 上还需要 wl-clipboard(wl-paste)或 xclip 作为剪贴板回退方案。未声明账号、密钥或请求头;可选环境变量 CLIPGRAB_DEFAULT_DIR 用于设置默认输出目录。
安装前请注意
它会读取系统剪贴板,其中可能包含敏感内容,并把图片写入磁盘,默认写入助手当前工作目录,目录不存在时会自动创建。建议把目录或 CLIPGRAB_DEFAULT_DIR 指向你可接受的位置,并注意调用时剪贴板上的内容都会被保存。

安装

在 SourceWeft 中

  1. 打开 控制台中的 ClipGrab,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

ClipGrab

mcp-name: io.github.ulebule/clipgrab

An MCP server that saves the image currently on the system clipboard to a file (PNG or JPG).

Why

Many AI agents can read image files but cannot access the system clipboard. ClipGrab bridges that gap: copy an image (e.g. a screenshot), call the tool, and get back a path to a saved image on disk that the agent can open.

By default the image is saved to the current working directory — the folder the agent runs from.

Requirements

  • Python 3.10+
  • Python packages (see requirements.txt): Pillow, mcp[cli]
  • Linux only: wl-clipboard (wl-paste) or xclip for the clipboard fallback.

Install from PyPI

Run directly with uv (no install step):

bash
uvx clipgrab-mcp

Or install with pip:

bash
pip install clipgrab-mcpclipgrab-mcp

Setup from source

bash
python3 -m venv .venv./.venv/bin/pip install -r requirements.txt

Tools

  • save_clipboard_image(directory?, filename?, image_format?) → saves the clipboard image and returns the absolute path.
    • directory — defaults to the current working directory (created if missing). Can also be set via the CLIPGRAB_DEFAULT_DIR environment variable.
    • filename — defaults to a timestamped name (clipboard-YYYYMMDD-HHMMSS).
    • image_format — "png" (default) or "jpg".
  • clipboard_has_image() → returns true/false.

Run manually (stdio)

bash
./.venv/bin/python mcp_server.py

Install as a VS Code extension

ClipGrab ships as a VS Code extension that registers the MCP server automatically — it then appears under Extensions view → MCP Servers and starts on demand. On first use the extension creates its own Python virtual environment and installs the dependencies, so you only need Python 3.10+ on your PATH (configurable via the clipgrab.pythonPath setting).

Develop / try it:

  1. Open this folder in VS Code and press F5 to launch the Extension Development Host.
  2. In that window, open Chat (agent mode); the ClipGrab MCP server and its save_clipboard_image tool are available.

Package a .vsix for sharing:

bash
npm install -g @vscode/vscevsce package

VS Code configuration (without the extension)

A ready-to-use config lives in .vscode/mcp.json:

jsonc
{  "servers": {    "clipgrab": {      "command": "/absolute/path/to/.venv/bin/python",      "args": ["/absolute/path/to/mcp_server.py"],      "cwd": "${workspaceFolder}"    }  }}

Then open .vscode/mcp.json and start the clipgrab server (or use the Command Palette → "MCP: List Servers").

Use with an MCP client

Point any MCP client at the published PyPI package over stdio:

jsonc
{  "servers": {    "clipgrab": {      "command": "uvx",      "args": ["clipgrab-mcp"]    }  }}

ClipGrab is described for registries by server.json and is published to the official MCP registry under the name io.github.ulebule/clipgrab.

Technical notes

  • Cross-platform image grab: Pillow ImageGrab.grabclipboard() (Windows / macOS, and Linux with a recent Pillow). On Linux it falls back to wl-paste / xclip.

License

MIT

来源:README.md,提交 ff6b8e0

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分