Save the system clipboard image to a file via an MCP server, for AI agents that can read image files but not the clipboard.
Project description
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) orxclipfor the clipboard fallback.
Install from PyPI
Run directly with uv (no install step):
uvx clipgrab-mcp
Or install with pip:
pip install clipgrab-mcp
clipgrab-mcp
Setup from source
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 theCLIPGRAB_DEFAULT_DIRenvironment variable.filename— defaults to a timestamped name (clipboard-YYYYMMDD-HHMMSS).image_format—"png"(default) or"jpg".
clipboard_has_image()→ returnstrue/false.
Run manually (stdio)
./.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:
- Open this folder in VS Code and press
F5to launch the Extension Development Host. - In that window, open Chat (agent mode); the
ClipGrabMCP server and itssave_clipboard_imagetool are available.
Package a .vsix for sharing:
npm install -g @vscode/vsce
vsce package
VS Code configuration (without the extension)
A ready-to-use config lives in .vscode/mcp.json:
{
"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:
{
"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 towl-paste/xclip.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clipgrab_mcp-0.1.0.tar.gz.
File metadata
- Download URL: clipgrab_mcp-0.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e359c50cbb526f060304cfa748b4bffce827767b3e020fc0e1709e5a1b8b1e5d
|
|
| MD5 |
dee894df055c037d7112d14eac17fe33
|
|
| BLAKE2b-256 |
062a223987ade6d2e0e40e930c09fbecb3687f30bc0a72b172506f23c6885e55
|
File details
Details for the file clipgrab_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: clipgrab_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dc20972a84a53e562b8eb15eda13258ef94327e84758be8330b960d3545f0dd
|
|
| MD5 |
b1a2fae94c613fbddbca0a347ee11b41
|
|
| BLAKE2b-256 |
10eb46d815ccf380f853df21e834a1a5a640d3417467fd14acce644c6df701d6
|