screengrab-tool-mcp
Enables GitHub Copilot to capture screen content and interact with windows, providing visual context for coding assistance.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@screengrab-tool-mcpcapture my main monitor"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
screengrab-tool-mcp
A small Model Context Protocol server that
lets an LLM see what's on your screen — either an entire monitor or a
specific application window. The screen-capture tool is cross-platform; the
window-level tools are Windows-only and use pywin32 under the hood.
Built with the official mcp Python SDK, mss
for fast cross-platform capture, and Pillow for image processing. Packaged with
uv so it runs with one command via uvx.
Tools
capture_screen (cross-platform)
Capture an entire monitor and return a downsized PNG.
Parameter | Type | Default | Description |
| integer |
| Seconds to wait before capturing. Range |
| integer |
|
|
list_windows (Windows-only)
Enumerate visible top-level windows on the desktop, sorted most-recently-focused
first. Returns a JSON array of {hwnd, title, process, pid} so the model can
pick the one it wants. No parameters.
capture_window (Windows-only)
Capture a specific window matched by query string.
Parameter | Type | Default | Description |
| string | required | Title substring (case-insensitive) tried first; then process name (e.g. |
| string | Optional friendly name to store the resolved window under for the rest of this server process. Recall later via | |
| integer |
| Seconds to wait before capturing. Range |
The capture pipeline tries PrintWindow first (no focus disturb). If that
returns a near-blank frame — common with hardware-accelerated apps like
browsers and Electron — it falls back to briefly bringing the window forward,
grabbing its rect with mss, then restoring the previous foreground window.
capture_remembered (Windows-only)
Capture a previously remembered window by friendly name.
Parameter | Type | Default | Description |
| string | required | The name passed to |
| integer |
| Seconds to wait before capturing. Range |
Aliases live in process memory only — they vanish when the server restarts.
save_last_capture
Persists a recent capture from the in-memory ring buffer to a file in the workspace. Captures from capture_screen, capture_window, and capture_remembered are pushed into a 5-slot ring as a side effect; this tool writes one of them to disk.
Parameter | Type | Default | Description |
| int |
| Ring slot. |
| str | (auto) | Filename (no path separators). |
| str | (env or | Destination directory. |
Directory resolution: dir arg → SCREENGRAB_SAVE_DIR env var → ./screenshots/. Auto-created if missing. Filename collisions auto-suffix (foo.png → foo-1.png).
Returned images are downscaled with Pillow.Image.thumbnail((2000, 2000))
before being base64-encoded as a PNG, so you don't blow up the context window
with a raw 4K screen grab.
Related MCP server: MCP Screenshot Server
Install / run
You don't need to install anything globally. With uv
present on your PATH, the server runs straight from a local checkout via
uvx:
# from inside the project directory
uvx --from . screengrab-tool-mcpOr, once published to PyPI:
uvx screengrab-tool-mcpThe server speaks MCP over stdio. All logs go to stderr — never stdout — so it's safe to pipe directly into an MCP client.
Adding it to your MCP client
Claude Code (CLI)
claude mcp add screengrab -- uvx --from C:/Users/mahaffey/screengrab-tool-mcp screengrab-tool-mcpOr, if installed from PyPI:
claude mcp add screengrab -- uvx screengrab-tool-mcpTo remove it later:
claude mcp remove screengrabClaude Desktop
Edit your claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"screengrab": {
"command": "uvx",
"args": ["--from", "C:/Users/mahaffey/screengrab-tool-mcp", "screengrab-tool-mcp"]
}
}
}Once published to PyPI, simplify to:
{
"mcpServers": {
"screengrab": {
"command": "uvx",
"args": ["screengrab-tool-mcp"]
}
}
}VS Code / GitHub Copilot
Add to your .vscode/mcp.json (workspace) or user-level mcp.json:
{
"servers": {
"screengrab": {
"type": "stdio",
"command": "uvx",
"args": ["--from", "C:/Users/mahaffey/screengrab-tool-mcp", "screengrab-tool-mcp"]
}
}
}Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"screengrab": {
"command": "uvx",
"args": ["screengrab-tool-mcp"]
}
}
}Development
# install dependencies into a local venv
uv sync
# run directly
uv run screengrab-tool-mcp
# or run the module
uv run python -m screengrab_tool_mcp.serverProject layout
screengrab-tool-mcp/
├── pyproject.toml # uv / hatchling packaging + script entry point
├── README.md
├── src/
│ └── screengrab_tool_mcp/
│ ├── __init__.py
│ ├── server.py # MCP wiring, tool dispatch, stdio entry
│ ├── capture.py # capture_screen and capture_window pipelines
│ ├── windows.py # Win32 enumeration and query resolution
│ └── aliases.py # in-memory window-alias store
└── tests/
├── test_aliases.py
├── test_windows.py
└── test_capture.pyNotes & gotchas
stdout is sacred. The MCP stdio transport multiplexes JSON-RPC over stdout. The server configures
logging.basicConfig(stream=sys.stderr, ...)for exactly this reason. If you addprint(...)calls, route them tosys.stderror you will crash the connection.Permissions on macOS. macOS requires the parent process (Claude Desktop, VS Code, Terminal, etc.) to have Screen Recording permission in System Settings → Privacy & Security. Grant it once and restart the host.
Wayland on Linux.
mssuses X11. On a pure-Wayland session, capture will be limited to the Xwayland surface; XWayland or an X11 session works best.Display indexing.
mssusesmonitors[0]for the virtual all-monitors rectangle andmonitors[1..N]for individual displays. Index1is the primary display.Window tools are Windows-only.
list_windows,capture_window, andcapture_rememberedusepywin32and assume a real interactive desktop session. They will return a clear error on non-Windows hosts.capture_screenremains cross-platform.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jaimemahaffey/screengrab-tool-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server