Screen capture for AI tools
## Screenshot MCP Server: Screen Capture Automation The **Screenshot MCP Server** enables Google Antigravity to capture screenshots, record screen regions, and analyze visual content for automated testing and documentation. ### Why Screenshot MCP? - **Full screen capture** - Capture entire screen or windows - **Region selection** - Capture specific screen regions - **Format options** - PNG, JPEG, WebP output formats - **Analysis ready** - Output optimized for AI analysis - **Automation** - Integrate captures into workflows ### Key Features #### 1. Screen Capture ```python # Capture full screen screenshot = await mcp.call("screenshot", "capture", { "output": "/tmp/screen.png", "format": "png" }) print(f"Saved to: {screenshot[\"path\"]}") print(f"Size: {screenshot[\"width\"]}x{screenshot[\"height\"]}") # Capture specific display await mcp.call("screenshot", "capture", { "display": 1, "output": "/tmp/display1.png" }) ``` #### 2. Region Capture ```python # Capture region region = await mcp.call("screenshot", "capture_region", { "x": 100, "y": 100, "width": 800, "height": 600, "output": "/tmp/region.png" }) # Interactive region selection selected = await mcp.call("screenshot", "select_region", {}) print(f"Selected: {selected[\"x\"]},{selected[\"y\"]} {selected[\"width\"]}x{selected[\"height\"]}") ``` #### 3. Window Capture ```python # List windows windows = await mcp.call("screenshot", "list_windows", {}) for win in windows: print(f"{win[\"id\"]}: {win[\"title\"]}") # Capture specific window await mcp.call("screenshot", "capture_window", { "window_title": "Visual Studio Code", "output": "/tmp/vscode.png" }) ``` #### 4. Image Analysis Prep ```python # Capture and prepare for AI analysis result = await mcp.call("screenshot", "capture_for_analysis", { "max_width": 1024, "quality": 85, "format": "jpeg" }) # Returns base64 encoded image ready for vision models print(f"Base64 length: {len(result[\"base64\"])}") ``` ### Configuration ```json { "mcpServers": { "screenshot": { "command": "npx", "args": ["-y", "@anthropic/mcp-screenshot"] } } } ``` ### Use Cases **Visual Testing**: Capture screenshots for UI regression testing. **Documentation**: Automate screenshot capture for docs. **Bug Reports**: Capture visual context for issue reporting. **AI Analysis**: Prepare images for vision model analysis. The Screenshot MCP Server enables automated screen capture.
{
"mcpServers": {
"screenshot": {
"mcpServers": {
"screenshot": {
"args": [
"-y",
"screenshot-mcp-server"
],
"command": "npx"
}
}
}
}
}