Grabitar is an injectable overlay that works on ANY webpage, allowing you to capture content, annotate it, and paste directly into VS Code Copilot chat. It integrates with GitHub Copilot via the Model Context Protocol (MCP).
- ๐ Injectable Anywhere: Works on any webpage via bookmarklet or script tag
- ๏ฟฝ @grabitar Chat Participant: Direct integration in Copilot chat - no clipboard needed!
- ๐ฑ๏ธ Right-Click Context Menu: Access capture tools with right-click
- ๐๏ธ Floating Controls: Draggable toolbar always accessible
- ๐ธ Smart Capture: Select regions or capture full page
- ๐จ Live Annotations: Add boxes and text directly on page
- ๐ Clipboard Integration: Copy and paste into Copilot chat
- ๐ค VS Code MCP Integration: Installable MCP server + chat participant
- ๐ Universal: Works in dev containers and local environments
- โก Zero Config: Easy one-click injection
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Browser Page (localhost:9876) โ
โ - Floating overlay controls โ
โ - Right-click context menu โ
โ - Canvas for annotations โ
โ - html-to-image for screenshots โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ HTTP API
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Server (server.py --mcp) โ
โ - Stores captures & annotations โ
โ - Makes them available to VS Code โ
โ - Provides Copilot chat tools โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Add to VS Code settings.json:
{
"mcp.servers": {
"grabitar": {
"command": "/workspaces/grabitar/.venv/bin/python",
"args": ["/workspaces/grabitar/server.py", "--mcp"],
"cwd": "/workspaces/grabitar"
}
}
}Note: If using a different virtual environment or system Python, adjust the command path accordingly. In dev containers, use the full path to the virtual environment's Python executable.
cd /workspaces/grabitar
python server.pyServer runs on http://localhost:9876
In VS Code Copilot chat, ask:
get grabitar bookmarklet
Copy the bookmarklet code and save it as a browser bookmark.
Option A: Bookmarklet (Universal)
- Navigate to any webpage
- Click your Grabitar bookmarklet
- Overlay appears!
Option B: Inject into Your App Add to your HTML:
<script src="http://localhost:9876/static/grabitar-inject.js"></script>Option C: Console (One-time) Open console (F12) and paste:
var s=document.createElement('script');
s.src='http://localhost:9876/static/grabitar-inject.js';
document.body.appendChild(s);Option A: Direct to Chat (VS Code Extension)
- Right-click anywhere โ Capture Window
- Open Copilot chat
- Type:
@grabitar /latest - Ask questions about the image!
Option B: Clipboard Method
- Right-click anywhere โ Capture Window
- Optionally add annotations
- Right-click โ Copy to Clipboard
- Paste in Copilot (Ctrl+V)
- Ask questions about the image!
๐ Full Guide: See INSTALL.md for detailed setup
Capture Window (Full Screen):
- Right-click anywhere
- Select "๐ผ๏ธ Capture Window"
- The overlay hides briefly and captures your screen
- A notification shows the capture ID
Capture Area (Region):
- Right-click anywhere
- Select "๐ท Capture Area"
- Click and drag to select the region
- Release to complete the capture
Add Box Annotation:
- First, capture a screen (you'll get a capture ID)
- Right-click and select "โฌ Add Square"
- Click and drag to draw a box
- The box is added to your capture
Add Text Annotation:
- First, capture a screen
- Right-click and select "๐ Add Text Annotation"
- Type your text in the dialog
- Click where you want the text placed
With @grabitar Chat Participant (Recommended):
Once you've captured, simply open Copilot chat and type:
@grabitar /latest
The capture appears instantly with full image context. Then ask questions:
@grabitar /latest What's wrong with this UI?
@grabitar /latest Suggest CSS fixes for the layout
@grabitar /show capture_001 Analyze this design
With MCP Tools (Alternative):
Once you've captured and annotated, the capture is available in VS Code. In Copilot chat, you can reference it:
Show me capture_2024_02_26_123456
What's wrong with this UI element?
Analyze the layout in my capture
- Ctrl+Q - Quit the overlay
- ESC - Cancel current selection
The test page at http://localhost:9876 is a simple webpage designed for testing captures:
- Multiple colored cards to practice area selection
- Different elements with varying styles
- Instructions on how to use the overlay
- Visual targets for annotation practice
It's not the main interface - it's just a test target!
- overlay.py - Main overlay GUI (Tkinter-based)
- server.py - MCP server + test page web server
- capture_manager.py - Screen capture and annotation logic
- annotations.py - Annotation data models
- static/index.html - Test webpage
- static/style.css - Test page styles
- static/app.js - Test page scripts (minimal)
Capture a screenshot.
Parameters:
monitor(optional): Monitor number (0 = primary, 1+ = additional)region(optional):{x, y, width, height}for specific areacapture_id(optional): Custom ID for the capture
Example:
Capture my screen
Add a box/rectangle annotation.
Parameters:
capture_id: ID of capture to annotatex,y: Position of top-left cornerwidth,height: Box dimensionscolor(optional): Color name (default: "red")line_width(optional): Line thickness (default: 3)label(optional): Text label for the box
Example:
Add a red box at position 100, 200 with size 300x150 and label "Important"
Add text annotation.
Parameters:
capture_id: ID of capture to annotatex,y: Text positiontext: Text contentfont_size(optional): Font size (default: 20)color(optional): Text color (default: "red")background(optional): Background color (default: "white")
Example:
Add text "Bug here" at position 500, 300 in blue
Get the annotated image for chat context.
Parameters:
capture_id: ID of capture to retrieveformat(optional): "base64" or "markdown" (default: "markdown")
Example:
Show me capture_001
List all captures in the current session.
Example:
List all captures
Delete a specific capture.
Parameters:
capture_id: ID of capture to delete
Clear all captures from the session.
/workspaces/grabitar/
โโโ overlay.py # Main overlay GUI (Tkinter)
โโโ server.py # MCP server + test page server
โโโ capture_manager.py # Screen capture and session management
โโโ annotations.py # Annotation classes (box, text)
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
โโโ IMPLEMENTATION_PLAN.md # Detailed architecture documentation
โโโ static/ # Test page assets
โ โโโ index.html # Simple test webpage
โ โโโ style.css # (inline in HTML)
โโโ .vscode/
โโโ settings.json # MCP configuration for VSCode
- Run
python overlay.py - Navigate to the buggy UI
- Right-click โ "๐ท Capture Area"
- Select the problem area
- Right-click โ "โฌ Add Square" to highlight the bug
- Right-click โ "๐ Add Text" to add note "Button misaligned"
- In VS Code Copilot: "Analyze the UI bug in my latest capture"
- Have code visible on screen
- Right-click โ "๐ผ๏ธ Capture Window"
- Right-click โ "โฌ Add Square" around function to review
- Right-click โ "๐ Add Text" with note "Needs optimization"
- In Copilot: "Review the highlighted function and suggest improvements"
- Open design in browser/app
- Right-click โ "๐ท Capture Area" on specific component
- Add multiple annotations for different issues
- In Copilot: "Generate CSS to fix the spacing issues highlighted"
python overlay.pypython server.pyThen open http://localhost:9876 to see the test page.
The MCP server runs automatically when VS Code starts (configured in settings). To run manually:
python server.py --mcpLocated in .vscode/settings.json:
{
"mcp.servers": {
"grabitar": {
"command": "python",
"args": ["/workspaces/grabitar/server.py", "--mcp"],
"env": {}
}
}
}Grabitar supports multiple monitors. Use monitor parameter:
0: Primary monitor (all monitors combined)1: First additional monitor2: Second additional monitor- etc.
Linux: May need permissions for screen capture:
# Give permissions if needed
xhost +local:macOS: Grant screen recording permission in System Preferences โ Security & Privacy โ Screen Recording
Windows: Should work out of the box
- Check server is running:
http://localhost:9876 - Check console for errors
- Verify static files exist in
static/directory
- Check Python path: Ensure the
commandin settings.json points to the correct Python executable (with MCP dependencies installed) - Verify paths: In dev containers, use
/workspaces/grabitar/not local paths - Check dependencies: Run
/workspaces/grabitar/.venv/bin/python -c "import mcp"to verify MCP is installed - Reload VSCode: Reload window after changing settings.json
- Check logs: Look for MCP errors in VSCode Output panel (select "MCP" from dropdown)
- Test manually: Run
/workspaces/grabitar/.venv/bin/python server.py --mcpto check for startup errors
- Python 3.8+
- Pillow (image manipulation)
- mss (screen capture)
- FastAPI + Uvicorn (web server)
- MCP SDK (Copilot integration)
See requirements.txt for full list.
- Linux display servers: Works best with X11. Wayland support may vary
- Overlay transparency: May not work perfectly on all platforms/window managers
- Session-based: Captures are stored in memory (cleared on restart)
- No persistence: Captures not automatically saved to disk
- Single capture workflow: Can only annotate the most recently captured image
- Multi-monitor selection - Choose which monitor to overlay
- Persistent storage - Save captures to disk automatically
- Capture history - View and manage multiple captures
- Annotation editing - Edit or delete existing annotations
- More annotation types - Arrows, circles, freehand drawing
- Screen recording - Capture video/GIF in addition to still images
- Hotkeys - Global keyboard shortcuts (e.g., Ctrl+Shift+C to capture)
- Color picker - Choose custom colors for annotations
- Undo/redo - Support for multi-step annotation editing
MIT License - Copyright (c) 2026 Michael Chapel
Michael Chapel
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
- Practice on test page first: Use the test page at localhost:9876 to get comfortable
- Capture then annotate: Always capture the screen before adding annotations
- Use ESC to cancel: Press ESC anytime to cancel a selection or annotation
- Descriptive text: Add clear text labels to help Copilot understand your intent
- Ctrl+Q to quit: Quickly exit the overlay when done
- Different colors: Future versions will support color selection for better categorization
- VS Code integration: Captures are automatically available in Copilot - just reference the capture ID
Made with โค๏ธ for GitHub Copilot and VSCode by Michael Chapel